Skip to content
This repository has been archived by the owner on May 3, 2021. It is now read-only.

Poor Z-Estimate during partial oclusion and controller tilt #21

Open
Ixstala opened this issue Jan 12, 2016 · 2 comments
Open

Poor Z-Estimate during partial oclusion and controller tilt #21

Ixstala opened this issue Jan 12, 2016 · 2 comments

Comments

@Ixstala
Copy link

Ixstala commented Jan 12, 2016

I've noticed that the Z-estimate from either the circle or ellipse fit becomes very unstable when only part of the 'bulb' is visible. This can happen when you tip the controller away from the camera by as little as 30 degrees.

I tested out using cvMinEnclosingCircle to fit the circle and this works much much better. It yields a more accurate and stable solution than the current methods for even more extreme sight lines than was previously possible. This method also seems to be faster.

I added the following to "psmove_tracker_update_controller_position_from_contour" where it would usually estimate a circle from the contour:

CvPoint2D32f Center;
CvPoint Center2;
float Radii = 0;
cvMinEnclosingCircle(contourBest, &Center, &Radii);
tc->x = Center.x;
tc->y = Center.y;
tc->r = Radii;

And then I ignore the contour quality check in "psmove_tracker_update_controller" where it looks at the aspect ratio of a bounding box. This may not be the 'correct' thing to do, but it let me check functionality.

Try it out and see what you think. This may be worth incorporating unless you've already found some other reason to kill this.

@cboulay
Copy link
Collaborator

cboulay commented Jan 12, 2016

You're definitely right that the current method is sub-optimal. You're modification seems reasonable.

The the new PSMoveService that we are working on, we are thinking about implementing something like what's described here. My understanding is that it fits a cone to the data points then from the cone parameters it can get the 3D position of the sphere. I don't yet know how he does it, but I haven't begun to try.

@Ixstala
Copy link
Author

Ixstala commented Jan 12, 2016

Wow, that looks pretty stupendous!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants