Android OpenCV Drawing Hough Lines

后端 未结 3 1257
执念已碎
执念已碎 2020-12-04 22:58

I am trying to use OpenCV on an android phone to detect lines. I modified the \'Tutorial 1 Basic - 2. Use OpenCV Camera\' sample. I am also using Hough Line Transform as an

3条回答
  •  盖世英雄少女心
    2020-12-04 23:41

    You draw the lines to the mIntermediateMat image, but returning mRgba image. That's why you don't see the lines.

    The -1000..1000 range for b is correct. HoughLines returns a line angle and distance from zero (a.k.a. rho and theta). To draw them, you need to convert them to two points. The 1000's are the image dimensions, if you would draw to a 2000x2000 image, increase them to 2000 or otherwise the lines will not cross the entire image.

    HoughLines is different algorithm from HoughLinesP. HoughLines only finds lines, that cross the entire image. HoughLinesP returns shorter line segments.

提交回复
热议问题