Skip to content

Commit 3cc5923

Browse files
authored
Merge pull request #3808 from mshabunin:cpp-cleanup
C-API cleanup: removed legacy API usage
2 parents 31be64e + 974247c commit 3cc5923

File tree

15 files changed

+11
-705
lines changed

15 files changed

+11
-705
lines changed

modules/ccalib/src/ccalib.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
#include "opencv2/ccalib.hpp"
4848

4949
#include <opencv2/core.hpp>
50-
#include <opencv2/core/types_c.h> // CV_TERM
5150
#include <opencv2/imgproc.hpp>
5251
#include <opencv2/3d.hpp>
5352
#include <opencv2/calib.hpp>
@@ -222,7 +221,7 @@ void CustomPattern::refinePointsPos(const Mat& img, vector<Point2f>& p)
222221
Mat gray;
223222
cvtColor(img, gray, COLOR_RGB2GRAY);
224223
cornerSubPix(gray, p, Size(10, 10), Size(-1, -1),
225-
TermCriteria(CV_TERMCRIT_ITER + CV_TERMCRIT_EPS, 30, 0.1));
224+
TermCriteria(cv::TermCriteria::MAX_ITER + cv::TermCriteria::EPS, 30, 0.1));
226225

227226
}
228227

modules/cudalegacy/src/cuda/NCVHaarObjectDetection.cu

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666

6767
#ifdef HAVE_OPENCV_XOBJDETECT
6868
# include "opencv2/xobjdetect.hpp"
69-
//# include "opencv2/objdetect/objdetect_c.h"
7069
#endif
7170

7271
#include "opencv2/cudalegacy/NCV.hpp"

modules/cvv/samples/cvv_demo.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include <opencv2/imgproc.hpp>
66
#include <opencv2/features2d.hpp>
77
#include <opencv2/videoio.hpp>
8-
#include <opencv2/videoio/videoio_c.h>
98

109
#define CVVISUAL_DEBUGMODE
1110
#include <opencv2/cvv/debug_mode.hpp>
@@ -55,8 +54,8 @@ main(int argc, char** argv)
5554

5655
if (res_w>0 && res_h>0) {
5756
printf("Setting resolution to %dx%d\n", res_w, res_h);
58-
capture.set(CV_CAP_PROP_FRAME_WIDTH, res_w);
59-
capture.set(CV_CAP_PROP_FRAME_HEIGHT, res_h);
57+
capture.set(cv::CAP_PROP_FRAME_WIDTH, res_w);
58+
capture.set(cv::CAP_PROP_FRAME_HEIGHT, res_h);
6059
}
6160

6261

modules/dpm/src/dpm_feature.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
#define __DPM_FEATURE__
4444

4545
#include "opencv2/core.hpp"
46-
#include "opencv2/core/core_c.h"
4746
#include "opencv2/imgproc.hpp"
4847

4948
#include <string>

modules/ml/src/ann_mlp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -865,8 +865,8 @@ class ANN_MLPImpl CV_FINAL : public ANN_MLP
865865

866866
TermCriteria termcrit;
867867
termcrit.type = TermCriteria::COUNT + TermCriteria::EPS;
868-
termcrit.maxCount = std::max((params.termCrit.type & CV_TERMCRIT_ITER ? params.termCrit.maxCount : MAX_ITER), 1);
869-
termcrit.epsilon = std::max((params.termCrit.type & CV_TERMCRIT_EPS ? params.termCrit.epsilon : DEFAULT_EPSILON), DBL_EPSILON);
868+
termcrit.maxCount = std::max((params.termCrit.type & TermCriteria::COUNT ? params.termCrit.maxCount : MAX_ITER), 1);
869+
termcrit.epsilon = std::max((params.termCrit.type & TermCriteria::EPS ? params.termCrit.epsilon : DEFAULT_EPSILON), DBL_EPSILON);
870870

871871
int iter = 0;
872872
switch(params.trainMethod){
@@ -902,7 +902,7 @@ class ANN_MLPImpl CV_FINAL : public ANN_MLP
902902
int count = inputs.rows;
903903

904904
int iter = -1, max_iter = termCrit.maxCount*count;
905-
double epsilon = (termCrit.type & CV_TERMCRIT_EPS) ? termCrit.epsilon*count : 0;
905+
double epsilon = (termCrit.type & cv::TermCriteria::EPS) ? termCrit.epsilon*count : 0;
906906

907907
int l_count = layer_count();
908908
int ivcount = layer_sizes[0];

modules/ml/src/em.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ class CV_EXPORTS EMImpl CV_FINAL : public EM
446446
CV_Assert(!clusterSamples.empty());
447447

448448
calcCovarMatrix(clusterSamples, covs[clusterIndex], means.row(clusterIndex),
449-
CV_COVAR_NORMAL + CV_COVAR_ROWS + CV_COVAR_USE_AVG + CV_COVAR_SCALE, CV_64FC1);
449+
cv::COVAR_NORMAL + cv::COVAR_ROWS + cv::COVAR_USE_AVG + cv::COVAR_SCALE, CV_64FC1);
450450
weights.at<double>(clusterIndex) = static_cast<double>(clusterSamples.rows)/static_cast<double>(nsamples);
451451
}
452452

modules/ml/src/precomp.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343

4444
#include "opencv2/core.hpp"
4545
#include "opencv2/ml.hpp"
46-
#include "opencv2/core/core_c.h"
4746
#include "opencv2/core/utility.hpp"
4847

4948
#include "opencv2/core/private.hpp"

modules/ml/src/svm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ struct SvmParams
126126
C = 1;
127127
nu = 0;
128128
p = 0;
129-
termCrit = TermCriteria( CV_TERMCRIT_ITER+CV_TERMCRIT_EPS, 1000, FLT_EPSILON );
129+
termCrit = TermCriteria( cv::TermCriteria::MAX_ITER + cv::TermCriteria::EPS, 1000, FLT_EPSILON );
130130
}
131131

132132
SvmParams( int _svmType, int _kernelType,

modules/reg/samples/map_test.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
#ifdef COMPARE_FEATURES
4444
#include <opencv2/xfeatures2d.hpp>
4545
#include <opencv2/3d.hpp>
46-
#include <opencv2/calib3d/calib3d_c.h>
4746
using namespace cv::xfeatures2d;
4847
#endif
4948

0 commit comments

Comments
 (0)