psmoveservice / psmove-ue4

Plugin for using PSMove as input into Unreal Engine 4. Currently obsolete. Please use PSMoveService.
GNU General Public License v2.0
59 stars 28 forks source link

I found an error in tracker algorithm #30

Closed yang3kui closed 7 years ago

yang3kui commented 7 years ago

Hi,

Great work you have done!

Recently, i was working on a similar project, and had got a lot of inspiration from your codes and comments.

Meanwhile, I found an error in your tracker algorithm described here.

When you project a sphere to a plane perspectively, you get an ellipse. That is correct.

However, the center of the ellipse may not correspond to the center of the sphere.

So, here

You compute theta as

theta = atan2(L_px, f_px)

Theta is actually the angle to the center of the ellipse. However, i think you intended to compute the angle to the center of the sphere. These two angles are different.

In my opnion the correct way to compute the angle to the center of the sphere should be

double theta = (atan2(L_px - a_px, f_px)+ atan2(L_px + a_px, f_px)) / 2;

The difference is not negligible especially when you use a tracking camera with large FOV.

cboulay commented 7 years ago

I haven't used psmove-ue4 in a long time. Can you take a look at the psmoveservice algorithms instead? here. The second one is the better one. Please post in PSMoveService issues if you have any suggestions for those algorithms.

yang3kui commented 7 years ago

All right, i'll post it in PSMoveService issues.

Should i close this one or leave it open?