예제 #1
0
//------------------------------------
ofxPoint3f ofxKinect::getWorldCoordinateFor(int x, int y) {
	//Based on http://graphics.stanford.edu/~mdfisher/Kinect.html
	static const double fx_d = 1.0 / 5.9421434211923247e+02;
	static const double fy_d = 1.0 / 5.9104053696870778e+02;
	static const double cx_d = 3.3930780975300314e+02;
	static const double cy_d = 2.4273913761751615e+02;
	
	ofxVec3f result;
	const double depth = getDistanceAt(x,y)/100.0;
	result.x = float((x - cx_d) * depth * fx_d);
	result.y = float((y - cy_d) * depth * fy_d);
	result.z = depth;
	
	return result;	
}
ofxVec3f ofxKinectCalibration::getWorldCoordinateFor(int x, int y){
	const double depth = getDistanceAt(x,y)/100.0;
	return getWorldCoordinateFor(x,y,depth);
}
float ofxKinectCalibration::getDistanceAt(const ofPoint & p){
	return getDistanceAt(p.x, p.y);
}
//------------------------------------
float ofxKinect::getDistanceAt(const ofPoint & p) {
	return getDistanceAt(p.x, p.y);
}
예제 #5
0
//------------------------------------
ofVec3f ofxKinect::getWorldCoordinateAt(int x, int y) {
	return getWorldCoordinateAt(x, y, getDistanceAt(x, y));
}
예제 #6
0
//------------------------------------
float ofxKinectSequencePlayer::getDistanceAt(const ofPoint & p) {
	return getDistanceAt(p.x, p.y);
}
예제 #7
0
//------------------------------------
float ofxRSSDK::getDistanceAt(const ofPoint & p) {
	return getDistanceAt(p.x, p.y);
}