Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

ofxKinectNuiPlayer wasn't rendering skeletons correctly. The skeleton p... #2

Merged
merged 1 commit into from

2 participants

@jefftimesten

...oints are recorded un-normalized, so they need to be normalized and then adjusted to width/height. Plus, I don't think the min() are needed because the skeleton points often go outside of the resolution of the depth image, and this is a desired behavior.

@jefftimesten jefftimesten ofxKinectNuiPlayer wasn't rendering skeletons correctly. The skeleton…
… points are recorded un-normalized, so they need to be normalized and then adjusted to width/height. Plus, I don't think the min() are needed because the skeleton points often go outside of the resolution of the depth image, and this is a desired behavior.
e0dbde9
@sadmb sadmb merged commit d326f43 into sadmb:master
@sadmb
Owner

Thx Jeff, I will also fix recording without audio asap. : )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 22, 2012
  1. @jefftimesten

    ofxKinectNuiPlayer wasn't rendering skeletons correctly. The skeleton…

    jefftimesten authored
    … points are recorded un-normalized, so they need to be normalized and then adjusted to width/height. Plus, I don't think the min() are needed because the skeleton points often go outside of the resolution of the depth image, and this is a desired behavior.
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/ofxKinectNuiPlayer.cpp
View
4 src/ofxKinectNuiPlayer.cpp
@@ -860,8 +860,8 @@ float ofxKinectNuiPlayer::getAudioAngleConfidence() {
@return Scaled skeleton point
*/
ofPoint ofxKinectNuiPlayer::calcScaledSkeletonPoint(const ofPoint& skeletonPoint, float width, float height){
- float px = min((skeletonPoint.x * width) + 0.5f, (float)width);
- float py = min((skeletonPoint.y * height) + 0.5f, (float)height);
+ float px = ofMap(skeletonPoint.x, 0, depthWidth, 0, width);
+ float py = ofMap(skeletonPoint.y+15, 0, depthHeight, 0, height); // +15 - the skeletons are a little high
return ofPoint(px, py);
}
Something went wrong with that request. Please try again.