find coordinates after using Houghlinep function

asked 2017-07-06 04:32:08 -0500

Hi guys i'm new to OpenCV. I'm using opencv to remove lines and get removed coordinates from image. I'm using HoughlineP like this `Mat src = imread("F:/003-00.jpg", IMREAD_GRAYSCALE);

Mat bw;
blur(src, bw, Size(3, 3));
pyrDown(bw, bw);

//threshold(bw, bw, 170, 255, THRESH_BINARY_INV);
Canny(bw, bw, 100, 200, 3);

Mat color_dst = Mat::zeros(bw.size(), CV_8UC1);
vector<Vec4i> lines;

HoughLinesP(bw, lines, 1, CV_PI / 180, 400, 300, 20);
for (size_t i = 0; i < lines.size(); i++)

    line(color_dst, Point(lines[i][0], lines[i][1]),
        Point(lines[i][2], lines[i][3]), Scalar(255, 255, 255), 3);


imwrite("F:/result.jpg", color_dst);

and i got a result image like this image description

but one line actually contains many of child lines and group to one bold line Now I want to erode int get x and y coordinates for every line Thanks for help!

edit retag flag offensive close merge delete