I'm trying to detect a plastic object on video stream using OpenCV 2.4.9 on C++.
The object has six angles and its contour looks like :.
For each frame I'm doing some kind of segmentation and edges detection. After these operations i got some binary image containing corrupted contours of the object and some noise from background.
For example: or
I need somehow to detect my object here and restore contours. Could you advise some methods? I need a fast method since I want to run this program on android phone.
I know the proportions of my object. And the camera is always approximately at normal angle to the object's surface.
Sometimes when the contour is not corrupted much i can find the correct bounding box, but in other cases I can't.
I think that I need to use somehow the information about object's geometry here. I will appreciate any help!
UPD:
If I have found a partial contour of the object, is it possible to fit My shape somehow inside found contour to obtain missing lines?