mirror of
https://github.com/opencv/opencv.git
synced 2024-11-28 21:20:18 +08:00
Merge pull request #2393 from ilya-lavrenov:coverity
This commit is contained in:
commit
bd5d8404c9
@ -1998,7 +1998,7 @@ bool cv::findCirclesGrid( InputArray _image, Size patternSize,
|
||||
{
|
||||
isFound = boxFinder.findHoles();
|
||||
}
|
||||
catch (cv::Exception)
|
||||
catch (const cv::Exception &)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -218,6 +218,7 @@ void CirclesGridClusterFinder::findCorners(const std::vector<cv::Point2f> &hull2
|
||||
|
||||
void CirclesGridClusterFinder::findOutsideCorners(const std::vector<cv::Point2f> &corners, std::vector<cv::Point2f> &outsideCorners)
|
||||
{
|
||||
CV_Assert(!corners.empty());
|
||||
outsideCorners.clear();
|
||||
//find two pairs of the most nearest corners
|
||||
int i, j, n = (int)corners.size();
|
||||
|
@ -57,6 +57,7 @@ CvLevMarq::CvLevMarq()
|
||||
criteria = cvTermCriteria(0,0,0);
|
||||
iters = 0;
|
||||
completeSymmFlag = false;
|
||||
errNorm = prevErrNorm = DBL_MAX;
|
||||
}
|
||||
|
||||
CvLevMarq::CvLevMarq( int nparams, int nerrs, CvTermCriteria criteria0, bool _completeSymmFlag )
|
||||
@ -101,7 +102,7 @@ void CvLevMarq::init( int nparams, int nerrs, CvTermCriteria criteria0, bool _co
|
||||
J.reset(cvCreateMat( nerrs, nparams, CV_64F ));
|
||||
err.reset(cvCreateMat( nerrs, 1, CV_64F ));
|
||||
}
|
||||
prevErrNorm = DBL_MAX;
|
||||
errNorm = prevErrNorm = DBL_MAX;
|
||||
lambdaLg10 = -3;
|
||||
criteria = criteria0;
|
||||
if( criteria.type & CV_TERMCRIT_ITER )
|
||||
|
@ -74,7 +74,6 @@ class epnp {
|
||||
int number_of_correspondences;
|
||||
|
||||
double cws[4][3], ccs[4][3];
|
||||
double cws_determinant;
|
||||
int max_nr;
|
||||
double * A1, * A2;
|
||||
};
|
||||
|
@ -260,7 +260,6 @@ public:
|
||||
|
||||
Ptr<PointSetRegistrator::Callback> cb;
|
||||
int modelPoints;
|
||||
int maxBasicSolutions;
|
||||
bool checkPartialSubsets;
|
||||
double threshold;
|
||||
double confidence;
|
||||
|
@ -1393,6 +1393,7 @@ void CV_StereoCalibrationTest::run( int )
|
||||
{
|
||||
ts->printf( cvtest::TS::LOG, "The file %s can not be opened or has invalid content\n", filepath.c_str() );
|
||||
ts->set_failed_test_info( f ? cvtest::TS::FAIL_INVALID_TEST_DATA : cvtest::TS::FAIL_MISSING_TEST_DATA );
|
||||
fclose(f);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,8 @@ Mat calcRvec(const vector<Point3f>& points, const Size& cornerSize)
|
||||
class CV_CalibrateCameraArtificialTest : public cvtest::BaseTest
|
||||
{
|
||||
public:
|
||||
CV_CalibrateCameraArtificialTest()
|
||||
CV_CalibrateCameraArtificialTest() :
|
||||
r(0)
|
||||
{
|
||||
}
|
||||
~CV_CalibrateCameraArtificialTest() {}
|
||||
|
@ -309,8 +309,9 @@ void CV_ChessboardDetectorTest::run_batch( const string& filename )
|
||||
progress = update_progress( progress, idx, max_idx, 0 );
|
||||
}
|
||||
|
||||
sum_error /= count;
|
||||
ts->printf(cvtest::TS::LOG, "Average error is %f\n", sum_error);
|
||||
if (count != 0)
|
||||
sum_error /= count;
|
||||
ts->printf(cvtest::TS::LOG, "Average error is %f (%d patterns have been found)\n", sum_error, count);
|
||||
}
|
||||
|
||||
double calcErrorMinError(const Size& cornSz, const vector<Point2f>& corners_found, const vector<Point2f>& corners_generated)
|
||||
|
@ -89,7 +89,14 @@ protected:
|
||||
}
|
||||
};
|
||||
|
||||
CV_ChessboardDetectorBadArgTest::CV_ChessboardDetectorBadArgTest() {}
|
||||
CV_ChessboardDetectorBadArgTest::CV_ChessboardDetectorBadArgTest()
|
||||
{
|
||||
cpp = false;
|
||||
flags = 0;
|
||||
out_corners = NULL;
|
||||
out_corner_count = NULL;
|
||||
drawCorners = was_found = false;
|
||||
}
|
||||
|
||||
/* ///////////////////// chess_corner_test ///////////////////////// */
|
||||
void CV_ChessboardDetectorBadArgTest::run( int /*start_from */)
|
||||
|
@ -211,6 +211,7 @@ void CV_ChessboardSubpixelTest::run( int )
|
||||
|
||||
progress = update_progress( progress, i-1, runs_count, 0 );
|
||||
}
|
||||
ASSERT_NE(0, count);
|
||||
sum_dist /= count;
|
||||
ts->printf(cvtest::TS::LOG, "Average error after findCornerSubpix: %f\n", sum_dist);
|
||||
|
||||
|
@ -808,6 +808,7 @@ CV_FundamentalMatTest::CV_FundamentalMatTest()
|
||||
method = 0;
|
||||
img_size = 10;
|
||||
cube_size = 10;
|
||||
dims = 0;
|
||||
min_f = 1;
|
||||
max_f = 3;
|
||||
sigma = 0;//0.1;
|
||||
@ -1086,7 +1087,6 @@ protected:
|
||||
int img_size;
|
||||
int cube_size;
|
||||
int dims;
|
||||
int e_result;
|
||||
double min_f, max_f;
|
||||
double sigma;
|
||||
};
|
||||
@ -1124,9 +1124,10 @@ CV_EssentialMatTest::CV_EssentialMatTest()
|
||||
method = 0;
|
||||
img_size = 10;
|
||||
cube_size = 10;
|
||||
dims = 0;
|
||||
min_f = 1;
|
||||
max_f = 3;
|
||||
|
||||
sigma = 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -75,6 +75,9 @@ CV_DefaultNewCameraMatrixTest::CV_DefaultNewCameraMatrixTest()
|
||||
test_array[INPUT].push_back(NULL);
|
||||
test_array[OUTPUT].push_back(NULL);
|
||||
test_array[REF_OUTPUT].push_back(NULL);
|
||||
|
||||
matrix_type = 0;
|
||||
center_principal_point = false;
|
||||
}
|
||||
|
||||
void CV_DefaultNewCameraMatrixTest::get_test_array_types_and_sizes( int test_case_idx, vector<vector<Size> >& sizes, vector<vector<int> >& types )
|
||||
@ -200,6 +203,9 @@ CV_UndistortPointsTest::CV_UndistortPointsTest()
|
||||
test_array[OUTPUT].push_back(NULL); // distorted dst points
|
||||
test_array[TEMP].push_back(NULL); // dst points
|
||||
test_array[REF_OUTPUT].push_back(NULL);
|
||||
|
||||
useCPlus = useDstMat = false;
|
||||
zero_new_cam = zero_distortion = zero_R = false;
|
||||
}
|
||||
|
||||
void CV_UndistortPointsTest::get_test_array_types_and_sizes( int test_case_idx, vector<vector<Size> >& sizes, vector<vector<int> >& types )
|
||||
@ -605,6 +611,11 @@ CV_InitUndistortRectifyMapTest::CV_InitUndistortRectifyMapTest()
|
||||
test_array[INPUT].push_back(NULL); // new camera matrix
|
||||
test_array[OUTPUT].push_back(NULL); // distorted dst points
|
||||
test_array[REF_OUTPUT].push_back(NULL);
|
||||
|
||||
useCPlus = false;
|
||||
zero_distortion = zero_new_cam = zero_R = false;
|
||||
_mapx = _mapy = NULL;
|
||||
mat_type = 0;
|
||||
}
|
||||
|
||||
void CV_InitUndistortRectifyMapTest::get_test_array_types_and_sizes( int test_case_idx, vector<vector<Size> >& sizes, vector<vector<int> >& types )
|
||||
|
@ -78,6 +78,8 @@ private:
|
||||
|
||||
CV_UndistortPointsBadArgTest::CV_UndistortPointsBadArgTest ()
|
||||
{
|
||||
useCPlus = false;
|
||||
_camera_mat = matR = matP = _distortion_coeffs = _src_points = _dst_points = NULL;
|
||||
}
|
||||
|
||||
void CV_UndistortPointsBadArgTest::run_func()
|
||||
@ -311,6 +313,8 @@ private:
|
||||
|
||||
CV_InitUndistortRectifyMapBadArgTest::CV_InitUndistortRectifyMapBadArgTest ()
|
||||
{
|
||||
useCPlus = false;
|
||||
_camera_mat = matR = _new_camera_mat = _distortion_coeffs = _mapx = _mapy = NULL;
|
||||
}
|
||||
|
||||
void CV_InitUndistortRectifyMapBadArgTest::run_func()
|
||||
@ -431,6 +435,8 @@ private:
|
||||
|
||||
CV_UndistortBadArgTest::CV_UndistortBadArgTest ()
|
||||
{
|
||||
useCPlus = false;
|
||||
_camera_mat = _new_camera_mat = _distortion_coeffs = _src = _dst = NULL;
|
||||
}
|
||||
|
||||
void CV_UndistortBadArgTest::run_func()
|
||||
|
@ -55,7 +55,7 @@ class CV_EXPORTS Octree
|
||||
public:
|
||||
struct Node
|
||||
{
|
||||
Node() {}
|
||||
Node() { memset(this, 0, sizeof(Node)); }
|
||||
int begin, end;
|
||||
float x_min, x_max, y_min, y_max, z_min, z_max;
|
||||
int maxLevels;
|
||||
|
@ -340,6 +340,8 @@ class CV_EXPORTS CommandLineParser
|
||||
CommandLineParser(const CommandLineParser& parser);
|
||||
CommandLineParser& operator = (const CommandLineParser& parser);
|
||||
|
||||
~CommandLineParser();
|
||||
|
||||
String getPathToApplication() const;
|
||||
|
||||
template <typename T>
|
||||
|
@ -237,6 +237,11 @@ CommandLineParser::CommandLineParser(int argc, const char* const argv[], const S
|
||||
impl->sort_params();
|
||||
}
|
||||
|
||||
CommandLineParser::~CommandLineParser()
|
||||
{
|
||||
if (CV_XADD(&impl->refcount, -1) == 1)
|
||||
delete impl;
|
||||
}
|
||||
|
||||
CommandLineParser::CommandLineParser(const CommandLineParser& parser)
|
||||
{
|
||||
|
@ -353,7 +353,7 @@ Mat& Mat::operator = (const Scalar& s)
|
||||
|
||||
Mat& Mat::setTo(InputArray _value, InputArray _mask)
|
||||
{
|
||||
if( !data )
|
||||
if( empty() )
|
||||
return *this;
|
||||
|
||||
Mat value = _value.getMat(), mask = _mask.getMat();
|
||||
@ -632,6 +632,7 @@ int cv::borderInterpolate( int p, int len, int borderType )
|
||||
}
|
||||
else if( borderType == BORDER_WRAP )
|
||||
{
|
||||
CV_Assert(len > 0);
|
||||
if( p < 0 )
|
||||
p -= ((p-len+1)/len)*len;
|
||||
if( p >= len )
|
||||
|
@ -2641,9 +2641,9 @@ KernelArg KernelArg::Constant(const Mat& m)
|
||||
|
||||
struct Kernel::Impl
|
||||
{
|
||||
Impl(const char* kname, const Program& prog)
|
||||
Impl(const char* kname, const Program& prog) :
|
||||
refcount(1), e(0), nu(0)
|
||||
{
|
||||
e = 0; refcount = 1;
|
||||
cl_program ph = (cl_program)prog.ptr();
|
||||
cl_int retval = 0;
|
||||
handle = ph != 0 ?
|
||||
|
@ -426,6 +426,7 @@ String format( const char* fmt, ... )
|
||||
String s(len, '\0');
|
||||
va_start(va, fmt);
|
||||
len = vsnprintf((char*)s.c_str(), len + 1, fmt, va);
|
||||
(void)len;
|
||||
va_end(va);
|
||||
return s;
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ struct BaseElemWiseOp
|
||||
BaseElemWiseOp(int _ninputs, int _flags, double _alpha, double _beta,
|
||||
Scalar _gamma=Scalar::all(0), int _context=1)
|
||||
: ninputs(_ninputs), flags(_flags), alpha(_alpha), beta(_beta), gamma(_gamma), context(_context) {}
|
||||
BaseElemWiseOp() { flags = 0; alpha = beta = 0; gamma = Scalar::all(0); }
|
||||
BaseElemWiseOp() { flags = 0; alpha = beta = 0; gamma = Scalar::all(0); ninputs = 0; context = 1; }
|
||||
virtual ~BaseElemWiseOp() {}
|
||||
virtual void op(const vector<Mat>&, Mat&, const Mat&) {}
|
||||
virtual void refop(const vector<Mat>&, Mat&, const Mat&) {}
|
||||
@ -89,7 +89,6 @@ struct BaseElemWiseOp
|
||||
double alpha;
|
||||
double beta;
|
||||
Scalar gamma;
|
||||
int maxErr;
|
||||
int context;
|
||||
};
|
||||
|
||||
@ -409,7 +408,7 @@ struct MaxSOp : public BaseElemWiseOp
|
||||
|
||||
struct CmpOp : public BaseElemWiseOp
|
||||
{
|
||||
CmpOp() : BaseElemWiseOp(2, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}
|
||||
CmpOp() : BaseElemWiseOp(2, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) { cmpop = 0; }
|
||||
void generateScalars(int depth, RNG& rng)
|
||||
{
|
||||
BaseElemWiseOp::generateScalars(depth, rng);
|
||||
@ -437,7 +436,7 @@ struct CmpOp : public BaseElemWiseOp
|
||||
|
||||
struct CmpSOp : public BaseElemWiseOp
|
||||
{
|
||||
CmpSOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+REAL_GAMMA, 1, 1, Scalar::all(0)) {}
|
||||
CmpSOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+REAL_GAMMA, 1, 1, Scalar::all(0)) { cmpop = 0; }
|
||||
void generateScalars(int depth, RNG& rng)
|
||||
{
|
||||
BaseElemWiseOp::generateScalars(depth, rng);
|
||||
@ -467,7 +466,7 @@ struct CmpSOp : public BaseElemWiseOp
|
||||
|
||||
struct CopyOp : public BaseElemWiseOp
|
||||
{
|
||||
CopyOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+FIX_GAMMA+SUPPORT_MASK, 1, 1, Scalar::all(0)) {}
|
||||
CopyOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+FIX_GAMMA+SUPPORT_MASK, 1, 1, Scalar::all(0)) { }
|
||||
void op(const vector<Mat>& src, Mat& dst, const Mat& mask)
|
||||
{
|
||||
src[0].copyTo(dst, mask);
|
||||
@ -484,7 +483,6 @@ struct CopyOp : public BaseElemWiseOp
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int cmpop;
|
||||
};
|
||||
|
||||
|
||||
@ -810,7 +808,7 @@ static void setIdentity(Mat& dst, const Scalar& s)
|
||||
|
||||
struct FlipOp : public BaseElemWiseOp
|
||||
{
|
||||
FlipOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}
|
||||
FlipOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) { flipcode = 0; }
|
||||
void getRandomSize(RNG& rng, vector<int>& size)
|
||||
{
|
||||
cvtest::randomSize(rng, 2, 2, cvtest::ARITHM_MAX_SIZE_LOG, size);
|
||||
|
@ -617,6 +617,7 @@ Core_GEMMTest::Core_GEMMTest() : Core_MatrixTest( 5, 1, false, false, 2 )
|
||||
{
|
||||
test_case_count = 100;
|
||||
max_log_array_size = 10;
|
||||
tabc_flag = 0;
|
||||
alpha = beta = 0;
|
||||
}
|
||||
|
||||
@ -821,6 +822,8 @@ protected:
|
||||
|
||||
Core_TransformTest::Core_TransformTest() : Core_MatrixTest( 3, 1, true, false, 4 )
|
||||
{
|
||||
scale = 1;
|
||||
diagMtx = false;
|
||||
}
|
||||
|
||||
|
||||
@ -1154,7 +1157,7 @@ protected:
|
||||
|
||||
|
||||
Core_CovarMatrixTest::Core_CovarMatrixTest() : Core_MatrixTest( 1, 1, true, false, 1 ),
|
||||
flags(0), t_flag(0), are_images(false)
|
||||
flags(0), t_flag(0), len(0), count(0), are_images(false)
|
||||
{
|
||||
test_case_count = 100;
|
||||
test_array[INPUT_OUTPUT].push_back(NULL);
|
||||
|
@ -44,7 +44,7 @@
|
||||
namespace cv
|
||||
{
|
||||
|
||||
BOWTrainer::BOWTrainer()
|
||||
BOWTrainer::BOWTrainer() : size(0)
|
||||
{}
|
||||
|
||||
BOWTrainer::~BOWTrainer()
|
||||
|
@ -224,6 +224,8 @@ BRISK::BRISK(std::vector<float> &radiusList, std::vector<int> &numberList, float
|
||||
std::vector<int> indexChange)
|
||||
{
|
||||
generateKernel(radiusList, numberList, dMax, dMin, indexChange);
|
||||
threshold = 20;
|
||||
octaves = 3;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -408,7 +408,7 @@ static bool ocl_accumulate( InputArray _src, InputArray _src2, InputOutputArray
|
||||
argidx = k.set(argidx, alpha);
|
||||
}
|
||||
if (haveMask)
|
||||
argidx = k.set(argidx, maskarg);
|
||||
k.set(argidx, maskarg);
|
||||
|
||||
size_t globalsize[2] = { src.cols, src.rows };
|
||||
return k.run(2, globalsize, NULL, false);
|
||||
|
@ -83,11 +83,9 @@ namespace clahe
|
||||
idx = k.set(idx, tile_size);
|
||||
idx = k.set(idx, tilesX);
|
||||
idx = k.set(idx, clipLimit);
|
||||
idx = k.set(idx, lutScale);
|
||||
k.set(idx, lutScale);
|
||||
|
||||
if (!k.run(2, globalThreads, localThreads, false))
|
||||
return false;
|
||||
return true;
|
||||
return k.run(2, globalThreads, localThreads, false);
|
||||
}
|
||||
|
||||
static bool transform(cv::InputArray _src, cv::OutputArray _dst, cv::InputArray _lut,
|
||||
@ -118,11 +116,9 @@ namespace clahe
|
||||
idx = k.set(idx, src.rows);
|
||||
idx = k.set(idx, tile_size);
|
||||
idx = k.set(idx, tilesX);
|
||||
idx = k.set(idx, tilesY);
|
||||
k.set(idx, tilesY);
|
||||
|
||||
if (!k.run(2, globalThreads, localThreads, false))
|
||||
return false;
|
||||
return true;
|
||||
return k.run(2, globalThreads, localThreads, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -540,8 +540,6 @@ void cv::Laplacian( InputArray _src, OutputArray _dst, int ddepth, int ksize,
|
||||
int wtype = CV_MAKETYPE(wdepth, src.channels());
|
||||
Mat kd, ks;
|
||||
getSobelKernels( kd, ks, 2, 0, ksize, false, ktype );
|
||||
if( ddepth < 0 )
|
||||
ddepth = src.depth();
|
||||
int dtype = CV_MAKETYPE(ddepth, src.channels());
|
||||
|
||||
int dy0 = std::min(std::max((int)(STRIPE_SIZE/(getElemSize(src.type())*src.cols)), 1), src.rows);
|
||||
|
@ -1405,7 +1405,11 @@ struct SymmColumnVec_32f16s
|
||||
|
||||
struct RowVec_32f
|
||||
{
|
||||
RowVec_32f() {}
|
||||
RowVec_32f()
|
||||
{
|
||||
haveSSE = checkHardwareSupport(CV_CPU_SSE);
|
||||
}
|
||||
|
||||
RowVec_32f( const Mat& _kernel )
|
||||
{
|
||||
kernel = _kernel;
|
||||
|
@ -99,6 +99,8 @@ CV_ColorCvtBaseTest::CV_ColorCvtBaseTest( bool _custom_inv_transform, bool _allo
|
||||
|
||||
test_cpp = false;
|
||||
hue_range = 0;
|
||||
blue_idx = 0;
|
||||
inplace = false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -351,7 +351,7 @@ namespace cv
|
||||
{
|
||||
struct DTreeBestSplitFinder
|
||||
{
|
||||
DTreeBestSplitFinder(){ tree = 0; node = 0; }
|
||||
DTreeBestSplitFinder(){ splitSize = 0, tree = 0; node = 0; }
|
||||
DTreeBestSplitFinder( CvDTree* _tree, CvDTreeNode* _node);
|
||||
DTreeBestSplitFinder( const DTreeBestSplitFinder& finder, Split );
|
||||
virtual ~DTreeBestSplitFinder() {}
|
||||
|
@ -294,7 +294,7 @@ void ERFilterNM::er_tree_extract( InputArray image )
|
||||
push_new_component = false;
|
||||
|
||||
// explore the (remaining) edges to the neighbors to the current pixel
|
||||
for (current_edge = current_edge; current_edge < 4; current_edge++)
|
||||
for ( ; current_edge < 4; current_edge++)
|
||||
{
|
||||
|
||||
int neighbour_pixel = current_pixel;
|
||||
@ -1949,7 +1949,6 @@ private:
|
||||
double (dissimilarity::*distfn) (const int_fast32_t, const int_fast32_t) const;
|
||||
|
||||
auto_array_ptr<double> precomputed;
|
||||
double * precomputed2;
|
||||
|
||||
double * V;
|
||||
const double * V_data;
|
||||
|
@ -574,7 +574,7 @@ public:
|
||||
Size winStride = Size(), Size padding = Size(),
|
||||
const vector<Point>& locations = vector<Point>()) const;
|
||||
|
||||
virtual void compute(const Mat& img, vector<float>& descriptors,
|
||||
virtual void compute(InputArray img, vector<float>& descriptors,
|
||||
Size winStride = Size(), Size padding = Size(),
|
||||
const vector<Point>& locations = vector<Point>()) const;
|
||||
|
||||
@ -1107,9 +1107,11 @@ void HOGDescriptorTester::detect(const Mat& img, vector<Point>& hits, double hit
|
||||
detect(img, hits, weightsV, hitThreshold, winStride, padding, locations);
|
||||
}
|
||||
|
||||
void HOGDescriptorTester::compute(const Mat& img, vector<float>& descriptors,
|
||||
void HOGDescriptorTester::compute(InputArray _img, vector<float>& descriptors,
|
||||
Size winStride, Size padding, const vector<Point>& locations) const
|
||||
{
|
||||
Mat img = _img.getMat();
|
||||
|
||||
if( winStride == Size() )
|
||||
winStride = cellSize;
|
||||
Size cacheStride(gcd(winStride.width, blockStride.width),
|
||||
|
@ -120,7 +120,6 @@ public:
|
||||
|
||||
private:
|
||||
float minMatchCost;
|
||||
float betaAdditional;
|
||||
protected:
|
||||
void buildCostMatrix(const cv::Mat& descriptors1, const cv::Mat& descriptors2,
|
||||
cv::Mat& costMatrix, cv::Ptr<cv::HistogramCostExtractor>& comparer) const;
|
||||
|
@ -2897,7 +2897,7 @@ static std::ostream& operator << (std::ostream& out, const MatPart& m)
|
||||
}
|
||||
|
||||
MatComparator::MatComparator(double _maxdiff, int _context)
|
||||
: maxdiff(_maxdiff), context(_context) {}
|
||||
: maxdiff(_maxdiff), realmaxdiff(DBL_MAX), context(_context) {}
|
||||
|
||||
::testing::AssertionResult
|
||||
MatComparator::operator()(const char* expr1, const char* expr2,
|
||||
|
@ -855,6 +855,9 @@ int64 TestBase::_calibrate()
|
||||
#endif
|
||||
TestBase::TestBase(): testStrategy(PERF_STRATEGY_DEFAULT), declare(this)
|
||||
{
|
||||
lastTime = totalTime = timeLimit = 0;
|
||||
nIters = currentIter = runsPerIteration = 0;
|
||||
verified = false;
|
||||
}
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(pop)
|
||||
|
@ -779,7 +779,7 @@ bool BackgroundSubtractorMOG2Impl::ocl_apply(InputArray _image, OutputArray _fgm
|
||||
idxArg = kernel_apply.set(idxArg, varMax);
|
||||
idxArg = kernel_apply.set(idxArg, fVarInit);
|
||||
idxArg = kernel_apply.set(idxArg, fTau);
|
||||
idxArg = kernel_apply.set(idxArg, nShadowDetection);
|
||||
kernel_apply.set(idxArg, nShadowDetection);
|
||||
|
||||
size_t globalsize[] = {frame.cols, frame.rows, 1};
|
||||
|
||||
@ -805,7 +805,7 @@ bool BackgroundSubtractorMOG2Impl::ocl_getBackgroundImage(OutputArray _backgroun
|
||||
idxArg = kernel_getBg.set(idxArg, ocl::KernelArg::ReadOnlyNoSize(u_weight));
|
||||
idxArg = kernel_getBg.set(idxArg, ocl::KernelArg::ReadOnlyNoSize(u_mean));
|
||||
idxArg = kernel_getBg.set(idxArg, ocl::KernelArg::WriteOnlyNoSize(dst));
|
||||
idxArg = kernel_getBg.set(idxArg, backgroundRatio);
|
||||
kernel_getBg.set(idxArg, backgroundRatio);
|
||||
|
||||
size_t globalsize[2] = {u_bgmodelUsedModes.cols, u_bgmodelUsedModes.rows};
|
||||
|
||||
|
@ -857,7 +857,7 @@ private:
|
||||
idxArg = kernel.set(idxArg, dst.cols);
|
||||
idxArg = kernel.set(idxArg, ocl::KernelArg::PtrReadOnly(m_gKer));
|
||||
idxArg = kernel.set(idxArg, (int)ksizeHalf);
|
||||
idxArg = kernel.set(idxArg, (void *)NULL, smem_size);
|
||||
kernel.set(idxArg, (void *)NULL, smem_size);
|
||||
return kernel.run(2, globalsize, localsize, false);
|
||||
}
|
||||
bool gaussianBlur5Ocl(const UMat &src, int ksizeHalf, UMat &dst)
|
||||
@ -883,7 +883,7 @@ private:
|
||||
idxArg = kernel.set(idxArg, src.cols);
|
||||
idxArg = kernel.set(idxArg, ocl::KernelArg::PtrReadOnly(m_gKer));
|
||||
idxArg = kernel.set(idxArg, (int)ksizeHalf);
|
||||
idxArg = kernel.set(idxArg, (void *)NULL, smem_size);
|
||||
kernel.set(idxArg, (void *)NULL, smem_size);
|
||||
return kernel.run(2, globalsize, localsize, false);
|
||||
}
|
||||
bool polynomialExpansionOcl(const UMat &src, UMat &dst)
|
||||
@ -919,12 +919,7 @@ private:
|
||||
idxArg = kernel.set(idxArg, ocl::KernelArg::PtrReadOnly(m_xg));
|
||||
idxArg = kernel.set(idxArg, ocl::KernelArg::PtrReadOnly(m_xxg));
|
||||
idxArg = kernel.set(idxArg, (void *)NULL, smem_size);
|
||||
#if 0
|
||||
if (useDouble)
|
||||
idxArg = kernel.set(idxArg, (void *)m_igd, 4 * sizeof(double));
|
||||
else
|
||||
#endif
|
||||
idxArg = kernel.set(idxArg, (void *)m_ig, 4 * sizeof(float));
|
||||
kernel.set(idxArg, (void *)m_ig, 4 * sizeof(float));
|
||||
return kernel.run(2, globalsize, localsize, false);
|
||||
}
|
||||
bool boxFilter5Ocl(const UMat &src, int ksizeHalf, UMat &dst)
|
||||
@ -951,7 +946,7 @@ private:
|
||||
idxArg = kernel.set(idxArg, height);
|
||||
idxArg = kernel.set(idxArg, src.cols);
|
||||
idxArg = kernel.set(idxArg, (int)ksizeHalf);
|
||||
idxArg = kernel.set(idxArg, (void *)NULL, smem_size);
|
||||
kernel.set(idxArg, (void *)NULL, smem_size);
|
||||
return kernel.run(2, globalsize, localsize, false);
|
||||
}
|
||||
|
||||
@ -976,7 +971,7 @@ private:
|
||||
idxArg = kernel.set(idxArg, ocl::KernelArg::PtrReadOnly(flowy));
|
||||
idxArg = kernel.set(idxArg, (int)(flowy.step / flowy.elemSize()));
|
||||
idxArg = kernel.set(idxArg, (int)flowy.rows);
|
||||
idxArg = kernel.set(idxArg, (int)flowy.cols);
|
||||
kernel.set(idxArg, (int)flowy.cols);
|
||||
return kernel.run(2, globalsize, localsize, false);
|
||||
}
|
||||
bool updateMatricesOcl(const UMat &flowx, const UMat &flowy, const UMat &R0, const UMat &R1, UMat &M)
|
||||
@ -1004,7 +999,7 @@ private:
|
||||
idxArg = kernel.set(idxArg, ocl::KernelArg::PtrReadOnly(R1));
|
||||
idxArg = kernel.set(idxArg, (int)(R1.step / R1.elemSize()));
|
||||
idxArg = kernel.set(idxArg, ocl::KernelArg::PtrWriteOnly(M));
|
||||
idxArg = kernel.set(idxArg, (int)(M.step / M.elemSize()));
|
||||
kernel.set(idxArg, (int)(M.step / M.elemSize()));
|
||||
return kernel.run(2, globalsize, localsize, false);
|
||||
}
|
||||
|
||||
|
@ -429,6 +429,7 @@ static inline float extrapolateValueInRect(int height, int width,
|
||||
if (r == height && c == 0) { return v21;}
|
||||
if (r == height && c == width) { return v22;}
|
||||
|
||||
CV_Assert(height > 0 && width > 0);
|
||||
float qr = float(r) / height;
|
||||
float pr = 1.0f - qr;
|
||||
float qc = float(c) / width;
|
||||
|
Loading…
Reference in New Issue
Block a user