hi folks, i’m on a very short deadline for my bachelor project and i need your help with this.
i want to track one person via ofxkinect and 2 kinects, it’s very simple, both kinects should just give me the depth information of one single blob so i can map them to an x and y position. The kinects are positioned in a right angle.
Right now i just ask for the center of the blobs, but the values aren’t very smooth. Can you help me to get an smooth average distance of one blob?
i would make a vector of a ofVec3f and a function to:
check for a vector size, if its more than x delete last element
insert the ofVec3f in the vector
in update check for blob, if blob found push_back the centroid in the vector
when you want to use the value, you want to sum all values in the z position and divide that by the vector length
this way you have an average ofVec3f point
hm, i dont know ofxKinect, but ofxOpenNI can give you directly a 3dVector of a tracked User (the center of the tracked user), i would try to get the MEDIAN of this over the last seconds from both cams…
greetings ascorbin
contourFinder is the component that finds the countours. What I would do is get the contour x and y position and then look at the pixels contained within that.
for( int i = contourFinder.blobs[0].centroid.x - 8; i < contourFinder.blobs[0].centroid.x + 8; i++) {
for( int j = contourFinder.blobs[0].centroid.y - 8; j < contourFinder.blobs[0].centroid.y + 8; j++) {
dist += kinect.getDistanceAt(i,j);
}
}
dist /= 64; // i.e. 8x8