<p>There's quite a bit wrong here so I'll just start from the beginning.</p>

<p>Ok, first thing you do after opening an image is tresholding. I recommend strongly that you have another look at the OpenCV manual on <a href="http://docs.opencv.org/2.4/doc/tutorials/imgproc/threshold/threshold.html" rel="noreferrer">tresholding</a> and the exact meaning of the <a href="http://docs.opencv.org/2.4/modules/imgproc/doc/miscellaneous_transformations.html?highlight=threshold#threshold" rel="noreferrer">treshold methods</a>. </p>

<p>The manual mentions that</p>

<blockquote>
  <p>cv2.threshold(src, thresh, maxval, type[, dst]) → retval, dst</p>
  
  <p>the special value THRESH_OTSU may be combined with one of the above
  values. In this case, the function determines the optimal threshold
  value using the Otsu’s algorithm and uses it instead of the specified
  thresh .</p>
</blockquote>

<p>I know it's a bit confusing because you don't actully <em>combine</em> THRESH_OTSU with any of the other methods (THRESH_BINARY etc...), unfortunately that manual can be like that. What this method actually does is it assumes that there's a "foreground" and a "background" that follow a bi-modal histogram and then applies the THRESH_BINARY I believe. </p>

<p>Imagine this as if you're taking an image of a cathedral or a high building mid day. On a sunny day the sky will be very bright and blue, and the cathedral/building will be quite a bit darker. This means the group of pixels belonging to the sky will all have high brightness values, that is will be on the right side of the histogram, and the pixels belonging to the church will be darker, that is to the middle and left side of the histogram.</p>

<p>Otsu uses this to try and guess the right "cutoff" point, called thresh. For your image Otsu's alg. supposes that all that white on the side of the map is the background, and the map itself the foreground. Therefore your image after thresholding looks like this:</p>

<p><a href="https://i.stack.imgur.com/Z0IJx.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/Z0IJx.jpg" alt="Image after OP&#39;s thresholding"></a></p>

<p>After this point it's not hard to guess what goes wrong. But let's go on, What you're trying to achieve is, I believe, something like this:</p>

<pre><code>flag,b = cv2.threshold(gray,160,255,cv2.THRESH_BINARY)
</code></pre>

<p><a href="https://i.stack.imgur.com/nHgVu.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/nHgVu.jpg" alt="Image with manually guessed threshold."></a></p>

<p>Then you go on, and try to erode the image. I'm not sure why you're doing this, was your intention to "bold" the lines, or was your intention to remove noise. In any case you never assigned the result of erosion to something. Numpy arrays, which is the way images are represented, are mutable but it's not the way the syntax works:</p>

<pre><code>cv2.erode(src, kernel, [optionalOptions] ) → dst
</code></pre>

<p>So you have to write:</p>

<pre><code>b = cv2.erode(b,element)
</code></pre>

<p>Ok, now for the element and how the erosion works. Erosion drags a kernel over an image. Kernel is a simple matrix with 1's and 0's in it. One of the elements of that matrix, usually centre one, is called an anchor. An anchor is the element that will be replaced at the end of the operation. When you created </p>

<pre><code>cv2.getStructuringElement(cv2.MORPH_CROSS, (1, 1))
</code></pre>

<p>what you created is actually a 1x1 matrix (1 column, 1 row). This makes erosion completely useless. </p>

<p>What erosion does, is firstly retrieves all the values of pixel brightness from the original image where the kernel element, overlapping the image segment, has a "1". Then it finds a minimal value of retrieved pixels and replaces the anchor with that value.</p>

<p>What this means, in your case, is that you drag <code>[1]</code> matrix over the image, compare if the source image pixel brightness is larger, equal or smaller than itself and then you replace it with itself. </p>

<p>If your intention was to remove "noise", then it's probably better to use a rectangular kernel over the image. Think of it this way, "noise" is that thing that "doesn't fit in" with the surroundings. So if you compare your centre pixel with it's surroundings and you find it doesn't fit, it's most likely noise. </p>

<p>Additionally, I've said it replaces the anchor with the minimal value retrieved by the kernel. Numerically, minimal value is 0, which is coincidentally how black is represented in the image. This means that in your case of a predominantly white image, erosion would "bloat up" the black pixels. Erosion would replace the 255 valued white pixels with 0 valued black pixels if they're in the reach of the kernel. In any case it shouldn't be of a shape (1,1), ever. </p>

<pre><code>&gt;&gt;&gt; cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (3, 3))
array([[0, 1, 0],
       [1, 1, 1],
       [0, 1, 0]], dtype=uint8)
