1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

fix CV_Check warnings

This commit is contained in:
Maksym Ivashechkin
2020-08-17 21:15:19 +02:00
parent 41548a091b
commit c9e1386e44
3 changed files with 7 additions and 6 deletions
+2 -1
View File
@@ -247,7 +247,8 @@ public:
// find inliers from sample, points related to H, x' ~ Hx
for (int s = 0; s < sample_size; s++)
if (h_reproj_error->getError(sample[s]) < homography_threshold)
inliers_on_plane++;
if (++inliers_on_plane >= 5)
break;
// if there are at least 5 points lying on plane then F is degenerate
if (inliers_on_plane >= 5) {
+2 -2
View File
@@ -745,7 +745,7 @@ bool run (const Ptr<const Model> &params, InputArray points1, InputArray points2
points_size = mergePoints(points1, points2, points, true);
} else {
if (params->isEssential()) {
CV_CheckEQ(!K1_.empty() && !K2_.empty(), true, "Intrinsic matrix must not be empty!");
CV_CheckEQ((int)(!K1_.empty() && !K2_.empty()), 1, "Intrinsic matrix must not be empty!");
K1 = K1_.getMat(); K1.convertTo(K1, CV_64F);
K2 = K2_.getMat(); K2.convertTo(K2, CV_64F);
if (! dist_coeff1.empty() || ! dist_coeff2.empty()) {
@@ -782,7 +782,7 @@ bool run (const Ptr<const Model> &params, InputArray points1, InputArray points2
std::vector<Ptr<NeighborhoodGraph>> layers;
if (params->getSampler() == SamplingMethod::SAMPLING_PROGRESSIVE_NAPSAC) {
CV_CheckEQ(params->isPnP(), false, "ProgressiveNAPSAC for PnP is not implemented!");
CV_CheckEQ((int)params->isPnP(), 0, "ProgressiveNAPSAC for PnP is not implemented!");
const auto &cell_number_per_layer = params->getGridCellNumber();
layers.reserve(cell_number_per_layer.size());
const auto * const pts = (float *) points.data;