1. The problem
Given the images of a house roof, I am trying to find the contours of the roofs. I have labelled data available (as polygon vertices) which I interpolate and create the truth image which is shown below
I use canny, hough-lines, LBP features to train an ML model the results look decent. the model output is shown in the middle, and overlay on test image is shown on right.
2. What I need.
The final output should really be a set of polygons and I need to find the points on which these polygons should be drawn (see the highlighted points in image below). So the output can be set of n line segments. where each line segment is 2 points [(x1,y1),(x2,y2)]
3. What are my thoughts/ideas;
a. Erosion,Dilation,Opening,closing,skeletonize operations
While these operations make the lines in the above image much neater, they don’t help me find the polygon vertices I am looking for.
I'd like to fit (a number of) lines to the white pixels in the image (something like hough lines).
The intersections of these lines would give me the vertices for the polygons I am looking for.
I am wondering if there is a more standard/better way of accomplishing the above.