Skip to content

Instantly share code, notes, and snippets.

@treyhuffine
Created March 5, 2019 02:07
Show Gist options
  • Save treyhuffine/b985d80a97e3e431d06623c8917a6877 to your computer and use it in GitHub Desktop.
Save treyhuffine/b985d80a97e3e431d06623c8917a6877 to your computer and use it in GitHub Desktop.
vector<Point3f> objectPointsForReprojection {
objectPoints[2], // tip of nose
objectPoints[2] + Point3f(0,0,15), // nose and Z-axis
objectPoints[2] + Point3f(0,15,0), // nose and Y-axis
objectPoints[2] + Point3f(15,0,0) // nose and X-axis
};
//...
vector<Point2f> projectionOutput(objectPointsForReprojection.size());
projectPoints(objectPointsForReprojection, rvec, tvec, K, Mat(), projectionOutput);
arrowedLine(out, projectionOutput[0], projectionOutput[1], Scalar(255,255,0));
arrowedLine(out, projectionOutput[0], projectionOutput[2], Scalar(0,255,255));
arrowedLine(out, projectionOutput[0], projectionOutput[3], Scalar(255,0,255));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment