00001
00024 #ifndef __D_F_SOLVER__
00025 #define __D_F_SOLVER__
00026
00027 #include <opencv/cv.h>
00028 #include <vector>
00029
00030 namespace DVision {
00031
00033 class FSolver
00034 {
00035 public:
00036
00040 FSolver();
00041
00047 FSolver(int cols, int rows);
00048
00052 virtual ~FSolver(){}
00053
00059 virtual void setImageSize(int cols, int rows);
00060
00076 cv::Mat findFundamentalMat(const cv::Mat &P1, const cv::Mat &P2,
00077 double reprojection_error, int min_points = 9,
00078 std::vector<uchar>* status = NULL,
00079 bool computeF = true, double probability = 0.99, int max_its = 500) const;
00080
00092 bool checkFundamentalMat(const cv::Mat &P1, const cv::Mat &P2,
00093 double reprojection_error, int min_points = 9,
00094 double probability = 0.99, int max_its = 500) const;
00095
00096 protected:
00097
00103 void normalizePoints(const cv::Mat &P, cv::Mat &Q) const;
00104
00112 cv::Mat _computeF(const cv::Mat &Qc1, const cv::Mat &Qc2,
00113 const std::vector<unsigned int> &i_cols) const;
00114
00123
00124
00125
00126 protected:
00127
00129 cv::Mat m_N;
00130
00132 cv::Mat m_N_t;
00133
00134 };
00135
00136 }
00137
00138 #endif