How do you use OpenCV to find horizontal angle and vertical angle from the center of an image to the center of a rectangular contour?
I need a turret to rotate to a certain point using a camera, so I need angles.
Are you familiar with the dot product operation? https://www.mvps.org/directx/articles...
Yes, but I don't know what that has to do with dot product.
PLEASE HELP SHAWN!
SHAWN!!! HELP!!!
It says right on that page how to get the angle from the two vectors. Have fun!
HALAYKA WALA BABU!
Yes, but what are the vectors?
I have 2 points, not vectors!
How to get the vectors?
It looks like I have to come to Saskatchewan itself to ask you!
You subtract the centre point of the rectangle from the centre point of the image to get a vector. You may have to negate it. I'm bad at the math. ;) Your other vector depends on if you're getting the horizontal or vertical angle.
Come live in Saskatchewan, get free healthcare.
You should check out a textbook on Linear Algebra.
Ok, I'll definitely learn linear algebra soon, but not too soon since I wanna do some OpenCV and make a autonomous turret first.
Well, at least learn the part pertaining to unit vectors and the dot product.
I know about vectors, it's just that the one you told me is the wrong vector. That vector won't help me. I need the angle horizontally and vertically the turret would have to rotate.