Commit e6ce9607 authored by li412076173's avatar li412076173

write camera matrix to file so that could run on any device

parent c7057bf1
......@@ -4,7 +4,7 @@
using namespace std;
using namespace cv;
void wirteIrisData(const std::string & prefix, const std::vector<cv::Mat> & matVec, const std::vector<std::vector<cv::Point2f>> & contourVec, const double & eyeRadius, const std::vector<cv::Vec3d> & eyeCenters, const std::vector<cv::RotatedRect> & eyeRotatedRects, const cv::Matx44d & transformFaceToFrontCamera) {
void wirteIrisData(const std::string & prefix, const std::vector<cv::Mat> & matVec, const std::vector<std::vector<cv::Point2f>> & contourVec, const double & eyeRadius, const std::vector<cv::Vec3d> & eyeCenters, const std::vector<cv::RotatedRect> & eyeRotatedRects, const cv::Matx44d & transformFaceToFrontCamera, const cv::Matx33d & cameraMatrix) {
int count = matVec.size();
for (int i = 0; i < count; i++) {
string filename = prefix + std::to_string(i) + "_irisData.txt";
......@@ -29,6 +29,13 @@ void wirteIrisData(const std::string & prefix, const std::vector<cv::Mat> & mat
}
out << endl;
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 3; k++) {
out << cameraMatrix.val[j * 3 + k] << " ";
}
}
out << endl;
out.close();
}
......@@ -42,7 +49,7 @@ bool fileExists(std::string filename) {
return true;
}
bool readIrisData(const std::string & prefix, std::vector<cv::Mat> & matVec, std::vector<std::vector<cv::Point2f>> & contourVec, double & eyeRadius, std::vector<cv::Vec3d> & eyeCenters, std::vector<cv::RotatedRect> & eyeRotatedRects, cv::Matx44d & transformFaceToFrontCamera) {
bool readIrisData(const std::string & prefix, std::vector<cv::Mat> & matVec, std::vector<std::vector<cv::Point2f>> & contourVec, double & eyeRadius, std::vector<cv::Vec3d> & eyeCenters, std::vector<cv::RotatedRect> & eyeRotatedRects, cv::Matx44d & transformFaceToFrontCamera, cv::Matx33d & cameraMatrix) {
int i = 0;
matVec = std::vector<cv::Mat>();
contourVec = std::vector<std::vector<cv::Point2f>>();
......@@ -88,6 +95,12 @@ bool readIrisData(const std::string & prefix, std::vector<cv::Mat> & matVec, std
}
}
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 3; k++) {
out >> cameraMatrix.val[j * 3 + k];
}
}
out.close();
i++;
......
#pragma once
#include <opencv2/opencv.hpp>
void wirteIrisData(const std::string & prefix, const std::vector<cv::Mat> & matVec, const std::vector<std::vector<cv::Point2f>> & contourVec, const double & eyeRadius, const std::vector<cv::Vec3d> & eyeCenters, const std::vector<cv::RotatedRect> & eyeRotatedRects,const cv::Matx44d & transformFaceToFrontCamera);
bool readIrisData(const std::string & prefix, std::vector<cv::Mat> & matVec, std::vector<std::vector<cv::Point2f>> & contourVec, double & eyeRadius, std::vector<cv::Vec3d> & eyeCenters, std::vector<cv::RotatedRect> & eyeRotatedRects, cv::Matx44d & transformFaceToFrontCamera);
\ No newline at end of file
void wirteIrisData(const std::string & prefix, const std::vector<cv::Mat> & matVec, const std::vector<std::vector<cv::Point2f>> & contourVec, const double & eyeRadius, const std::vector<cv::Vec3d> & eyeCenters, const std::vector<cv::RotatedRect> & eyeRotatedRects, const cv::Matx44d & transformFaceToFrontCamera, const cv::Matx33d & cameraMatrix);
bool readIrisData(const std::string & prefix, std::vector<cv::Mat> & matVec, std::vector<std::vector<cv::Point2f>> & contourVec, double & eyeRadius, std::vector<cv::Vec3d> & eyeCenters, std::vector<cv::RotatedRect> & eyeRotatedRects, cv::Matx44d & transformFaceToFrontCamera, cv::Matx33d & cameraMatrix);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment