mirror of
https://github.com/opencv/opencv_contrib.git
synced 2025-10-18 17:24:28 +08:00
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
This commit is contained in:
@@ -42,7 +42,6 @@
|
|||||||
|
|
||||||
#include "precomp.hpp"
|
#include "precomp.hpp"
|
||||||
#undef CV_FORCE_SIMD128_CPP // mixed HAL SIMD/SSE code
|
#undef CV_FORCE_SIMD128_CPP // mixed HAL SIMD/SSE code
|
||||||
#include "opencv2/core/core_c.h"
|
|
||||||
#include "opencv2/core/private.hpp"
|
#include "opencv2/core/private.hpp"
|
||||||
#include "opencv2/flann/miniflann.hpp"
|
#include "opencv2/flann/miniflann.hpp"
|
||||||
#include "opencv2/imgcodecs.hpp"
|
#include "opencv2/imgcodecs.hpp"
|
||||||
@@ -450,7 +449,7 @@ void getTrainingSamples( const Mat &from, const Mat &to, const Mat >, GPCSampl
|
|||||||
getTriplet( mag[k], gt, fromChInt, toChInt, samples, index, getWHTPatchDescriptor );
|
getTriplet( mag[k], gt, fromChInt, toChInt, samples, index, getWHTPatchDescriptor );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
CV_Error( CV_StsBadArg, "Unknown descriptor type" );
|
CV_Error( Error::StsBadArg, "Unknown descriptor type" );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sample random number from Cauchy distribution. */
|
/* Sample random number from Cauchy distribution. */
|
||||||
@@ -511,7 +510,7 @@ void GPCDetails::getAllDescriptorsForImage( const Mat *imgCh, std::vector< GPCPa
|
|||||||
else if ( type == GPC_DESCRIPTOR_WHT )
|
else if ( type == GPC_DESCRIPTOR_WHT )
|
||||||
getAllWHTDescriptorsForImage( imgCh, descr, mp );
|
getAllWHTDescriptorsForImage( imgCh, descr, mp );
|
||||||
else
|
else
|
||||||
CV_Error( CV_StsBadArg, "Unknown descriptor type" );
|
CV_Error( Error::StsBadArg, "Unknown descriptor type" );
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPCDetails::getCoordinatesFromIndex( size_t index, Size sz, int &x, int &y )
|
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 )
|
|||||||
void GPCTree::train( GPCTrainingSamples &samples, const GPCTrainingParams _params )
|
void GPCTree::train( GPCTrainingSamples &samples, const GPCTrainingParams _params )
|
||||||
{
|
{
|
||||||
if ( _params.descriptorType != samples.type() )
|
if ( _params.descriptorType != samples.type() )
|
||||||
CV_Error( CV_StsBadArg, "Descriptor type mismatch! Check that samples are collected with the same descriptor type." );
|
CV_Error( Error::StsBadArg, "Descriptor type mismatch! Check that samples are collected with the same descriptor type." );
|
||||||
nodes.clear();
|
nodes.clear();
|
||||||
nodes.reserve( samples.size() * 2 - 1 ); // set upper bound for the possible number of nodes so all subsequent resize() will be no-op
|
nodes.reserve( samples.size() * 2 - 1 ); // set upper bound for the possible number of nodes so all subsequent resize() will be no-op
|
||||||
params = _params;
|
params = _params;
|
||||||
@@ -649,7 +648,7 @@ void GPCTree::train( GPCTrainingSamples &samples, const GPCTrainingParams _param
|
|||||||
void GPCTree::write( FileStorage &fs ) const
|
void GPCTree::write( FileStorage &fs ) const
|
||||||
{
|
{
|
||||||
if ( nodes.empty() )
|
if ( nodes.empty() )
|
||||||
CV_Error( CV_StsBadArg, "Tree have not been trained" );
|
CV_Error( Error::StsBadArg, "Tree have not been trained" );
|
||||||
fs << "nodes" << nodes;
|
fs << "nodes" << nodes;
|
||||||
fs << "dtype" << (int)params.descriptorType;
|
fs << "dtype" << (int)params.descriptorType;
|
||||||
}
|
}
|
||||||
|
@@ -59,7 +59,6 @@ References:
|
|||||||
|
|
||||||
#include "../precomp.hpp"
|
#include "../precomp.hpp"
|
||||||
|
|
||||||
#include "opencv2/core/core_c.h" // <- because CV_REDUCE_SUM was undeclared without it
|
|
||||||
#include "pct_clusterizer.hpp"
|
#include "pct_clusterizer.hpp"
|
||||||
|
|
||||||
namespace cv
|
namespace cv
|
||||||
@@ -333,7 +332,7 @@ namespace cv
|
|||||||
clusters.create(1, points.cols, CV_32FC1);
|
clusters.create(1, points.cols, CV_32FC1);
|
||||||
|
|
||||||
// Sum all points.
|
// Sum all points.
|
||||||
reduce(points, clusters, 0, CV_REDUCE_SUM, CV_32FC1);
|
reduce(points, clusters, 0, REDUCE_SUM, CV_32FC1);
|
||||||
|
|
||||||
// Sum all weights, all points have the same weight -> sum is the point count
|
// Sum all weights, all points have the same weight -> sum is the point count
|
||||||
clusters.at<float>(0, WEIGHT_IDX) = static_cast<float>(points.rows);
|
clusters.at<float>(0, WEIGHT_IDX) = static_cast<float>(points.rows);
|
||||||
|
@@ -238,7 +238,7 @@ void fhtVo(Mat &img0,
|
|||||||
fhtVoT<T, D, FHT_MIN>(img0, img1, isPositiveShift, aspl);
|
fhtVoT<T, D, FHT_MIN>(img0, img1, isPositiveShift, aspl);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
CV_Error_(CV_StsNotImplemented, ("Unknown operation %d", operation));
|
CV_Error_(Error::StsNotImplemented, ("Unknown operation %d", operation));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -274,7 +274,7 @@ static void fhtVo(Mat &img0,
|
|||||||
fhtVo<double, CV_64FC1>(img0, img1, isPositiveShift, operation, aspl);
|
fhtVo<double, CV_64FC1>(img0, img1, isPositiveShift, operation, aspl);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
CV_Error_(CV_StsNotImplemented, ("Unknown depth %d", depth));
|
CV_Error_(Error::StsNotImplemented, ("Unknown depth %d", depth));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -345,7 +345,7 @@ static void calculateFHTQuadrant(Mat &dst,
|
|||||||
aspl = 0.5;
|
aspl = 0.5;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
CV_Error_(CV_StsNotImplemented, ("Unknown quadrant %d", quadrant));
|
CV_Error_(Error::StsNotImplemented, ("Unknown quadrant %d", quadrant));
|
||||||
}
|
}
|
||||||
|
|
||||||
FHT(dst, src, operation, bVert, bClock, aspl);
|
FHT(dst, src, operation, bVert, bClock, aspl);
|
||||||
@@ -385,7 +385,7 @@ static void createDstFhtMat(OutputArray dst,
|
|||||||
ht = 2 * (cols + rows) - 3;
|
ht = 2 * (cols + rows) - 3;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
CV_Error_(CV_StsNotImplemented, ("Unknown angleRange %d", angleRange));
|
CV_Error_(Error::StsNotImplemented, ("Unknown angleRange %d", angleRange));
|
||||||
}
|
}
|
||||||
|
|
||||||
dst.create(ht, wd, CV_MAKETYPE(depth, channels));
|
dst.create(ht, wd, CV_MAKETYPE(depth, channels));
|
||||||
@@ -411,7 +411,7 @@ static void createFHTSrc(Mat &srcFull,
|
|||||||
verticalTiling = true;
|
verticalTiling = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
CV_Error_(CV_StsNotImplemented, ("Unknown angleRange %d", angleRange));
|
CV_Error_(Error::StsNotImplemented, ("Unknown angleRange %d", angleRange));
|
||||||
}
|
}
|
||||||
|
|
||||||
int wd = verticalTiling ? src.cols : src.cols + src.rows;
|
int wd = verticalTiling ? src.cols : src.cols + src.rows;
|
||||||
@@ -454,7 +454,7 @@ static void setFHTDstRegion(Mat &dstRegion,
|
|||||||
base = 3;
|
base = 3;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
CV_Error_(CV_StsNotImplemented, ("Unknown angleRange %d", angleRange));
|
CV_Error_(Error::StsNotImplemented, ("Unknown angleRange %d", angleRange));
|
||||||
}
|
}
|
||||||
|
|
||||||
int quad = -1;
|
int quad = -1;
|
||||||
@@ -473,7 +473,7 @@ static void setFHTDstRegion(Mat &dstRegion,
|
|||||||
quad = 3;
|
quad = 3;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
CV_Error_(CV_StsNotImplemented, ("Unknown quadrant %d", quadrant));
|
CV_Error_(Error::StsNotImplemented, ("Unknown quadrant %d", quadrant));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (quad < base)
|
if (quad < base)
|
||||||
@@ -532,7 +532,7 @@ static void skewQuadrant(Mat &quad,
|
|||||||
start = wd * .5 - 0.5;
|
start = wd * .5 - 0.5;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
CV_Error_(CV_StsNotImplemented, ("Unknown quadrant %d", quadrant));
|
CV_Error_(Error::StsNotImplemented, ("Unknown quadrant %d", quadrant));
|
||||||
}
|
}
|
||||||
|
|
||||||
const int pixlen = static_cast<int>(quad.elemSize());
|
const int pixlen = static_cast<int>(quad.elemSize());
|
||||||
@@ -664,7 +664,7 @@ void FastHoughTransform(InputArray src,
|
|||||||
skewQuadrant(dstMat, imgSrc, buf, angleRange);
|
skewQuadrant(dstMat, imgSrc, buf, angleRange);
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
CV_Error_(CV_StsNotImplemented, ("Unknown angleRange %d", angleRange));
|
CV_Error_(Error::StsNotImplemented, ("Unknown angleRange %d", angleRange));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -704,7 +704,7 @@ static void getRawPoint(Point &rawHoughPoint,
|
|||||||
base = 3;
|
base = 3;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
CV_Error_(CV_StsNotImplemented, ("Unknown angleRange %d", angleRange));
|
CV_Error_(Error::StsNotImplemented, ("Unknown angleRange %d", angleRange));
|
||||||
}
|
}
|
||||||
|
|
||||||
int const cols = srcImgInfo.cols;
|
int const cols = srcImgInfo.cols;
|
||||||
@@ -720,7 +720,7 @@ static void getRawPoint(Point &rawHoughPoint,
|
|||||||
rawHoughPoint.y -= qsize;
|
rawHoughPoint.y -= qsize;
|
||||||
}
|
}
|
||||||
if (quad >= 4)
|
if (quad >= 4)
|
||||||
CV_Error(CV_StsInternal, "");
|
CV_Error(Error::StsInternal, "");
|
||||||
|
|
||||||
quadRawPoint = quad;
|
quadRawPoint = quad;
|
||||||
|
|
||||||
|
@@ -91,7 +91,7 @@ void niBlackThreshold( InputArray _src, OutputArray _dst, double maxValue,
|
|||||||
thresh = mean + static_cast<float>(k) * sqrtVarianceMeanSum;
|
thresh = mean + static_cast<float>(k) * sqrtVarianceMeanSum;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
CV_Error(CV_StsBadArg, "Unknown binarization method");
|
CV_Error( Error::StsBadArg, "Unknown binarization method" );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
thresh.convertTo(thresh, src.depth());
|
thresh.convertTo(thresh, src.depth());
|
||||||
@@ -124,7 +124,7 @@ void niBlackThreshold( InputArray _src, OutputArray _dst, double maxValue,
|
|||||||
src.copyTo(dst, mask);
|
src.copyTo(dst, mask);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
CV_Error( CV_StsBadArg, "Unknown threshold type" );
|
CV_Error( Error::StsBadArg, "Unknown threshold type" );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -41,8 +41,6 @@
|
|||||||
#include <opencv2/core/ocl.hpp>
|
#include <opencv2/core/ocl.hpp>
|
||||||
#include <opencv2/core/base.hpp>
|
#include <opencv2/core/base.hpp>
|
||||||
#include <opencv2/core/utility.hpp>
|
#include <opencv2/core/utility.hpp>
|
||||||
#include <opencv2/core/cvdef.h>
|
|
||||||
#include <opencv2/core/core_c.h>
|
|
||||||
#include <opencv2/core/private.hpp>
|
#include <opencv2/core/private.hpp>
|
||||||
#include <opencv2/imgproc.hpp>
|
#include <opencv2/imgproc.hpp>
|
||||||
|
|
||||||
|
@@ -1031,7 +1031,7 @@ public:
|
|||||||
{
|
{
|
||||||
if (m_validSize >= m_size)
|
if (m_validSize >= m_size)
|
||||||
{
|
{
|
||||||
CV_Error(CV_StsOutOfRange, " m_validSize >= m_size this problem can be resolved my decreasig k parameter");
|
CV_Error(Error::StsOutOfRange, " m_validSize >= m_size this problem can be resolved my decreasig k parameter");
|
||||||
}
|
}
|
||||||
m_index[m_validSize] = index;
|
m_index[m_validSize] = index;
|
||||||
m_weight[m_validSize] = weight;
|
m_weight[m_validSize] = weight;
|
||||||
|
@@ -830,7 +830,7 @@ protected:
|
|||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
cv::reduce( dstM.reshape(1, int( dstM.total() ) ), dstM, 2, CV_REDUCE_SUM);
|
cv::reduce( dstM.reshape(1, int( dstM.total() ) ), dstM, 2, REDUCE_SUM);
|
||||||
imsmooth( dstM.reshape(1, dst.rows), 1 ).copyTo(dst);
|
imsmooth( dstM.reshape(1, dst.rows), 1 ).copyTo(dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -334,7 +334,7 @@ void featureIndexing(Mat &F, float **&wMap, int &nF, float sigmaI, int weightTyp
|
|||||||
//do K-means
|
//do K-means
|
||||||
Mat labels;
|
Mat labels;
|
||||||
Mat centers;
|
Mat centers;
|
||||||
kmeans(samples, nF, labels, TermCriteria(CV_TERMCRIT_ITER|CV_TERMCRIT_EPS, 0, 10000), KmeansAttempts, KMEANS_PP_CENTERS, centers );
|
kmeans(samples, nF, labels, TermCriteria(TermCriteria::MAX_ITER| TermCriteria::EPS, 0, 10000), KmeansAttempts, KMEANS_PP_CENTERS, centers );
|
||||||
|
|
||||||
//make connection (i,j,k) <-> index
|
//make connection (i,j,k) <-> index
|
||||||
top = 0;
|
top = 0;
|
||||||
|
@@ -59,16 +59,9 @@
|
|||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
|
||||||
#include "opencv2/xphoto.hpp"
|
#include "opencv2/xphoto.hpp"
|
||||||
|
|
||||||
#include "opencv2/imgproc.hpp"
|
#include "opencv2/imgproc.hpp"
|
||||||
#include "opencv2/imgproc/imgproc_c.h"
|
|
||||||
|
|
||||||
#include "opencv2/core.hpp"
|
#include "opencv2/core.hpp"
|
||||||
#include "opencv2/core/core_c.h"
|
|
||||||
|
|
||||||
#include "opencv2/core/types.hpp"
|
#include "opencv2/core/types.hpp"
|
||||||
#include "opencv2/core/types_c.h"
|
|
||||||
|
|
||||||
#include "photomontage.hpp"
|
#include "photomontage.hpp"
|
||||||
#include "annf.hpp"
|
#include "annf.hpp"
|
||||||
#include "advanced_types.hpp"
|
#include "advanced_types.hpp"
|
||||||
@@ -305,7 +298,7 @@ namespace xphoto
|
|||||||
shiftMapInpaint <Tp, cn>(src, mask, dst);
|
shiftMapInpaint <Tp, cn>(src, mask, dst);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
CV_Error_( CV_StsNotImplemented,
|
CV_Error_( Error::StsNotImplemented,
|
||||||
("Unsupported algorithm type (=%d)", algorithmType) );
|
("Unsupported algorithm type (=%d)", algorithmType) );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -401,7 +394,7 @@ namespace xphoto
|
|||||||
inpaint <double, 4>( src, mask, dst, algorithmType );
|
inpaint <double, 4>( src, mask, dst, algorithmType );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
CV_Error_( CV_StsNotImplemented,
|
CV_Error_( Error::StsNotImplemented,
|
||||||
("Unsupported source image format (=%d)",
|
("Unsupported source image format (=%d)",
|
||||||
src.type()) );
|
src.type()) );
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user