I have input images which look like this:
I like to segment the images in a way that i get approximated polygons which only contain horizontal an vertical lines.
My first approach was a hough segmentation, but i was only able to create rectangular objects. This does not work for the second image.
Then i tried to use a decision tree: For each image i trained a decision tree with the inputs x
and y
positions of all pixels and the classification black/white. Then i only used the first n
layer of this tree. With this new tree i did a prediction for all pixels. Sometimes this worked well, but sometimes it didn't. Especially the tree depth varies from picture to picture...
Maybe someone has an idea how to do this? Or is there already an algorithm for this use case available?
Thank you very much
Regards
Kevin