Skip to content

Commit 5158f0f

Browse files
committed
cleanup: imgproc_c.h usage and old constants (error codes)
1 parent efa11a4 commit 5158f0f

File tree

15 files changed

+12
-21
lines changed

15 files changed

+12
-21
lines changed

modules/ccalib/src/multicalib.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ void MultiCameraCalibration::loadImages()
225225
_xi[camera].convertTo(_xi[camera], CV_32F);
226226
//else
227227
//{
228-
// CV_Error_(CV_StsOutOfRange, "Unknown camera type, use PINHOLE or OMNIDIRECTIONAL");
228+
// CV_Error_(cv::Error::StsOutOfRange, "Unknown camera type, use PINHOLE or OMNIDIRECTIONAL");
229229
//}
230230

231231
for (int i = 0; i < (int)_omEachCamera[camera].size(); ++i)

modules/cudalegacy/src/fgd.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ Ptr<cuda::BackgroundSubtractorFGD> cv::cuda::createBackgroundSubtractorFGD(const
5454
#else
5555

5656
#include "cuda/fgd.hpp"
57-
#include "opencv2/imgproc/imgproc_c.h"
5857

5958
/////////////////////////////////////////////////////////////////////////
6059
// FGDParams

modules/cvv/samples/cvv_demo.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
// library includes
55
#include <opencv2/imgproc.hpp>
66
#include <opencv2/features2d.hpp>
7-
#include <opencv2/imgproc/types_c.h>
87
#include <opencv2/videoio.hpp>
98
#include <opencv2/videoio/videoio_c.h>
109

@@ -33,8 +32,6 @@ template<class T> std::string toString(const T& p_arg)
3332
int
3433
main(int argc, char** argv)
3534
{
36-
cv::Size* resolution = nullptr;
37-
3835
// parser keys
3936
const char *keys =
4037
"{ help h usage ? | | show this message }"

modules/cvv/src/qtutil/filter/sobelfilterwidget.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#include "sobelfilterwidget.hpp"
22

33
#include "opencv2/imgproc.hpp"
4-
#include "opencv2/imgproc/types_c.h"
54

65
#include <QVBoxLayout>
76
#include <QLabel>

modules/cvv/test/test_reference.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ namespace opencv_test { namespace {
66

77
/**
88
* Makes sure that
9-
* - creating, reassigning and comparing `cvv::util::Reference<int>`s (from /src/util/util.hpp) works,
9+
* - creating, reassigning and comparing `cvv::util::Reference<int>`s (from /src/util/util.hpp) works,
1010
* as well as the
1111
* - `makeRef()` and `getPtr()` functions; that
1212
* - `Reference<const int>`s can be created with `makeRef(const int)`, `{const int}` initializer list
13-
* and via `Reference<const int>{int}` and, finally, that
14-
* - `cvv::util::Reference`s of super classes can be constructed with derived classes and
13+
* and via `Reference<const int>{int}` and, finally, that
14+
* - `cvv::util::Reference`s of super classes can be constructed with derived classes and
1515
* - `Reference`s to base classes can be `castTo()` `References` to the derived classes, but not the other way.
1616
*/
1717

@@ -71,7 +71,7 @@ TEST(ReferenceTest, ConstRefs)
7171

7272
TEST(ReferenceTest, ConstRefsFromMutable)
7373
{
74-
int i;
74+
int i = 100;
7575
Reference<const int> ref{ i };
7676
EXPECT_EQ(ref.getPtr(), &i);
7777
}

modules/dpm/src/dpm_cascade.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void DPMCascade::loadCascadeModel(const string &modelPath)
6262
if (!is_success)
6363
{
6464
string errorMessage = format("Unable to parse the model: %s", modelPath.c_str());
65-
CV_Error(CV_StsBadArg, errorMessage);
65+
CV_Error(cv::Error::StsBadArg, errorMessage);
6666
}
6767

6868
model.initModel();

modules/dpm/src/dpm_feature.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ void ParalComputePyramid::initialize()
8181

8282
if (params.maxScale < params.interval)
8383
{
84-
CV_Error(CV_StsBadArg, "The image is too small to create a pyramid");
84+
CV_Error(cv::Error::StsBadArg, "The image is too small to create a pyramid");
8585
return;
8686
}
8787

modules/img_hash/src/precomp.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "opencv2/core.hpp"
99
#include "opencv2/core/base.hpp"
1010
#include "opencv2/imgproc.hpp"
11-
#include "opencv2/imgproc/types_c.h"
1211
#include "opencv2/img_hash.hpp"
1312

1413
#include <bitset>

modules/rgbd/samples/linemod.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <opencv2/core.hpp>
22
#include <opencv2/core/utility.hpp>
3-
#include <opencv2/imgproc/imgproc_c.h>
3+
#include <opencv2/core/core_c.h>
44
#include <opencv2/imgproc.hpp>
55
#include <opencv2/rgbd.hpp>
66
#include <opencv2/videoio.hpp>

modules/saliency/src/BING/kyheader.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ enum
109109
if(!(expr)) {\
110110
String msg = cv::format args; \
111111
printf("%s in %s:%d\n", msg.c_str(), __FILE__, __LINE__); \
112-
cv::error(cv::Exception(CV_StsAssert, msg, __FUNCTION__, __FILE__, __LINE__) ); }\
112+
cv::error(cv::Exception(cv::Error::StsAssert, msg, __FUNCTION__, __FILE__, __LINE__) ); }\
113113
}
114114

115115

modules/sfm/src/numeric.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ skew( InputArray _x )
162162
}
163163
else
164164
{
165-
//CV_Error(CV_StsBadArg, "The DataType must be CV_32F or CV_64F");
165+
//CV_Error(cv::Error::StsBadArg, "The DataType must be CV_32F or CV_64F");
166166
}
167167

168168
return skewMatrix;

modules/tracking/src/TrackingFunctionPF.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include <cmath>
2-
#include <opencv2/imgproc/imgproc_c.h>
32
#define CLIP(x,a,b) MIN(MAX((x),(a)),(b))
43
#define HIST_SIZE 50
54

modules/xfeatures2d/src/affine_feature2d.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#include "precomp.hpp"
1010
#include "opencv2/imgproc.hpp"
11-
#include "opencv2/imgproc/types_c.h"
1211

1312
namespace {
1413

modules/xphoto/samples/dct_image_denoising.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include "opencv2/highgui.hpp"
55

66
#include "opencv2/core/utility.hpp"
7-
#include "opencv2/imgproc/types_c.h"
87

98
const char* keys =
109
{
@@ -67,4 +66,4 @@ int main( int argc, const char** argv )
6766
cv::imwrite(outFilename, res);
6867

6968
return 0;
70-
}
69+
}

modules/xphoto/src/dct_image_denoising.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ namespace xphoto
175175
else if ( img.type() == CV_32FC1 )
176176
grayDctDenoising( img, img, sigma, psize );
177177
else
178-
CV_Error_( CV_StsNotImplemented,
178+
CV_Error_( cv::Error::StsNotImplemented,
179179
("Unsupported source image format (=%d)", img.type()) );
180180

181181
img.convertTo( dst, src.type() );

0 commit comments

Comments
 (0)