</code></pre>

<p>If we erode the second image with a 3x3 rectangular kernel we get the image bellow.</p>

<p><a href="https://i.stack.imgur.com/v45xw.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/v45xw.jpg" alt="Eroded threshed image."></a></p>

<p>Ok, now we got that out of the way, next thing you do is you find edges using Canny edge detection. The image you get from that is:</p>

<p><a href="https://i.stack.imgur.com/PbaBh.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/PbaBh.jpg" alt="Canny edges"></a></p>

<p>Ok, now we look for <strong>EXACTLY</strong> vertical and <strong>EXACTLY</strong> horizontal lines <strong>ONLY</strong>. Of course there are no such lines apart from the meridian on the left of the image (is that what it's called?) and the end image you get after you did it right would be this:</p>

<p><a href="https://i.stack.imgur.com/wI1Oy.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/wI1Oy.jpg" alt="enter image description here"></a></p>

<p>Now since you never described your exact idea, and my best guess is that you want the parallels and meridians, you'll have more luck on maps with lesser scale because those aren't lines to begin with, they are curves. Additionally, is there a specific reason to get a Probability Hough done? The "regular" Hough doesn't suffice?</p>

<p>Sorry for the too-long post, hope it helps a bit.</p>

<hr>

<p>Text here was added as a request for clarification from the OP Nov. 24th. because there's no way to fit the answer into a char limited comment.</p>

<p>I'd suggest OP asks a new question more specific to the detection of <strong>curves</strong> because you are dealing with curves op, not horizontal and vertical <strong>lines</strong>.</p>

<p>There are several ways to detect curves but none of them are easy. In the order of simplest-to-implement to hardest:</p>

<ol>
<li>Use RANSAC algorithm. Develop a formula describing the nature of the long. and lat. lines depending on the map in question. I.e. latitude curves will almost be a perfect straight lines on the map when you're near the equator, with the equator being the perfectly straight line, but will be very curved, resembling circle segments, when you're at high latitudes (near the poles). SciPy already has <a href="http://scipy-cookbook.readthedocs.org/items/RANSAC.html" rel="noreferrer">RANSAC</a> implemented as a class all you have to do is find and the programatically define the model you want to try to fit to the curves. Of course there's the ever-usefull 4dummies text <a href="http://old.vision.ece.ucsb.edu/~zuliani/Research/RANSAC/docs/RANSAC4Dummies.pdf" rel="noreferrer">here</a>. This is the easiest because all you have to do is the math. </li>
<li>A bit harder to do would be to create a rectangular grid and then try to use cv findHomography to warp the grid into place on the image. For various geometric transformations you can do to the grid you can check out <a href="http://docs.opencv.org/2.4/modules/imgproc/doc/geometric_transformations.html" rel="noreferrer">OpenCv manual</a>. This is sort of a hack-ish approach and might work worse than 1. because it depends on the fact that you can re-create a grid with enough details and objects on it that cv can identify the structures on the image you're trying to warp it to. This one requires you to do similar math to 1. and just a bit of coding to compose the end solution out of several different functions.</li>
<li>To actually do it. There are mathematically neat ways of describing curves as a list of tangent lines on the curve. You can try to fit a bunch of shorter HoughLines to your image or image segment and then try to group all found lines and determine, by assuming that they're tangents to a curve, if they really follow a curve of the desired shape or are they random. See <a href="http://arxiv.org/pdf/1501.03124.pdf" rel="noreferrer">this paper</a> on this matter. Out of all approaches this one is the hardest because it requires a quite a bit of solo-coding and some math about the method.</li>
</ol>

<p>There could be easier ways, I've never actually had to deal with curve detection before. Maybe there are tricks to do it easier, I don't know. If you ask a new question, one that hasn't been closed as an answer already you might have more people notice it. Do make sure to ask a full and complete question on the exact topic you're interested in. People won't usually spend so much time writing on such a broad topic.</p>

<p>To show you what you can do with just Hough transform check out bellow:</p>

<pre><code>import cv2
import numpy as np

def draw_lines(hough, image, nlines):
   n_x, n_y=image.shape
   #convert to color image so that you can see the lines
   draw_im = cv2.cvtColor(image, cv2.COLOR_GRAY2BGR)

   for (rho, theta) in hough[0][:nlines]:
      try:
         x0 = np.cos(theta)*rho
         y0 = np.sin(theta)*rho
         pt1 = ( int(x0 + (n_x+n_y)*(-np.sin(theta))),
                 int(y0 + (n_x+n_y)*np.cos(theta)) )
         pt2 = ( int(x0 - (n_x+n_y)*(-np.sin(theta))),
                 int(y0 - (n_x+n_y)*np.cos(theta)) )
         alph = np.arctan( (pt2[1]-pt1[1])/( pt2[0]-pt1[0]) )
         alphdeg = alph*180/np.pi
         #OpenCv uses weird angle system, see: http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_imgproc/py_houghlines/py_houghlines.html
         if abs( np.cos( alph - 180 )) &gt; 0.8: #0.995:
            cv2.line(draw_im, pt1, pt2, (255,0,0), 2)
         if rho&gt;0 and abs( np.cos( alphdeg - 90)) &gt; 0.7:
            cv2.line(draw_im, pt1, pt2, (0,0,255), 2)    
      except:
         pass
   cv2.imwrite("/home/dino/Desktop/3HoughLines.png", draw_im,
             [cv2.IMWRITE_PNG_COMPRESSION, 12])   

img = cv2.imread('a.jpg')
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)

