title: Cannot detect horizontal lines of an image
body: <p>I'm writing a mobile app to plot the graphical representation (graphs and charts) of images of statistical data tables. currently i'm writing the table detection module of the project using OpenCV with c++. </p>
  
  <p>I have already applied adaptiveThreshold and Canny to detect the largest Contour and cropped out the table. (<a href="https://i.imgur.com/clBS3dr.jpg" rel="nofollow">https://i.imgur.com/clBS3dr.jpg</a>)</p>
  
  <p>and following is the code i'm using to detect the horizontal and vertical lines: Note: "Crop" is the already cropped table image(Mat)</p>
  
  <pre><code>cvtColor(crop, crop, CV_RGB2GRAY);
  adaptiveThreshold(crop, crop, 255, CV_ADAPTIVE_THRESH_MEAN_C,CV_THRESH_BINARY, 31, 15); 
      Mat dst1, cdst1;
  Canny(crop, dst1, 50, 200, 3); 
  cvtColor(dst1, cdst1, CV_GRAY2BGR); 
  
  vector&lt;Vec2f&gt; lines;
  // detect lines
  HoughLines(dst1, lines, 1, CV_PI/180, 200, 0, 0 );
  //HoughLinesP(dst1, lines, 1, CV_PI/180, 150, 0, 0);
  
  // draw lines
  for( size_t i = 0; i &lt; lines.size(); i++ )
  {
      float rho = lines[i][0], theta = lines[i][1];
      //if( theta&gt;CV_PI/180*170 || theta&lt;CV_PI/180*10){
          Point pt1, pt2;
          double a = cos(theta), b = sin(theta);
          double x0 = a*rho, y0 = b*rho;
          pt1.x = cvRound(x0 + 1000*(-b));
          pt1.y = cvRound(y0 + 1000*(a));
          pt2.x = cvRound(x0 - 1000*(-b));
          pt2.y = cvRound(y0 - 1000*(a));
          line( cdst1, pt1, pt2, Scalar(0,0,255), 3, CV_AA);
      //}
  }
  namedWindow("detected lines",WINDOW_NORMAL);
  imshow("detected lines", cdst1);
  </code></pre>
  
  <p>And the result of this code comes out like this : <a href="https://i.imgur.com/yDuCqmo.jpg" rel="nofollow">https://i.imgur.com/yDuCqmo.jpg</a></p>
  
  <p>What am I going wrong to the Horizontal lines only to reach half of the image?</p>