Merge contours from image [closed]
My task is to detect shapes on a whiteboard. So far, I have used blur, morphology, edge canny detection and then the findcontour function. I think that the output looks quite look, but the issue i'm facing is that the contours are not "whole". The below image show the original image with the contours displayed.
What I would like is to somehow merge the contours for each rectangle. and discard the contours for the text. Preferably, I would like something like the below image
When looking around the net, people suggest using more morphology (with morph closed on the image) to get more consistent boxes. But I can't really get it to work. Is there a standardized way to archive the desired output, or should I do some calculations myself to see if I can merge the contours? What would you do from here?
I tried with ApproxPolyDP, but since the contours are not "whole" the area returned is very small.
Hello, I was wondering if you ever found a solution to your problem, i'm facing the same thing and even though i tried closing the contours by using the dilate function it didn't give me the output that i was hoping for.