#include <iostream>
#include <opencv2/opencv.hpp>
int main()
{
cv::Mat H = ( cv::Mat_< double >( 3, 3 ) << 0.998, -0.062, 50, 0.062, 0.998, 100, 0.007, 0.05, 1 );
cv::Mat K = ( cv::Mat_< double >( 3, 3 ) << 500, 0, 320, 0, 500, 240, 0, 0, 1 );
std::vector< cv::Mat > rotations;
std::vector< cv::Mat > translations;
std::vector< cv::Mat > normals;
int numSolutions = cv::decomposeHomographyMat( H, K, rotations, translations, normals );
std::cout << "Number of solutions: " << numSolutions << "\n";
for ( int i = 0; i < numSolutions; ++i )
{
std::cout << "Solution " << i + 1 << ":\n";
std::cout << "Rotation Matrix:\n" << rotations[ i ] << "\n";
std::cout << "Translation Vector:\n" << translations[ i ] << "\n";
std::cout << "Normal Vector:\n" << normals[ i ] << "\n";
}
return 0;
}