Created
December 5, 2011 08:45
-
-
Save satoruhiga/1432894 to your computer and use it in GitHub Desktop.
homography2glModelViewMatrix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inline ofMatrix4x4 homography2glModelViewMatrix(const cv::Mat &homography) | |
{ | |
ofMatrix4x4 matrix; | |
matrix(0, 0) = homography.at<double>(0, 0); | |
matrix(0, 1) = homography.at<double>(1, 0); | |
matrix(0, 2) = 0; | |
matrix(0, 3) = homography.at<double>(2, 0); | |
matrix(1, 0) = homography.at<double>(0, 1); | |
matrix(1, 1) = homography.at<double>(1, 1); | |
matrix(1, 2) = 0; | |
matrix(1, 3) = homography.at<double>(2, 1); | |
matrix(2, 0) = 0; | |
matrix(2, 1) = 0; | |
matrix(2, 2) = 1; | |
matrix(2, 3) = 0; | |
matrix(3, 0) = homography.at<double>(0, 2); | |
matrix(3, 1) = homography.at<double>(1, 2); | |
matrix(3, 2) = 0; | |
matrix(3, 3) = 1; | |
return matrix; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment