Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Well, after hard work I have a solution. I look forward your inputs, ideas and improvments.

First, I did some noise removal to obtain cleaner lines

Mat se = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(7,7));
Imgproc.morphologyEx(grayOnly, grayOnly, Imgproc.MORPH_OPEN, se);

image description

Then HoughLines transform as I did before, this time the image is cleaner

image description

I have drawn the lines with a large thickness to obtain a single object in the image

Imgproc.line(result, pt1, pt2, new Scalar(0, 0, 0), 35);

image description

Last step, the most important, I applied Zhang Suen thinning alghoritm (skeletonization). I found a good reference here

The final result is the following

image description

Well, after hard work I have a solution. I look forward your inputs, ideas and improvments.improvements.

First, I did some noise removal to obtain cleaner lines

Mat se = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(7,7));
Imgproc.morphologyEx(grayOnly, grayOnly, Imgproc.MORPH_OPEN, se);

image description

Then HoughLines transform as I did before, this time the image is cleaner

image description

I have drawn the lines with a large thickness to obtain a single object in the image

Imgproc.line(result, pt1, pt2, new Scalar(0, 0, 0), 35);

image description

Last step, the most important, I applied Zhang Suen thinning alghoritm (skeletonization). I found a good reference here

The final result is the following

image description

The approximation seems good

image description