| 131 | |
| 132 | template <typename MODELTYPE> |
| 133 | int |
| 134 | Score(const typename MODELTYPE::Model & model, |
| 135 | const openMVG::Mat& x1, |
| 136 | const openMVG::Mat& x2, |
| 137 | double normalizedSigma, |
| 138 | InliersVec* isInlier) |
| 139 | { |
| 140 | assert( (int)isInlier->size() == x1.cols() ); |
| 141 | |
| 142 | double inlierThreshold = InlierThreshold<MODELTYPE::CODIMENSION>(normalizedSigma); |
| 143 | int nbInliers = 0; |
| 144 | for (std::size_t j = 0; j < isInlier->size(); ++j) { |
| 145 | double error = MODELTYPE::Error( model, x1.col(j), x2.col(j) ); |
| 146 | if (error < inlierThreshold) { |
| 147 | ++nbInliers; |
| 148 | (*isInlier)[j] = true; |
| 149 | } else { |
| 150 | (*isInlier)[j] = false; |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | return nbInliers; |
| 155 | } |
| 156 | |
| 157 | TEST(ModelSearch, TranslationMinimal) |
| 158 | { |
no test coverage detected