K
K
Kalombyr2019-03-05 16:20:46
OpenCV
Kalombyr, 2019-03-05 16:20:46

Opencv how to find the shift and rotation of an object in a frame?

Good day!
There are two frames in which the desired object is present.
The first "template" frame, the second with camera rotation and shift.
Found an object in a template frame, selected it, made a "mask" (only this object is present, the rest is black).
I find the offset of the object using "phaseCorrelate", it turns out acceptable, but if there is also a rotation, then the offset (of course) is absolutely wrong.
How can you optimally find another turn?
PS I thought to translate both frames into polar coordinates and find the rotation using "phaseCorrelate", but the object is not in the center of the frame.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question