Here's an image from the sample images of openCV:
I would like to automatically draw rectangles around the black boxes.
My initial idea was to find contours and find those with the largest area, or see if they actually match a rectangle.
I have tried several filters (different combinations of canny
, threshold
with varying parameters) in conjunction with the findContours
function. It seems the boxes are actually entirely missed by these methods.
Heres a pyplot of one of my attempts. As you can see, the boxes aren't even recognized as contours.
Is there some smarter way of doing this? I would think there should could be a function like matchShape
or something where it would match a some preset shape.
I am researching possibilities of automatically aligning probes for a university project. The long term goal, after this example, is to make markings on the chip that I could recognize for alignment.