Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Odd coordinates coming from framework #4

Open
mihai-moldovan opened this issue Sep 3, 2015 · 1 comment
Open

Odd coordinates coming from framework #4

mihai-moldovan opened this issue Sep 3, 2015 · 1 comment

Comments

@mihai-moldovan
Copy link

Hi,
when testing the Kinect near its limits (window margins in the Windows application) the coordinates yielded by the adddon were very odd, sometime getting negative.
After some debugging I found this code in DataTransform/Parser.cpp

ofVec3f Parser::orient(ofVec3f &point){
    point.x = ofMap(point.x, -1, 1, 0, ofGetWidth());
    point.y = ofMap(point.y, -1, 1, ofGetHeight(), 0);
    point.z = ofMap(point.z, 0, 2, 30, 10);
    return point;
}

Although it should fit most of the normal users, it doesn't give a correct perception of the actual joint position, especially if one needs the position relative to real world, not the one relative to OF window.

The coordinates received by Kinect are in meters, with the origin in the kinect itself. So x axis is paralel to Kinect, y axis is perpendicular to x axis going up-down, and z axis perpendicular on XoY plane.

Basically the addon returns readable data for a cube of 2 meters size and maps this cube to the window dimensions.

I think it's better to just send the actual real world position and let the developer map the coordinates to whatever other system he wants.

my working copy looks like this:

ofVec3f Parser::orient(ofVec3f &point){
    //point.x = ofMap(point.x, -1, 1, 0, ofGetWidth());
    //point.y = ofMap(point.y, -1, 1, ofGetHeight(), 0);
    //point.z = ofMap(point.z, 0, 2, 30, 10);
    return point;
}

Thanks,
Mihai

@microcosm
Copy link
Owner

Hey, thanks. Good point. When I get a sec I'll simply make both options available through the API.

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

No branches or pull requests

2 participants