Skip to content

Commit 2bc3e1a

Browse files
committed
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
2 parents 5e5609c + 02c2b56 commit 2bc3e1a

File tree

9 files changed

+23
-34
lines changed

9 files changed

+23
-34
lines changed

modules/optflow/src/sparse_matching_gpc.cpp

Lines changed: 4 additions & 5 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
}

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
@@ -91,7 +91,7 @@ void niBlackThreshold( InputArray _src, OutputArray _dst, double maxValue,
9191
thresh = mean + static_cast<float>(k) * sqrtVarianceMeanSum;
9292
break;
9393
default:
94-
CV_Error(CV_StsBadArg, "Unknown binarization method");
94+
CV_Error( Error::StsBadArg, "Unknown binarization method" );
9595
break;
9696
}
9797
thresh.convertTo(thresh, src.depth());
@@ -124,7 +124,7 @@ void niBlackThreshold( InputArray _src, OutputArray _dst, double maxValue,
124124
src.copyTo(dst, mask);
125125
break;
126126
default:
127-
CV_Error( CV_StsBadArg, "Unknown threshold type" );
127+
CV_Error( Error::StsBadArg, "Unknown threshold type" );
128128
break;
129129
}
130130
}

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/sparse_match_interpolators.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ struct MinHeap
10311031
{
10321032
if (m_validSize >= m_size)
10331033
{
1034-
CV_Error(CV_StsOutOfRange, " m_validSize >= m_size this problem can be resolved my decreasig k parameter");
1034+
CV_Error(Error::StsOutOfRange, " m_validSize >= m_size this problem can be resolved my decreasig k parameter");
10351035
}
10361036
m_index[m_validSize] = index;
10371037
m_weight[m_validSize] = weight;

modules/ximgproc/src/structured_edge_detection.cpp

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

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

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
@@ -59,16 +59,9 @@
5959
#include <tuple>
6060

6161
#include "opencv2/xphoto.hpp"
62-
6362
#include "opencv2/imgproc.hpp"
64-
#include "opencv2/imgproc/imgproc_c.h"
65-
6663
#include "opencv2/core.hpp"
67-
#include "opencv2/core/core_c.h"
68-
6964
#include "opencv2/core/types.hpp"
70-
#include "opencv2/core/types_c.h"
71-
7265
#include "photomontage.hpp"
7366
#include "annf.hpp"
7467
#include "advanced_types.hpp"
@@ -305,7 +298,7 @@ namespace xphoto
305298
shiftMapInpaint <Tp, cn>(src, mask, dst);
306299
break;
307300
default:
308-
CV_Error_( CV_StsNotImplemented,
301+
CV_Error_( Error::StsNotImplemented,
309302
("Unsupported algorithm type (=%d)", algorithmType) );
310303
break;
311304
}
@@ -401,7 +394,7 @@ namespace xphoto
401394
inpaint <double, 4>( src, mask, dst, algorithmType );
402395
break;
403396
default:
404-
CV_Error_( CV_StsNotImplemented,
397+
CV_Error_( Error::StsNotImplemented,
405398
("Unsupported source image format (=%d)",
406399
src.type()) );
407400
}

0 commit comments

Comments
 (0)