Skip to content

Commit 02c2b56

Browse files
committed
Merge pull request #3058 from sturkmen72:cleanup-old-c
2 parents 88c82fa + 1b39461 commit 02c2b56

File tree

8 files changed

+23
-34
lines changed

8 files changed

+23
-34
lines changed

modules/optflow/src/sparse_matching_gpc.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242

4343
#include "precomp.hpp"
4444
#undef CV_FORCE_SIMD128_CPP // mixed HAL SIMD/SSE code
45-
#include "opencv2/core/core_c.h"
4645
#include "opencv2/core/private.hpp"
4746
#include "opencv2/flann/miniflann.hpp"
4847
#include "opencv2/imgcodecs.hpp"
@@ -450,7 +449,7 @@ void getTrainingSamples( const Mat &from, const Mat &to, const Mat &gt, GPCSampl
450449
getTriplet( mag[k], gt, fromChInt, toChInt, samples, index, getWHTPatchDescriptor );
451450
}
452451
else
453-
CV_Error( CV_StsBadArg, "Unknown descriptor type" );
452+
CV_Error( Error::StsBadArg, "Unknown descriptor type" );
454453
}
455454

456455
/* Sample random number from Cauchy distribution. */
@@ -511,7 +510,7 @@ void GPCDetails::getAllDescriptorsForImage( const Mat *imgCh, std::vector< GPCPa
511510
else if ( type == GPC_DESCRIPTOR_WHT )
512511
getAllWHTDescriptorsForImage( imgCh, descr, mp );
513512
else
514-
CV_Error( CV_StsBadArg, "Unknown descriptor type" );
513+
CV_Error( Error::StsBadArg, "Unknown descriptor type" );
515514
}
516515

