Using GetProjectedShape in C++ RRS feed

  • Question

  • Hi all,

    Does anyone have a working example of calling GetProjectedShape() in C++?

    I am interested in obtaining the full 121 tracked points (instead of the 100 that the IFTResult offers), but GetProjectedShape takes too many parameters that I cannot find information about.

    Also, if there is another way to obtain said (2D) points, I would be happy to know about it.

    Thank you,

    Wednesday, November 28, 2012 1:31 AM


  • For what is worth, here is the way to do it:

    	res->Get3DPose(&faceScale, faceRot, facePos);		
    	res->Get2DShapePoints(&facePoints, &facePointCount);
    	res->GetAUCoefficients(&animUnits, &animUnitCount);	
    	// trying to get the 121 points starts here ****
    	IFTModel* ftModel;
    	FT_CAMERA_CONFIG videoCameraConfig, depthCameraConfig; 
    	videoCameraConfig.Height = 640;
    	videoCameraConfig.Width = 480;
    	depthCameraConfig.Height = 320;
    	depthCameraConfig.Width = 240;
    	HRESULT hr;
    	FLOAT *shapeUnitCoefficients;
    	UINT shapeUnitCount;
    	BOOL converged;
    	hr = faceTracker->GetShapeUnits(&faceScale, &shapeUnitCoefficients, &shapeUnitCount, &converged);	
    	UINT vertexCount = ftModel->GetVertexCount();
    	FT_VECTOR2D* pts2D = reinterpret_cast<FT_VECTOR2D*>(_malloca(sizeof(FT_VECTOR2D) * vertexCount));
    	float zoomFactor = 1.0f;
    	hr = ftModel->GetProjectedShape(&videoCameraConfig, zoomFactor, POINT(), shapeUnitCoefficients, ftModel->GetSUCount(), animUnits, animUnitCount, faceScale, faceRot, facePos, pts2D, vertexCount);
    	if (FAILED(hr)) {
    		cout << "ERROR: could not get the 121 projected points (FaceTrackerManager)" << endl;
    	} else {		
    		// success


    • Marked as answer by krahd Wednesday, November 28, 2012 2:05 AM
    Wednesday, November 28, 2012 2:05 AM