Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

curved line detection

I'm using OpenCV (in Java) to implement curved line detection, to detection a curve like the yellow one in this image. I do not know how. Help.

image description original img image description < detection curve line

MatOfInt4 lines = new MatOfInt4();
Imgproc.HoughLinesP(mat, lines, 1, Math.PI / 180, 20, 15, 10);

for (int i = 0; i < lines.cols(); i++) {
    double[] l          = lines.get(0, i);
    Point startPoint    = new Point(l[0], l[1]);
    Point endPoint      = new Point(l[2], l[3]);

    Core.line(mat, startPoint, endPoint, new Scalar(255, 0, 255), 1);
}

curved line detection

I'm using OpenCV (in Java) to implement curved line detection, to detection a curve like the yellow one in this image. I do not know how. Help.

original img
image description


original img image description < detection curve line
image description

MatOfInt4 lines = new MatOfInt4();
Imgproc.HoughLinesP(mat, lines, 1, Math.PI / 180, 20, 15, 10);

for (int i = 0; i < lines.cols(); i++) {
    double[] l          = lines.get(0, i);
    Point startPoint    = new Point(l[0], l[1]);
    Point endPoint      = new Point(l[2], l[3]);

    Core.line(mat, startPoint, endPoint, new Scalar(255, 0, 255), 1);
}

curved line detection

I'm using OpenCV (in Java) to implement curved line detection, to detection a curve like the yellow one in this image. I do not know how. Help.

original imgimage
image descriptionimage description


detection curve line
image description

MatOfInt4 lines = new MatOfInt4();
Imgproc.HoughLinesP(mat, lines, 1, Math.PI / 180, 20, 15, 10);

for (int i = 0; i < lines.cols(); i++) {
    double[] l          = lines.get(0, i);
    Point startPoint    = new Point(l[0], l[1]);
    Point endPoint      = new Point(l[2], l[3]);

    Core.line(mat, startPoint, endPoint, new Scalar(255, 0, 255), 1);
}