Create a box the bounds them into smallest possible box.
Hi guys.. I am trying to bound some points into a box (Rect).. The problem is though the box becomes to large, even though I use boundingRect..
I am trying to box the features The sample code Surf detect on a image.
Code can be seen here.
http://docs.opencv.org/doc/tutorials/...
I want to retract the green square to a rect.
Have you considered to use rotatedRect?
If the rotatedRect does not satisfies you, maybe boundingRect does (even it seems that the first one is much closer from your description)?
I tried both.. and they do not work..
What? how did you tried them? They are not present in the posted code, just add that part
I think it's pretty obvious, but a Rectangle does not only contain 4 sides but also four 90ยบ angles. Therefore you can never get the exact same green box encapsulated in a Rect structure. Obviously, both rotatedRect and boundingRect will produce rectangles bigger than the green box
They work but the issue is they create a area that is too big compared to the points..
If you post your code and some images of the output, we'd probably understand the problem better
Do you want to encapsulate just the matches or the whole object?
Just the matches..
minAreaRect should do it, but the input should be
obj