flag,b = cv2.threshold(gray,160,255,cv2.THRESH_BINARY)
cv2.imwrite("1tresh.jpg", b)

element = np.ones((3,3))
b = cv2.erode(b,element)
cv2.imwrite("2erodedtresh.jpg", b)

edges = cv2.Canny(b,10,100,apertureSize = 3)
cv2.imwrite("3Canny.jpg", edges)

hough = cv2.HoughLines(edges, 1, np.pi/180, 200)   
draw_lines(hough, b, 100)
</code></pre>

<p>As you can see from the image bellow, straight lines are only longitudes. Latitudes are not as straight therefore for each latitude you have several detected lines that behave like tangents on the line. Blue drawn lines are drawn by the <code>if abs( np.cos( alph - 180 )) &gt; 0.8:</code> while the red drawn lines are drawn by <code>rho&gt;0 and abs( np.cos( alphdeg - 90)) &gt; 0.7</code> condition. Pay close attention when comparing the original image with the image with lines drawn on it. The resemblance is uncanny (heh, get it?) but because they're not lines a lot of it only looks like junk. (especially that highest detected latitude line that seems like it's too "angled" but in reality those lines make a perfect tangent to the latitude line on its thickest point, just as hough algorithm demands it). Acknowledge that there are limitations to detecting curves with a line detection algorithm</p>

<p><a href="https://i.stack.imgur.com/OlM2F.png" rel="noreferrer"><img src="https://i.stack.imgur.com/OlM2F.png" alt="Best possible detected lines."></a></p>
Python OpenCV HoughLinesP Fails to Detect Lines
<p>I am using OpenCV HoughlinesP to find horizontal and vertical lines. It is not finding any lines most of the time. Even when it finds a lines it is not even close to actual image.</p>

<pre><code>import cv2
import numpy as np

img = cv2.imread('image_with_edges.jpg')
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)


flag,b = cv2.threshold(gray,0,255,cv2.THRESH_OTSU)

element = cv2.getStructuringElement(cv2.MORPH_CROSS,(1,1))
cv2.erode(b,element)

edges = cv2.Canny(b,10,100,apertureSize = 3)

lines = cv2.HoughLinesP(edges,1,np.pi/2,275, minLineLength = 100, maxLineGap = 200)[0].tolist()

for x1,y1,x2,y2 in lines:
   for index, (x3,y3,x4,y4) in enumerate(lines):

    if y1==y2 and y3==y4: # Horizontal Lines
        diff = abs(y1-y3)
    elif x1==x2 and x3==x4: # Vertical Lines
        diff = abs(x1-x3)
    else:
        diff = 0

    if diff &lt; 10 and diff is not 0:
        del lines[index]

    gridsize = (len(lines) - 2) / 2

   cv2.line(img,(x1,y1),(x2,y2),(0,0,255),2)
   cv2.imwrite('houghlines3.jpg',img)
</code></pre>

<p>Input Image:
<a href="https://i.stack.imgur.com/1BXDZ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1BXDZ.jpg" alt="input image"></a></p>

<p>Output Image: (see the Red Line):
<a href="https://i.stack.imgur.com/iNAzT.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iNAzT.jpg" alt="enter image description here"></a></p>

<p>@ljetibo Try this with:
<a href="http://www.lib.utexas.edu/maps/onc/txu-pclmaps-oclc-8322829_c_6.jpg" rel="nofollow noreferrer">c_6.jpg</a></p>