I found outlines on two images with the same object, and I want to find the offset and rotation of this object. I tried with the rotating bounding rectangles of these contours, and then its corners and center points, but the turns of the bounding rectangles do not indicate the correct rotation of the contour, because they are the same for angles a + 0, a + 90, a + 180, etc. degrees. Is there any other good way to find the rotation and offset of the contours? Maybe some use a convex hull, convex defects? I read in Learning OpenCv about contour matching, but that didn't help. Can someone give an example?
// edit: Maybe there is some way to use something similar to Freeman chains? But at the moment I can not calculate the algorithm. Creating a chain with angles between a point in a sequence, and then checking if the sequence matches, does not work well ...
krzych
source share