I have a number of different images that have rectangles which I need to identify. These are a mix of coloured and lighter coloured but with a dark dashed line around. Here is an example. These represent tasks that I have created within a task management app.
I want to be able to get a bounding box around each of the rectangles, regardless of whether they are coloured or not. I have taken the following approach:
- Greyscale
- Threshold
- Gaussian blur
- Canny edge
- Find contours
- Find rectangles (check if 4 sides)
This finds Test app 3.
It does not find Test app 4, I believe because the trail of the p drops outside the rectangle so it is no longer a good outline.
I am also not able to identify Test app 1 or Test app 2 due to the dashed lines.
Guidance on either of these issues would be appreciated.
1