title: OpenCV Houghline function create unlimited lines
body: <p>I am still very new to OpenCV and recently came across the Houghline function. I am using OpenCV 3.2 with Visual Studio 2015. I tried the sample code for HoughlineP without success. The code compiles fine but it runs endless, and sometimes when I push "stop debugging" it popup "Unhandled exception at.........Access violation reading location ..." errors. When I debugged it, it seems cause by the HoughlinsP function (the Canny and cvtColor works good). The lines size=1152921504603840390 (a ridiculous huge number) after the HoughlinesP function. Could you please advice? Thank you.</p>
  
  <pre><code>#include &lt;opencv2/imgproc.hpp&gt;
  #include &lt;opencv2/highgui.hpp&gt;
  using namespace cv;
  using namespace std;
  int main()
  {
  Mat src, dst, color_dst;
  src = imread("C:\\\Temp\\\img.jpg");
  if (src.empty())
      return -1;
  Canny(src, dst, 50, 200, 3);
  cvtColor(dst, color_dst, COLOR_GRAY2BGR);
  
  vector&lt;Vec4i&gt; lines;
  HoughLinesP(dst, lines, 1, CV_PI / 180, 80, 30, 10);
  for (size_t i = 0; i &lt; lines.size(); i++)
  {
      line(color_dst, Point(lines[i][0], lines[i][1]),
          Point(lines[i][2], lines[i][3]), Scalar(0, 0, 255), 3, 8);
  }
  
  namedWindow("Source", 1);
  imshow("Source", src);
  namedWindow("Detected Lines", 1);
  imshow("Detected Lines", color_dst);
  waitKey(0);
  return 0;
  }
  </code></pre>