Notifications
Clear all

[Closed] 4 point tracking orientation

I’m working on a project involving tracking several boxes from two video cameras. Am tracing with 4 points the top of every box and would like to obtain position and orientation from this.

   a------b
   | \....      / |
   | .   \ / ..|
   |    ...e ..    |
   | .  /  \ ..|
   |  /.... \ |
   d------c

Have figured that I could simply find midpoint between two points such as (a and c) or (b and d) and then take midpoint from those. For orientation am trying to find how to calculate angle from (a to d). Is there a particular formula to find these?

2 Replies

To find the angle between 2 (2d) points you can use

n = normalize (d - a)
atan2 n.y n.x

Martijn

Thanks for solution. I ended up finding an answer with this script: http://www.scriptspot.com/3ds-max/three-point-orientation which runs based on 3 points rather than 4 which in the end was simpler to use. Modified much of code to work to work with mine such as position is set to midpiont rather than setting position at one of the points.