multiple contour bounding box
Hi all. I am detecting contours in an image, and need to draw a bounding box around them all.
Right now i have a cluster of contours, and I need to run a polygon approximation that joins the external edges as a square. Picture the 'five' side of a dice, where only the dots are visible. I have each dot as a separate contour. How would I draw a square bounding box that connects the external corners and stays connecting them no matter what the rotation?
Thank you!
c++, visual studio.
you could join the boundingRects with the
|
operator:Thanks! That works. BUT, As I have contours on the corners and contours in the middle, is there a way to make sure i am using the outermost edge?
Also, is the code different with a Rotatedrect? I can't get that one to work. thanks again!
no such operators for RotatedRect, unfortunately.