How to detect a rectangle is closed or not

I’ve bellow two rectangle, which owns the same vetext, thus the result from findContours are same as well. is there any way to check the difference?

what is the source data of your drawing?

does that matter the solution, it’s UI screenshot, may be by WPF

just saying, your UI might resize images, leading to vanishing horizontal/vertical 1-pixel lines

please show original data / how you got those rects

try to fill it or look for connected componenent

1 Like