Skip to content

Commit c9e1386

Browse files
author
Maksym Ivashechkin
committed
fix CV_Check warnings
1 parent 41548a0 commit c9e1386

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

modules/calib3d/src/usac/degeneracy.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,8 @@ class FundamentalDegeneracyImpl : public FundamentalDegeneracy {
247247
// find inliers from sample, points related to H, x' ~ Hx
248248
for (int s = 0; s < sample_size; s++)
249249
if (h_reproj_error->getError(sample[s]) < homography_threshold)
250-
inliers_on_plane++;
250+
if (++inliers_on_plane >= 5)
251+
break;
251252

252253
// if there are at least 5 points lying on plane then F is degenerate
253254
if (inliers_on_plane >= 5) {

modules/calib3d/src/usac/ransac_solvers.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ bool run (const Ptr<const Model> &params, InputArray points1, InputArray points2
745745
points_size = mergePoints(points1, points2, points, true);
746746
} else {
747747
if (params->isEssential()) {
748-
CV_CheckEQ(!K1_.empty() && !K2_.empty(), true, "Intrinsic matrix must not be empty!");
748+
CV_CheckEQ((int)(!K1_.empty() && !K2_.empty()), 1, "Intrinsic matrix must not be empty!");
749749
K1 = K1_.getMat(); K1.convertTo(K1, CV_64F);
750750
K2 = K2_.getMat(); K2.convertTo(K2, CV_64F);
751751
if (! dist_coeff1.empty() || ! dist_coeff2.empty()) {
@@ -782,7 +782,7 @@ bool run (const Ptr<const Model> &params, InputArray points1, InputArray points2
782782

783783
std::vector<Ptr<NeighborhoodGraph>> layers;
784784
if (params->getSampler() == SamplingMethod::SAMPLING_PROGRESSIVE_NAPSAC) {
785-
CV_CheckEQ(params->isPnP(), false, "ProgressiveNAPSAC for PnP is not implemented!");
785+
CV_CheckEQ((int)params->isPnP(), 0, "ProgressiveNAPSAC for PnP is not implemented!");
786786
const auto &cell_number_per_layer = params->getGridCellNumber();
787787
layers.reserve(cell_number_per_layer.size());
788788
const auto * const pts = (float *) points.data;

samples/cpp/essential_mat_reconstr.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,14 +203,14 @@ int main(int args, char** argv) {
203203
image_dir = argv[2];
204204
}
205205
std::ifstream file(data_file, std::ios_base::in);
206-
CV_CheckEQ(file.is_open(), true, "Data file is not found!");
206+
CV_CheckEQ((int)file.is_open(), 1, "Data file is not found!");
207207
std::string filename1, filename2;
208208
std::getline(file, filename1);
209209
std::getline(file, filename2);
210210
Mat image1 = imread(image_dir+filename1);
211211
Mat image2 = imread(image_dir+filename2);
212-
CV_CheckEQ(image1.empty(), false, "Image 1 is not found!");
213-
CV_CheckEQ(image2.empty(), false, "Image 2 is not found!");
212+
CV_CheckEQ((int)image1.empty(), 0, "Image 1 is not found!");
213+
CV_CheckEQ((int)image2.empty(), 0, "Image 2 is not found!");
214214

215215
// read calibration
216216
Matx33d K;

0 commit comments

Comments
 (0)