| 41 | |
| 42 | template<int rows, int cols> |
| 43 | static bool CheckMatrices(const cv::Mat &cvMat, const Eigen::Matrix<float,rows,cols> &eigMat) { |
| 44 | const float epsilon = 1e-3; |
| 45 | // std::cout << cvMat.cols - cols << cvMat.rows - rows << std::endl; |
| 46 | if(rows != cvMat.rows || cols != cvMat.cols) { |
| 47 | std::cout << "wrong cvmat size\n"; |
| 48 | return false; |
| 49 | } |
| 50 | for(int i = 0; i < rows; i++) |
| 51 | for(int j = 0; j < cols; j++) |
| 52 | if ((cvMat.at<float>(i,j) > (eigMat(i,j) + epsilon)) || |
| 53 | (cvMat.at<float>(i,j) < (eigMat(i,j) - epsilon))){ |
| 54 | std::cout << "cv mat:\n" << cvMat << std::endl; |
| 55 | std::cout << "eig mat:\n" << eigMat << std::endl; |
| 56 | return false; |
| 57 | } |
| 58 | return true; |
| 59 | } |
| 60 | |
| 61 | template<typename T, int rows, int cols> |
| 62 | static bool CheckMatrices( const Eigen::Matrix<T,rows,cols> &eigMat1, const Eigen::Matrix<T,rows,cols> &eigMat2) { |
nothing calls this directly
no outgoing calls
no test coverage detected