I was looking at Opencv Java documentation of Hough Transform.
The return value lines
is in a Mat
data type described as:
Here's some code I used a while ago, in version 2.4.8 I think. matLines
came from this:
Imgproc.HoughLinesP(matOutline, matLines, 1, Math.PI / 180, houghThreshCurrent, houghMinLength, houghMaxGap);
...
Point[] points = new Point[]{ new Point(), new Point() };
for (int x = 0; x < matLines.cols(); x++) {
double[] vec = matLines.get(0, x);
points[0].x = vec[0];
points[0].y = vec[1];
points[1].x = vec[2];
points[1].y = vec[3];
//...
}