517516
void GPCDetails::getCoordinatesFromIndex( size_t index, Size sz, int &x, int &y )
@@ -638,7 +637,7 @@ bool GPCTree::trainNode( size_t nodeId, SIter begin, SIter end, unsigned depth )
638637
void GPCTree::train( GPCTrainingSamples &samples, const GPCTrainingParams _params )
639638
{
640639
if ( _params.descriptorType != samples.type() )
641-
CV_Error( CV_StsBadArg, "Descriptor type mismatch! Check that samples are collected with the same descriptor type." );
640+
CV_Error( Error::StsBadArg, "Descriptor type mismatch! Check that samples are collected with the same descriptor type." );
642641
nodes.clear();
643642
nodes.reserve( samples.size() * 2 - 1 ); // set upper bound for the possible number of nodes so all subsequent resize() will be no-op
644643
params = _params;
@@ -649,7 +648,7 @@ void GPCTree::train( GPCTrainingSamples &samples, const GPCTrainingParams _param
649648
void GPCTree::write( FileStorage &fs ) const
650649
{
651650
if ( nodes.empty() )
652-
CV_Error( CV_StsBadArg, "Tree have not been trained" );
651+
CV_Error( Error::StsBadArg, "Tree have not been trained" );
653652
fs << "nodes" << nodes;
654653
fs << "dtype" << (int)params.descriptorType;
655654
}
@@ -770,7 +769,7 @@ void GPCDetails::dropOutliers( std::vector< std::pair< Point2i, Point2i > > &cor
770769

771770
void write( FileStorage &fs, const String &name, const optflow::GPCTree::Node &node )
772771
{
773-
cv::internal::WriteStructContext ws( fs, name, CV_NODE_SEQ + CV_NODE_FLOW );
772+
cv::internal::WriteStructContext ws( fs, name, FileNode::SEQ + FileNode::FLOW );
774773
for ( unsigned i = 0; i < optflow::GPCPatchDescriptor::nFeatures; ++i )
775774
write( fs, node.coef[i] );
776775
write( fs, node.rhs );

modules/xfeatures2d/src/pct_signatures/pct_clusterizer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ Contributed by Gregor Kovalcik <gregor dot kovalcik at gmail dot com>
5959

6060
#include "../precomp.hpp"
6161

62-
#include "opencv2/core/core_c.h" // <- because CV_REDUCE_SUM was undeclared without it
6362
#include "pct_clusterizer.hpp"
6463

6564
namespace cv
@@ -333,7 +332,7 @@ namespace cv
333332
clusters.create(1, points.cols, CV_32FC1);
334333

335334
// Sum all points.
336-
reduce(points, clusters, 0, CV_REDUCE_SUM, CV_32FC1);
335+
reduce(points, clusters, 0, REDUCE_SUM, CV_32FC1);
337336

338337
// Sum all weights, all points have the same weight -> sum is the point count
339338
clusters.at<float>(0, WEIGHT_IDX) = static_cast<float>(points.rows);

modules/ximgproc/src/fast_hough_transform.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ void fhtVo(Mat &img0,
238238
fhtVoT<T, D, FHT_MIN>(img0, img1, isPositiveShift, aspl);
239239
break;
240240
default:
241-
CV_Error_(CV_StsNotImplemented, ("Unknown operation %d", operation));
241+
CV_Error_(Error::StsNotImplemented, ("Unknown operation %d", operation));
242242
break;
243243
}
244244
}
@@ -274,7 +274,7 @@ static void fhtVo(Mat &img0,
274274
fhtVo<double, CV_64FC1>(img0, img1, isPositiveShift, operation, aspl);
275275
break;
276276
default:
277-
CV_Error_(CV_StsNotImplemented, ("Unknown depth %d", depth));
277+
CV_Error_(Error::StsNotImplemented, ("Unknown depth %d", depth));
278278
break;
279279
}
280280
}
@@ -345,7 +345,7 @@ static void calculateFHTQuadrant(Mat &dst,
345345
aspl = 0.5;
346346
break;
347347
default:
348-
CV_Error_(CV_StsNotImplemented, ("Unknown quadrant %d", quadrant));
348+
CV_Error_(Error::StsNotImplemented, ("Unknown quadrant %d", quadrant));
349349
}
350350

351351
FHT(dst, src, operation, bVert, bClock, aspl);
@@ -385,7 +385,7 @@ static void createDstFhtMat(OutputArray dst,
385385
ht = 2 * (cols + rows) - 3;
386386
break;
387387
default:
388-
CV_Error_(CV_StsNotImplemented, ("Unknown angleRange %d", angleRange));
388+
CV_Error_(Error::StsNotImplemented, ("Unknown angleRange %d", angleRange));
389389
}
390390

391391
dst.create(ht, wd, CV_MAKETYPE(depth, channels));
@@ -411,7 +411,7 @@ static void createFHTSrc(Mat &srcFull,
411411
verticalTiling = true;
412412
break;
413413
default:
414-
CV_Error_(CV_StsNotImplemented, ("Unknown angleRange %d", angleRange));
414+
CV_Error_(Error::StsNotImplemented, ("Unknown angleRange %d", angleRange));
415415
}
416416

417417
int wd = verticalTiling ? src.cols : src.cols + src.rows;
@@ -454,7 +454,7 @@ static void setFHTDstRegion(Mat &dstRegion,
454454
base = 3;
455455
break;
456456
default:
457-
CV_Error_(CV_StsNotImplemented, ("Unknown angleRange %d", angleRange));
457+
CV_Error_(Error::StsNotImplemented, ("Unknown angleRange %d", angleRange));
458458
}
459459

460460
int quad = -1;
@@ -473,7 +473,7 @@ static void setFHTDstRegion(Mat &dstRegion,
473473
quad = 3;
474474
break;
475475
default:
476-
CV_Error_(CV_StsNotImplemented, ("Unknown quadrant %d", quadrant));
476+
CV_Error_(Error::StsNotImplemented, ("Unknown quadrant %d", quadrant));
477477
}
478478

479479
if (quad < base)
@@ -532,7 +532,7 @@ static void skewQuadrant(Mat &quad,
532532
start = wd * .5 - 0.5;
533533
break;
534534
default:
535-
CV_Error_(CV_StsNotImplemented, ("Unknown quadrant %d", quadrant));
535+
CV_Error_(Error::StsNotImplemented, ("Unknown quadrant %d", quadrant));
536536
}
537537

538538
const int pixlen = static_cast<int>(quad.elemSize());
@@ -664,7 +664,7 @@ void FastHoughTransform(InputArray src,
664664
skewQuadrant(dstMat, imgSrc, buf, angleRange);
665665
return;
666666
default:
667-
CV_Error_(CV_StsNotImplemented, ("Unknown angleRange %d", angleRange));
667+
CV_Error_(Error::StsNotImplemented, ("Unknown angleRange %d", angleRange));
668668
}
669669
}
670670

@@ -704,7 +704,7 @@ static void getRawPoint(Point &rawHoughPoint,
704704
base = 3;
705705
break;
706706
default:
707-
CV_Error_(CV_StsNotImplemented, ("Unknown angleRange %d", angleRange));
707+
CV_Error_(Error::StsNotImplemented, ("Unknown angleRange %d", angleRange));
708708
}
709709

710710
int const cols = srcImgInfo.cols;
@@ -720,7 +720,7 @@ static void getRawPoint(Point &rawHoughPoint,
720720
rawHoughPoint.y -= qsize;
721721
}
722722
if (quad >= 4)
723-
CV_Error(CV_StsInternal, "");
723+
CV_Error(Error::StsInternal, "");
724724

725725
quadRawPoint = quad;
726726

modules/ximgproc/src/niblack_thresholding.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void niBlackThreshold( InputArray _src, OutputArray _dst, double maxValue,
9090
thresh = mean + static_cast<float>(k) * sqrtVarianceMeanSum;
9191
break;
9292
default:
93-
CV_Error( CV_StsBadArg, "Unknown binarization method" );
93+
CV_Error( Error::StsBadArg, "Unknown binarization method" );
9494
break;
9595
}
9696
thresh.convertTo(thresh, src.depth());
@@ -123,7 +123,7 @@ void niBlackThreshold( InputArray _src, OutputArray _dst, double maxValue,
123123
src.copyTo(dst, mask);
124124
break;
125125
default:
126-
CV_Error( CV_StsBadArg, "Unknown threshold type" );
126+
CV_Error( Error::StsBadArg, "Unknown threshold type" );
127127
break;
128128
}
129129
}

