camera.cpp
Go to the documentation of this file.
00001 
00005 #include "camera.hpp"
00006 
00007 bool cameraParameters::getCameraParameters(std::string intrinsics) {
00008         
00009         //printf("%s << Entered (%s).\n", __FUNCTION__, intrinsics.c_str());
00010         
00011         double alpha = 0.00;
00012         bool centerPrincipalPoint = true;
00013         cv::Rect* validPixROI = 0;
00014         
00015         cv::FileStorage fs(intrinsics, cv::FileStorage::READ);
00016         fs["imageSize"] >> imageSize;
00017         fs["cameraMatrix"] >> cameraMatrix;
00018         fs["distCoeffs"] >> distCoeffs;
00019         blankCoeffs = cv::Mat::zeros(distCoeffs.rows, distCoeffs.cols, CV_64FC1);
00020         fs.release();
00021         
00022         cameraSize = cv::Size(imageSize.at<unsigned short>(0, 0), imageSize.at<unsigned short>(0, 1));
00023         
00024         newCamMat = getOptimalNewCameraMatrix(cameraMatrix, distCoeffs, cameraSize, alpha, cameraSize, validPixROI, centerPrincipalPoint);
00025         
00026         newCamMat.copyTo(K);
00027         //newCamMat.copyTo(K);  // or some other kind of matrix...?
00028         K_inv = K.inv();
00029         
00030         //printf("%s << Image size = (%d, %d)\n", __FUNCTION__, cameraSize.width, cameraSize.height);
00031         
00032         //cout << __FUNCTION__ << " << K = " << endl;
00033         //cout << K << endl;
00034         
00035         if (K.rows == 0) {
00036                 return false;
00037         }
00038         
00039         return true;
00040         
00041 }


thermalvis
Author(s): Stephen Vidas
autogenerated on Sun Jan 5 2014 11:38:44