modules/ximgproc/src/precomp.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@
4141
#include <opencv2/core/ocl.hpp>
4242
#include <opencv2/core/base.hpp>
4343
#include <opencv2/core/utility.hpp>
44-
#include <opencv2/core/cvdef.h>
45-
#include <opencv2/core/core_c.h>
4644
#include <opencv2/core/private.hpp>
4745
#include <opencv2/imgproc.hpp>
4846

modules/ximgproc/src/structured_edge_detection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ class StructuredEdgeDetectionImpl : public StructuredEdgeDetection
828828
);
829829
#endif
830830

831-
cv::reduce( dstM.reshape(1, int( dstM.total() ) ), dstM, 2, CV_REDUCE_SUM);
831+
cv::reduce( dstM.reshape(1, int( dstM.total() ) ), dstM, 2, REDUCE_SUM);
832832
imsmooth( dstM.reshape(1, dst.rows), 1 ).copyTo(dst);
833833
}
834834

modules/ximgproc/src/weighted_median_filter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ void featureIndexing(Mat &F, float **&wMap, int &nF, float sigmaI, int weightTyp
334334
//do K-means
335335
Mat labels;
336336
Mat centers;
337-
kmeans(samples, nF, labels, TermCriteria(CV_TERMCRIT_ITER|CV_TERMCRIT_EPS, 0, 10000), KmeansAttempts, KMEANS_PP_CENTERS, centers );
337+
kmeans(samples, nF, labels, TermCriteria(TermCriteria::MAX_ITER| TermCriteria::EPS, 0, 10000), KmeansAttempts, KMEANS_PP_CENTERS, centers );
338338

339339
//make connection (i,j,k) <-> index
340340
top = 0;

modules/xphoto/src/inpainting.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,9 @@
4848
#include <functional>
4949

5050
#include "opencv2/xphoto.hpp"
51-
5251
#include "opencv2/imgproc.hpp"
53-
#include "opencv2/imgproc/imgproc_c.h"
54-
5552
#include "opencv2/core.hpp"
56-
#include "opencv2/core/core_c.h"
57-
5853
#include "opencv2/core/types.hpp"
59-
#include "opencv2/core/types_c.h"
60-
6154
#include "photomontage.hpp"
6255
#include "annf.hpp"
6356
#include "advanced_types.hpp"
@@ -292,7 +285,7 @@ namespace xphoto
292285
shiftMapInpaint <Tp, cn>(src, mask, dst);
293286
break;
294287
default:
295-
CV_Error_( CV_StsNotImplemented,
288+
CV_Error_( Error::StsNotImplemented,
296289
("Unsupported algorithm type (=%d)", algorithmType) );
297290
break;
298291
}
@@ -396,7 +389,7 @@ namespace xphoto
396389
inpaint <double, 4>( src, mask, dst, algorithmType );
397390
break;
398391
default:
399-
CV_Error_( CV_StsNotImplemented,
392+
CV_Error_( Error::StsNotImplemented,
400393
("Unsupported source image format (=%d)",
401394
src.type()) );
402395
break;

0 commit comments

Comments
 (0)