mirror of
https://github.com/opencv/opencv.git
synced 2024-11-24 03:00:14 +08:00
Fixing some static analysis issues
This commit is contained in:
parent
b991665b5d
commit
32d4af36e2
@ -577,7 +577,7 @@ std::pair<uint64, bool> CodedInputStream::ReadVarint64Fallback() {
|
||||
buffer_ = p.second;
|
||||
return std::make_pair(temp, true);
|
||||
} else {
|
||||
uint64 temp;
|
||||
uint64 temp = 0;
|
||||
bool success = ReadVarint64Slow(&temp);
|
||||
return std::make_pair(temp, success);
|
||||
}
|
||||
|
@ -127,6 +127,8 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
add_extra_compiler_option(-Wpointer-arith)
|
||||
add_extra_compiler_option(-Wshadow)
|
||||
add_extra_compiler_option(-Wsign-promo)
|
||||
add_extra_compiler_option(-Wuninitialized)
|
||||
add_extra_compiler_option(-Winit-self)
|
||||
|
||||
if(ENABLE_NOISY_WARNINGS)
|
||||
add_extra_compiler_option(-Wcast-align)
|
||||
|
@ -252,7 +252,7 @@ CV_IMPL int cvRodrigues2( const CvMat* src, CvMat* dst, CvMat* jacobian )
|
||||
{
|
||||
int depth, elem_size;
|
||||
int i, k;
|
||||
double J[27];
|
||||
double J[27] = {0};
|
||||
CvMat matJ = cvMat( 3, 9, CV_64F, J );
|
||||
|
||||
if( !CV_IS_MAT(src) )
|
||||
@ -1189,7 +1189,7 @@ CV_IMPL void cvInitIntrinsicParams2D( const CvMat* objectPoints,
|
||||
|
||||
int i, j, pos, nimages, ni = 0;
|
||||
double a[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 };
|
||||
double H[9], f[2];
|
||||
double H[9] = {0}, f[2] = {0};
|
||||
CvMat _a = cvMat( 3, 3, CV_64F, a );
|
||||
CvMat matH = cvMat( 3, 3, CV_64F, H );
|
||||
CvMat _f = cvMat( 2, 1, CV_64F, f );
|
||||
@ -1731,7 +1731,7 @@ void cvCalibrationMatrixValues( const CvMat *calibMatr, CvSize imgSize,
|
||||
if(!CV_IS_MAT(calibMatr))
|
||||
CV_Error(CV_StsUnsupportedFormat, "Input parameters must be a matrices!");
|
||||
|
||||
double dummy;
|
||||
double dummy = .0;
|
||||
Point2d pp;
|
||||
cv::calibrationMatrixValues(cvarrToMat(calibMatr), imgSize, apertureWidth, apertureHeight,
|
||||
fovx ? *fovx : dummy,
|
||||
@ -2281,7 +2281,7 @@ void cvStereoRectify( const CvMat* _cameraMatrix1, const CvMat* _cameraMatrix2,
|
||||
CvMat* matQ, int flags, double alpha, CvSize newImgSize,
|
||||
CvRect* roi1, CvRect* roi2 )
|
||||
{
|
||||
double _om[3], _t[3], _uu[3]={0,0,0}, _r_r[3][3], _pp[3][4];
|
||||
double _om[3], _t[3] = {0}, _uu[3]={0,0,0}, _r_r[3][3], _pp[3][4];
|
||||
double _ww[3], _wr[3][3], _z[3] = {0,0,0}, _ri[3][3];
|
||||
cv::Rect_<float> inner1, inner2, outer1, outer2;
|
||||
|
||||
@ -2574,7 +2574,7 @@ CV_IMPL int cvStereoRectifyUncalibrated(
|
||||
|
||||
int i, j, npoints;
|
||||
double cx, cy;
|
||||
double u[9], v[9], w[9], f[9], h1[9], h2[9], h0[9], e2[3];
|
||||
double u[9], v[9], w[9], f[9], h1[9], h2[9], h0[9], e2[3] = {0};
|
||||
CvMat E2 = cvMat( 3, 1, CV_64F, e2 );
|
||||
CvMat U = cvMat( 3, 3, CV_64F, u );
|
||||
CvMat V = cvMat( 3, 3, CV_64F, v );
|
||||
@ -2722,7 +2722,7 @@ CV_IMPL int cvStereoRectifyUncalibrated(
|
||||
cvPerspectiveTransform( _m1, _m1, &H0 );
|
||||
cvPerspectiveTransform( _m2, _m2, &H2 );
|
||||
CvMat A = cvMat( 1, npoints, CV_64FC3, lines1 ), BxBy, B;
|
||||
double x[3];
|
||||
double x[3] = {0};
|
||||
CvMat X = cvMat( 3, 1, CV_64F, x );
|
||||
cvConvertPointsHomogeneous( _m1, &A );
|
||||
cvReshape( &A, &A, 1, npoints );
|
||||
|
@ -720,7 +720,7 @@ private:
|
||||
|
||||
public:
|
||||
EigenvalueDecomposition()
|
||||
: n(0) { }
|
||||
: n(0), cdivr(0), cdivi(0), d(0), e(0), ort(0), V(0), H(0) {}
|
||||
|
||||
// Initializes & computes the Eigenvalue Decomposition for a general matrix
|
||||
// given in src. This function is a port of the EigenvalueSolver in JAMA,
|
||||
|
@ -60,7 +60,7 @@ void epnp::choose_control_points(void)
|
||||
// Take C1, C2, and C3 from PCA on the reference points:
|
||||
CvMat * PW0 = cvCreateMat(number_of_correspondences, 3, CV_64F);
|
||||
|
||||
double pw0tpw0[3 * 3], dc[3], uct[3 * 3];
|
||||
double pw0tpw0[3 * 3], dc[3] = {0}, uct[3 * 3] = {0};
|
||||
CvMat PW0tPW0 = cvMat(3, 3, CV_64F, pw0tpw0);
|
||||
CvMat DC = cvMat(3, 1, CV_64F, dc);
|
||||
CvMat UCt = cvMat(3, 3, CV_64F, uct);
|
||||
@ -240,7 +240,7 @@ void epnp::estimate_R_and_t(double R[3][3], double t[3])
|
||||
pw0[j] /= number_of_correspondences;
|
||||
}
|
||||
|
||||
double abt[3 * 3], abt_d[3], abt_u[3 * 3], abt_v[3 * 3];
|
||||
double abt[3 * 3] = {0}, abt_d[3], abt_u[3 * 3], abt_v[3 * 3];
|
||||
CvMat ABt = cvMat(3, 3, CV_64F, abt);
|
||||
CvMat ABt_D = cvMat(3, 1, CV_64F, abt_d);
|
||||
CvMat ABt_U = cvMat(3, 3, CV_64F, abt_u);
|
||||
@ -332,7 +332,7 @@ double epnp::reprojection_error(const double R[3][3], const double t[3])
|
||||
void epnp::find_betas_approx_1(const CvMat * L_6x10, const CvMat * Rho,
|
||||
double * betas)
|
||||
{
|
||||
double l_6x4[6 * 4], b4[4];
|
||||
double l_6x4[6 * 4], b4[4] = {0};
|
||||
CvMat L_6x4 = cvMat(6, 4, CV_64F, l_6x4);
|
||||
CvMat B4 = cvMat(4, 1, CV_64F, b4);
|
||||
|
||||
@ -364,7 +364,7 @@ void epnp::find_betas_approx_1(const CvMat * L_6x10, const CvMat * Rho,
|
||||
void epnp::find_betas_approx_2(const CvMat * L_6x10, const CvMat * Rho,
|
||||
double * betas)
|
||||
{
|
||||
double l_6x3[6 * 3], b3[3];
|
||||
double l_6x3[6 * 3], b3[3] = {0};
|
||||
CvMat L_6x3 = cvMat(6, 3, CV_64F, l_6x3);
|
||||
CvMat B3 = cvMat(3, 1, CV_64F, b3);
|
||||
|
||||
@ -396,7 +396,7 @@ void epnp::find_betas_approx_2(const CvMat * L_6x10, const CvMat * Rho,
|
||||
void epnp::find_betas_approx_3(const CvMat * L_6x10, const CvMat * Rho,
|
||||
double * betas)
|
||||
{
|
||||
double l_6x5[6 * 5], b5[5];
|
||||
double l_6x5[6 * 5], b5[5] = {0};
|
||||
CvMat L_6x5 = cvMat(6, 5, CV_64F, l_6x5);
|
||||
CvMat B5 = cvMat(5, 1, CV_64F, b5);
|
||||
|
||||
@ -506,7 +506,7 @@ void epnp::gauss_newton(const CvMat * L_6x10, const CvMat * Rho, double betas[4]
|
||||
{
|
||||
const int iterations_number = 5;
|
||||
|
||||
double a[6*4], b[6], x[4];
|
||||
double a[6*4], b[6], x[4] = {0};
|
||||
CvMat A = cvMat(6, 4, CV_64F, a);
|
||||
CvMat B = cvMat(6, 1, CV_64F, b);
|
||||
CvMat X = cvMat(4, 1, CV_64F, x);
|
||||
|
@ -423,7 +423,7 @@ namespace cv
|
||||
|
||||
static int run7Point( const Mat& _m1, const Mat& _m2, Mat& _fmatrix )
|
||||
{
|
||||
double a[7*9], w[7], u[9*9], v[9*9], c[4], r[3];
|
||||
double a[7*9], w[7], u[9*9], v[9*9], c[4], r[3] = {0};
|
||||
double* f1, *f2;
|
||||
double t0, t1, t2;
|
||||
Mat A( 7, 9, CV_64F, a );
|
||||
@ -766,7 +766,7 @@ void cv::computeCorrespondEpilines( InputArray _points, int whichImage,
|
||||
{
|
||||
CV_INSTRUMENT_REGION()
|
||||
|
||||
double f[9];
|
||||
double f[9] = {0};
|
||||
Mat tempF(3, 3, CV_64F, f);
|
||||
Mat points = _points.getMat(), F = _Fmat.getMat();
|
||||
|
||||
|
@ -556,7 +556,55 @@ unsigned rhoHest(Ptr<RHO_HEST> p, /* Homography estimation context. */
|
||||
*/
|
||||
|
||||
RHO_HEST_REFC::RHO_HEST_REFC() : initialized(0){
|
||||
arg.src = 0;
|
||||
arg.dst = 0;
|
||||
arg.inl = 0;
|
||||
arg.N = 0;
|
||||
arg.maxD = 0;
|
||||
arg.maxI = 0;
|
||||
arg.rConvg = 0;
|
||||
arg.cfd = 0;
|
||||
arg.minInl = 0;
|
||||
arg.beta = 0;
|
||||
arg.flags = 0;
|
||||
arg.guessH = 0;
|
||||
arg.finalH = 0;
|
||||
|
||||
ctrl.i = 0;
|
||||
ctrl.phNum = 0;
|
||||
ctrl.phEndI = 0;
|
||||
ctrl.phEndFpI = 0;
|
||||
ctrl.phMax = 0;
|
||||
ctrl.phNumInl = 0;
|
||||
ctrl.numModels = 0;
|
||||
ctrl.smpl = 0;
|
||||
|
||||
curr.pkdPts = 0;
|
||||
curr.H = 0;
|
||||
curr.inl = 0;
|
||||
curr.numInl = 0;
|
||||
|
||||
best.H = 0;
|
||||
best.inl = 0;
|
||||
best.numInl = 0;
|
||||
|
||||
nr.size = 0;
|
||||
nr.beta = 0;
|
||||
|
||||
eval.t_M = 0;
|
||||
eval.m_S = 0;
|
||||
eval.epsilon = 0;
|
||||
eval.delta = 0;
|
||||
eval.A = 0;
|
||||
eval.Ntested = 0;
|
||||
eval.Ntestedtotal = 0;
|
||||
eval.good = 0;
|
||||
eval.lambdaAccept = 0;
|
||||
eval.lambdaReject = 0;
|
||||
|
||||
lm.JtJ = 0;
|
||||
lm.tmp1 = 0;
|
||||
lm.Jte = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -175,7 +175,7 @@ void upnp::estimate_R_and_t(double R[3][3], double t[3])
|
||||
pw0[j] /= number_of_correspondences;
|
||||
}
|
||||
|
||||
double abt[3 * 3], abt_d[3], abt_u[3 * 3], abt_v[3 * 3];
|
||||
double abt[3 * 3] = {0}, abt_d[3], abt_u[3 * 3], abt_v[3 * 3];
|
||||
Mat ABt = Mat(3, 3, CV_64F, abt);
|
||||
Mat ABt_D = Mat(3, 1, CV_64F, abt_d);
|
||||
Mat ABt_U = Mat(3, 3, CV_64F, abt_u);
|
||||
@ -575,7 +575,7 @@ void upnp::gauss_newton(const Mat * L_6x12, const Mat * Rho, double betas[4], do
|
||||
{
|
||||
const int iterations_number = 50;
|
||||
|
||||
double a[6*4], b[6], x[4];
|
||||
double a[6*4], b[6], x[4] = {0};
|
||||
Mat * A = new Mat(6, 4, CV_64F, a);
|
||||
Mat * B = new Mat(6, 1, CV_64F, b);
|
||||
Mat * X = new Mat(4, 1, CV_64F, x);
|
||||
|
@ -63,7 +63,7 @@ struct v_uint8x16
|
||||
typedef uchar lane_type;
|
||||
enum { nlanes = 16 };
|
||||
|
||||
v_uint8x16() {}
|
||||
v_uint8x16() : val(_mm_setzero_si128()) {}
|
||||
explicit v_uint8x16(__m128i v) : val(v) {}
|
||||
v_uint8x16(uchar v0, uchar v1, uchar v2, uchar v3, uchar v4, uchar v5, uchar v6, uchar v7,
|
||||
uchar v8, uchar v9, uchar v10, uchar v11, uchar v12, uchar v13, uchar v14, uchar v15)
|
||||
@ -86,7 +86,7 @@ struct v_int8x16
|
||||
typedef schar lane_type;
|
||||
enum { nlanes = 16 };
|
||||
|
||||
v_int8x16() {}
|
||||
v_int8x16() : val(_mm_setzero_si128()) {}
|
||||
explicit v_int8x16(__m128i v) : val(v) {}
|
||||
v_int8x16(schar v0, schar v1, schar v2, schar v3, schar v4, schar v5, schar v6, schar v7,
|
||||
schar v8, schar v9, schar v10, schar v11, schar v12, schar v13, schar v14, schar v15)
|
||||
@ -109,7 +109,7 @@ struct v_uint16x8
|
||||
typedef ushort lane_type;
|
||||
enum { nlanes = 8 };
|
||||
|
||||
v_uint16x8() {}
|
||||
v_uint16x8() : val(_mm_setzero_si128()) {}
|
||||
explicit v_uint16x8(__m128i v) : val(v) {}
|
||||
v_uint16x8(ushort v0, ushort v1, ushort v2, ushort v3, ushort v4, ushort v5, ushort v6, ushort v7)
|
||||
{
|
||||
@ -129,7 +129,7 @@ struct v_int16x8
|
||||
typedef short lane_type;
|
||||
enum { nlanes = 8 };
|
||||
|
||||
v_int16x8() {}
|
||||
v_int16x8() : val(_mm_setzero_si128()) {}
|
||||
explicit v_int16x8(__m128i v) : val(v) {}
|
||||
v_int16x8(short v0, short v1, short v2, short v3, short v4, short v5, short v6, short v7)
|
||||
{
|
||||
@ -148,7 +148,7 @@ struct v_uint32x4
|
||||
typedef unsigned lane_type;
|
||||
enum { nlanes = 4 };
|
||||
|
||||
v_uint32x4() {}
|
||||
v_uint32x4() : val(_mm_setzero_si128()) {}
|
||||
explicit v_uint32x4(__m128i v) : val(v) {}
|
||||
v_uint32x4(unsigned v0, unsigned v1, unsigned v2, unsigned v3)
|
||||
{
|
||||
@ -166,7 +166,7 @@ struct v_int32x4
|
||||
typedef int lane_type;
|
||||
enum { nlanes = 4 };
|
||||
|
||||
v_int32x4() {}
|
||||
v_int32x4() : val(_mm_setzero_si128()) {}
|
||||
explicit v_int32x4(__m128i v) : val(v) {}
|
||||
v_int32x4(int v0, int v1, int v2, int v3)
|
||||
{
|
||||
@ -184,7 +184,7 @@ struct v_float32x4
|
||||
typedef float lane_type;
|
||||
enum { nlanes = 4 };
|
||||
|
||||
v_float32x4() {}
|
||||
v_float32x4() : val(_mm_setzero_ps()) {}
|
||||
explicit v_float32x4(__m128 v) : val(v) {}
|
||||
v_float32x4(float v0, float v1, float v2, float v3)
|
||||
{
|
||||
@ -202,7 +202,7 @@ struct v_uint64x2
|
||||
typedef uint64 lane_type;
|
||||
enum { nlanes = 2 };
|
||||
|
||||
v_uint64x2() {}
|
||||
v_uint64x2() : val(_mm_setzero_si128()) {}
|
||||
explicit v_uint64x2(__m128i v) : val(v) {}
|
||||
v_uint64x2(uint64 v0, uint64 v1)
|
||||
{
|
||||
@ -222,7 +222,7 @@ struct v_int64x2
|
||||
typedef int64 lane_type;
|
||||
enum { nlanes = 2 };
|
||||
|
||||
v_int64x2() {}
|
||||
v_int64x2() : val(_mm_setzero_si128()) {}
|
||||
explicit v_int64x2(__m128i v) : val(v) {}
|
||||
v_int64x2(int64 v0, int64 v1)
|
||||
{
|
||||
@ -242,7 +242,7 @@ struct v_float64x2
|
||||
typedef double lane_type;
|
||||
enum { nlanes = 2 };
|
||||
|
||||
v_float64x2() {}
|
||||
v_float64x2() : val(_mm_setzero_pd()) {}
|
||||
explicit v_float64x2(__m128d v) : val(v) {}
|
||||
v_float64x2(double v0, double v1)
|
||||
{
|
||||
@ -261,7 +261,7 @@ struct v_float16x4
|
||||
typedef short lane_type;
|
||||
enum { nlanes = 4 };
|
||||
|
||||
v_float16x4() {}
|
||||
v_float16x4() : val(_mm_setzero_si128()) {}
|
||||
explicit v_float16x4(__m128i v) : val(v) {}
|
||||
v_float16x4(short v0, short v1, short v2, short v3)
|
||||
{
|
||||
|
@ -397,13 +397,13 @@ inline _InputOutputArray::_InputOutputArray(const cuda::HostMem& cuda_mem)
|
||||
inline
|
||||
Mat::Mat()
|
||||
: flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0),
|
||||
datalimit(0), allocator(0), u(0), size(&rows)
|
||||
datalimit(0), allocator(0), u(0), size(&rows), step(0)
|
||||
{}
|
||||
|
||||
inline
|
||||
Mat::Mat(int _rows, int _cols, int _type)
|
||||
: flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0),
|
||||
datalimit(0), allocator(0), u(0), size(&rows)
|
||||
datalimit(0), allocator(0), u(0), size(&rows), step(0)
|
||||
{
|
||||
create(_rows, _cols, _type);
|
||||
}
|
||||
@ -411,7 +411,7 @@ Mat::Mat(int _rows, int _cols, int _type)
|
||||
inline
|
||||
Mat::Mat(int _rows, int _cols, int _type, const Scalar& _s)
|
||||
: flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0),
|
||||
datalimit(0), allocator(0), u(0), size(&rows)
|
||||
datalimit(0), allocator(0), u(0), size(&rows), step(0)
|
||||
{
|
||||
create(_rows, _cols, _type);
|
||||
*this = _s;
|
||||
@ -420,7 +420,7 @@ Mat::Mat(int _rows, int _cols, int _type, const Scalar& _s)
|
||||
inline
|
||||
Mat::Mat(Size _sz, int _type)
|
||||
: flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0),
|
||||
datalimit(0), allocator(0), u(0), size(&rows)
|
||||
datalimit(0), allocator(0), u(0), size(&rows), step(0)
|
||||
{
|
||||
create( _sz.height, _sz.width, _type );
|
||||
}
|
||||
@ -428,7 +428,7 @@ Mat::Mat(Size _sz, int _type)
|
||||
inline
|
||||
Mat::Mat(Size _sz, int _type, const Scalar& _s)
|
||||
: flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0),
|
||||
datalimit(0), allocator(0), u(0), size(&rows)
|
||||
datalimit(0), allocator(0), u(0), size(&rows), step(0)
|
||||
{
|
||||
create(_sz.height, _sz.width, _type);
|
||||
*this = _s;
|
||||
@ -437,7 +437,7 @@ Mat::Mat(Size _sz, int _type, const Scalar& _s)
|
||||
inline
|
||||
Mat::Mat(int _dims, const int* _sz, int _type)
|
||||
: flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0),
|
||||
datalimit(0), allocator(0), u(0), size(&rows)
|
||||
datalimit(0), allocator(0), u(0), size(&rows), step(0)
|
||||
{
|
||||
create(_dims, _sz, _type);
|
||||
}
|
||||
@ -445,7 +445,7 @@ Mat::Mat(int _dims, const int* _sz, int _type)
|
||||
inline
|
||||
Mat::Mat(int _dims, const int* _sz, int _type, const Scalar& _s)
|
||||
: flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0),
|
||||
datalimit(0), allocator(0), u(0), size(&rows)
|
||||
datalimit(0), allocator(0), u(0), size(&rows), step(0)
|
||||
{
|
||||
create(_dims, _sz, _type);
|
||||
*this = _s;
|
||||
@ -454,7 +454,7 @@ Mat::Mat(int _dims, const int* _sz, int _type, const Scalar& _s)
|
||||
inline
|
||||
Mat::Mat(const std::vector<int>& _sz, int _type)
|
||||
: flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0),
|
||||
datalimit(0), allocator(0), u(0), size(&rows)
|
||||
datalimit(0), allocator(0), u(0), size(&rows), step(0)
|
||||
{
|
||||
create(_sz, _type);
|
||||
}
|
||||
@ -462,7 +462,7 @@ Mat::Mat(const std::vector<int>& _sz, int _type)
|
||||
inline
|
||||
Mat::Mat(const std::vector<int>& _sz, int _type, const Scalar& _s)
|
||||
: flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0),
|
||||
datalimit(0), allocator(0), u(0), size(&rows)
|
||||
datalimit(0), allocator(0), u(0), size(&rows), step(0)
|
||||
{
|
||||
create(_sz, _type);
|
||||
*this = _s;
|
||||
@ -472,7 +472,7 @@ inline
|
||||
Mat::Mat(const Mat& m)
|
||||
: flags(m.flags), dims(m.dims), rows(m.rows), cols(m.cols), data(m.data),
|
||||
datastart(m.datastart), dataend(m.dataend), datalimit(m.datalimit), allocator(m.allocator),
|
||||
u(m.u), size(&rows)
|
||||
u(m.u), size(&rows), step(0)
|
||||
{
|
||||
if( u )
|
||||
CV_XADD(&u->refcount, 1);
|
||||
@ -556,7 +556,7 @@ Mat::Mat(Size _sz, int _type, void* _data, size_t _step)
|
||||
template<typename _Tp> inline
|
||||
Mat::Mat(const std::vector<_Tp>& vec, bool copyData)
|
||||
: flags(MAGIC_VAL | DataType<_Tp>::type | CV_MAT_CONT_FLAG), dims(2), rows((int)vec.size()),
|
||||
cols(1), data(0), datastart(0), dataend(0), allocator(0), u(0), size(&rows)
|
||||
cols(1), data(0), datastart(0), dataend(0), datalimit(0), allocator(0), u(0), size(&rows), step(0)
|
||||
{
|
||||
if(vec.empty())
|
||||
return;
|
||||
@ -574,7 +574,7 @@ Mat::Mat(const std::vector<_Tp>& vec, bool copyData)
|
||||
template<typename _Tp, std::size_t _Nm> inline
|
||||
Mat::Mat(const std::array<_Tp, _Nm>& arr, bool copyData)
|
||||
: flags(MAGIC_VAL | DataType<_Tp>::type | CV_MAT_CONT_FLAG), dims(2), rows((int)arr.size()),
|
||||
cols(1), data(0), datastart(0), dataend(0), allocator(0), u(0), size(&rows)
|
||||
cols(1), data(0), datastart(0), dataend(0), datalimit(0), allocator(0), u(0), size(&rows), step(0)
|
||||
{
|
||||
if(arr.empty())
|
||||
return;
|
||||
@ -592,7 +592,7 @@ Mat::Mat(const std::array<_Tp, _Nm>& arr, bool copyData)
|
||||
template<typename _Tp, int n> inline
|
||||
Mat::Mat(const Vec<_Tp, n>& vec, bool copyData)
|
||||
: flags(MAGIC_VAL | DataType<_Tp>::type | CV_MAT_CONT_FLAG), dims(2), rows(n), cols(1), data(0),
|
||||
datastart(0), dataend(0), allocator(0), u(0), size(&rows)
|
||||
datastart(0), dataend(0), datalimit(0), allocator(0), u(0), size(&rows), step(0)
|
||||
{
|
||||
if( !copyData )
|
||||
{
|
||||
@ -608,7 +608,7 @@ Mat::Mat(const Vec<_Tp, n>& vec, bool copyData)
|
||||
template<typename _Tp, int m, int n> inline
|
||||
Mat::Mat(const Matx<_Tp,m,n>& M, bool copyData)
|
||||
: flags(MAGIC_VAL | DataType<_Tp>::type | CV_MAT_CONT_FLAG), dims(2), rows(m), cols(n), data(0),
|
||||
datastart(0), dataend(0), allocator(0), u(0), size(&rows)
|
||||
datastart(0), dataend(0), datalimit(0), allocator(0), u(0), size(&rows), step(0)
|
||||
{
|
||||
if( !copyData )
|
||||
{
|
||||
@ -624,7 +624,7 @@ Mat::Mat(const Matx<_Tp,m,n>& M, bool copyData)
|
||||
template<typename _Tp> inline
|
||||
Mat::Mat(const Point_<_Tp>& pt, bool copyData)
|
||||
: flags(MAGIC_VAL | DataType<_Tp>::type | CV_MAT_CONT_FLAG), dims(2), rows(2), cols(1), data(0),
|
||||
datastart(0), dataend(0), allocator(0), u(0), size(&rows)
|
||||
datastart(0), dataend(0), datalimit(0), allocator(0), u(0), size(&rows), step(0)
|
||||
{
|
||||
if( !copyData )
|
||||
{
|
||||
@ -643,7 +643,7 @@ Mat::Mat(const Point_<_Tp>& pt, bool copyData)
|
||||
template<typename _Tp> inline
|
||||
Mat::Mat(const Point3_<_Tp>& pt, bool copyData)
|
||||
: flags(MAGIC_VAL | DataType<_Tp>::type | CV_MAT_CONT_FLAG), dims(2), rows(3), cols(1), data(0),
|
||||
datastart(0), dataend(0), allocator(0), u(0), size(&rows)
|
||||
datastart(0), dataend(0), datalimit(0), allocator(0), u(0), size(&rows), step(0)
|
||||
{
|
||||
if( !copyData )
|
||||
{
|
||||
|
@ -121,7 +121,7 @@ public:
|
||||
struct CV_EXPORTS softdouble
|
||||
{
|
||||
public:
|
||||
softdouble() { }
|
||||
softdouble() : v(0) { }
|
||||
softdouble( const softdouble& c) { v = c.v; }
|
||||
softdouble& operator=( const softdouble& c )
|
||||
{
|
||||
|
@ -284,7 +284,7 @@ void Mat::copyTo( OutputArray _dst ) const
|
||||
_dst.create( dims, size.p, type() );
|
||||
UMat dst = _dst.getUMat();
|
||||
|
||||
size_t i, sz[CV_MAX_DIM], dstofs[CV_MAX_DIM], esz = elemSize();
|
||||
size_t i, sz[CV_MAX_DIM] = {0}, dstofs[CV_MAX_DIM], esz = elemSize();
|
||||
for( i = 0; i < (size_t)dims; i++ )
|
||||
sz[i] = size.p[i];
|
||||
sz[dims-1] *= esz;
|
||||
|
@ -883,7 +883,7 @@ private:
|
||||
|
||||
public:
|
||||
EigenvalueDecomposition()
|
||||
: n(0) { }
|
||||
: n(0), cdivr(0), cdivi(0), d(0), e(0), ort(0), V(0), H(0) {}
|
||||
|
||||
// Initializes & computes the Eigenvalue Decomposition for a general matrix
|
||||
// given in src. This function is a port of the EigenvalueSolver in JAMA,
|
||||
|
@ -112,7 +112,7 @@ class ForThread
|
||||
{
|
||||
public:
|
||||
|
||||
ForThread(): m_task_start(false), m_parent(0), m_state(eFTNotStarted), m_id(0)
|
||||
ForThread(): m_posix_thread(0), m_task_start(false), m_parent(0), m_state(eFTNotStarted), m_id(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -824,7 +824,7 @@ void UMat::copyTo(OutputArray _dst) const
|
||||
return;
|
||||
}
|
||||
|
||||
size_t i, sz[CV_MAX_DIM], srcofs[CV_MAX_DIM], dstofs[CV_MAX_DIM], esz = elemSize();
|
||||
size_t i, sz[CV_MAX_DIM] = {0}, srcofs[CV_MAX_DIM], dstofs[CV_MAX_DIM], esz = elemSize();
|
||||
for( i = 0; i < (size_t)dims; i++ )
|
||||
sz[i] = size.p[i];
|
||||
sz[dims-1] *= esz;
|
||||
|
@ -703,7 +703,6 @@ BRISK_Impl::computeDescriptorsAndOrOrientation(InputArray _image, InputArray _ma
|
||||
{
|
||||
cv::KeyPoint& kp = keypoints[k];
|
||||
const int& scale = kscales[k];
|
||||
int* pvalues = _values;
|
||||
const float& x = kp.pt.x;
|
||||
const float& y = kp.pt.y;
|
||||
|
||||
@ -712,7 +711,7 @@ BRISK_Impl::computeDescriptorsAndOrOrientation(InputArray _image, InputArray _ma
|
||||
// get the gray values in the unrotated pattern
|
||||
for (unsigned int i = 0; i < points_; i++)
|
||||
{
|
||||
*(pvalues++) = smoothedIntensity(image, _integral, x, y, scale, 0, i);
|
||||
_values[i] = smoothedIntensity(image, _integral, x, y, scale, 0, i);
|
||||
}
|
||||
|
||||
int direction0 = 0;
|
||||
@ -765,11 +764,10 @@ BRISK_Impl::computeDescriptorsAndOrOrientation(InputArray _image, InputArray _ma
|
||||
int shifter = 0;
|
||||
|
||||
//unsigned int mean=0;
|
||||
pvalues = _values;
|
||||
// get the gray values in the rotated pattern
|
||||
for (unsigned int i = 0; i < points_; i++)
|
||||
{
|
||||
*(pvalues++) = smoothedIntensity(image, _integral, x, y, scale, theta, i);
|
||||
_values[i] = smoothedIntensity(image, _integral, x, y, scale, theta, i);
|
||||
}
|
||||
|
||||
// now iterate through all the pairings
|
||||
|
@ -481,7 +481,7 @@ void cv::evaluateFeatureDetector( const Mat& img1, const Mat& img2, const Mat& H
|
||||
struct DMatchForEvaluation : public DMatch
|
||||
{
|
||||
uchar isCorrect;
|
||||
DMatchForEvaluation( const DMatch &dm ) : DMatch( dm ) {}
|
||||
DMatchForEvaluation( const DMatch &dm ) : DMatch( dm ), isCorrect(0) {}
|
||||
};
|
||||
|
||||
static inline float recall( int correctMatchCount, int correspondenceCount )
|
||||
|
@ -782,7 +782,7 @@ void AKAZEFeatures::Compute_Main_Orientation(KeyPoint& kpt, const std::vector<TE
|
||||
int ix = 0, iy = 0, idx = 0, s = 0, level = 0;
|
||||
float xf = 0.0, yf = 0.0, gweight = 0.0, ratio = 0.0;
|
||||
const int ang_size = 109;
|
||||
float resX[ang_size], resY[ang_size], Ang[ang_size];
|
||||
float resX[ang_size] = {0}, resY[ang_size] = {0}, Ang[ang_size];
|
||||
const int id[] = { 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6 };
|
||||
|
||||
// Variables for computing the dominant direction
|
||||
|
@ -97,6 +97,7 @@ public:
|
||||
blocksize = blockSize;
|
||||
remaining = 0;
|
||||
base = NULL;
|
||||
loc = NULL;
|
||||
|
||||
usedMemory = 0;
|
||||
wastedMemory = 0;
|
||||
|
@ -83,6 +83,7 @@ public:
|
||||
memory_weight_ = get_param(params, "memory_weight", 0.0f);
|
||||
sample_fraction_ = get_param(params,"sample_fraction", 0.1f);
|
||||
bestIndex_ = NULL;
|
||||
speedup_ = 0;
|
||||
}
|
||||
|
||||
AutotunedIndex(const AutotunedIndex&);
|
||||
|
@ -59,7 +59,7 @@ class DynamicBitset
|
||||
public:
|
||||
/** default constructor
|
||||
*/
|
||||
DynamicBitset()
|
||||
DynamicBitset() : size_(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -87,6 +87,7 @@ public:
|
||||
{
|
||||
size_ = dataset_.rows;
|
||||
dim_ = dataset_.cols;
|
||||
root_node_ = 0;
|
||||
int dim_param = get_param(params,"dim",-1);
|
||||
if (dim_param>0) dim_ = dim_param;
|
||||
leaf_max_size_ = get_param(params,"leaf_max_size",10);
|
||||
|
@ -146,6 +146,8 @@ public:
|
||||
*/
|
||||
LshTable()
|
||||
{
|
||||
key_size_ = 0;
|
||||
speed_level_ = kArray;
|
||||
}
|
||||
|
||||
/** Default constructor
|
||||
|
@ -303,7 +303,7 @@ public:
|
||||
|
||||
/** Default cosntructor */
|
||||
UniqueResultSet() :
|
||||
worst_distance_(std::numeric_limits<DistanceType>::max())
|
||||
is_full_(false), worst_distance_(std::numeric_limits<DistanceType>::max())
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -96,6 +96,7 @@ ImageDecoder BaseImageDecoder::newDecoder() const
|
||||
|
||||
BaseImageEncoder::BaseImageEncoder()
|
||||
{
|
||||
m_buf = 0;
|
||||
m_buf_supported = false;
|
||||
}
|
||||
|
||||
|
@ -55,6 +55,9 @@ BmpDecoder::BmpDecoder()
|
||||
m_signature = fmtSignBmp;
|
||||
m_offset = -1;
|
||||
m_buf_supported = true;
|
||||
m_origin = 0;
|
||||
m_bpp = 0;
|
||||
m_rle_code = BMP_RGB;
|
||||
}
|
||||
|
||||
|
||||
@ -191,7 +194,7 @@ bool BmpDecoder::readData( Mat& img )
|
||||
uchar* data = img.ptr();
|
||||
int step = (int)img.step;
|
||||
bool color = img.channels() > 1;
|
||||
uchar gray_palette[256];
|
||||
uchar gray_palette[256] = {0};
|
||||
bool result = false;
|
||||
int src_pitch = ((m_width*(m_bpp != 15 ? m_bpp : 16) + 7)/8 + 3) & -4;
|
||||
int nch = color ? 3 : 1;
|
||||
|
@ -81,6 +81,13 @@ ExrDecoder::ExrDecoder()
|
||||
m_signature = "\x76\x2f\x31\x01";
|
||||
m_file = 0;
|
||||
m_red = m_green = m_blue = 0;
|
||||
m_type = ((Imf::PixelType)0);
|
||||
m_iscolor = false;
|
||||
m_bit_depth = 0;
|
||||
m_isfloat = false;
|
||||
m_ischroma = false;
|
||||
m_native_depth = false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -341,7 +341,7 @@ int my_jpeg_load_dht (struct jpeg_decompress_struct *info, unsigned char *dht,
|
||||
|
||||
JHUFF_TBL **hufftbl;
|
||||
unsigned char bits[17];
|
||||
unsigned char huffval[256];
|
||||
unsigned char huffval[256] = {0};
|
||||
|
||||
while (length > 16)
|
||||
{
|
||||
|
@ -324,6 +324,9 @@ PAMDecoder::PAMDecoder()
|
||||
m_buf_supported = true;
|
||||
bit_mode = false;
|
||||
selected_fmt = CV_IMWRITE_PAM_FORMAT_NULL;
|
||||
m_maxval = 0;
|
||||
m_channels = 0;
|
||||
m_sampledepth = 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -91,6 +91,7 @@ PngDecoder::PngDecoder()
|
||||
m_f = 0;
|
||||
m_buf_supported = true;
|
||||
m_buf_pos = 0;
|
||||
m_bit_depth = 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -94,6 +94,9 @@ PxMDecoder::PxMDecoder()
|
||||
{
|
||||
m_offset = -1;
|
||||
m_buf_supported = true;
|
||||
m_bpp = 0;
|
||||
m_binary = false;
|
||||
m_maxval = 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -54,6 +54,10 @@ SunRasterDecoder::SunRasterDecoder()
|
||||
{
|
||||
m_offset = -1;
|
||||
m_signature = fmtSignSunRas;
|
||||
m_bpp = 0;
|
||||
m_encoding = RAS_STANDARD;
|
||||
m_maptype = RMT_NONE;
|
||||
m_maplength = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -157,7 +161,7 @@ bool SunRasterDecoder::readData( Mat& img )
|
||||
int color = img.channels() > 1;
|
||||
uchar* data = img.ptr();
|
||||
int step = (int)img.step;
|
||||
uchar gray_palette[256];
|
||||
uchar gray_palette[256] = {0};
|
||||
bool result = false;
|
||||
int src_pitch = ((m_width*m_bpp + 7)/8 + 1) & -2;
|
||||
int nch = color ? 3 : 1;
|
||||
|
@ -62,6 +62,7 @@ namespace cv
|
||||
WebPDecoder::WebPDecoder()
|
||||
{
|
||||
m_buf_supported = true;
|
||||
channels = 0;
|
||||
}
|
||||
|
||||
WebPDecoder::~WebPDecoder() {}
|
||||
|
@ -95,8 +95,8 @@ namespace cv{
|
||||
std::vector<Point2ui64> integrals;
|
||||
int _nextLoc;
|
||||
|
||||
CCStatsOp(){}
|
||||
CCStatsOp(OutputArray _statsv, OutputArray _centroidsv) : _mstatsv(&_statsv), _mcentroidsv(&_centroidsv){}
|
||||
CCStatsOp() : _mstatsv(0), _mcentroidsv(0), _nextLoc(0) {}
|
||||
CCStatsOp(OutputArray _statsv, OutputArray _centroidsv) : _mstatsv(&_statsv), _mcentroidsv(&_centroidsv), _nextLoc(0){}
|
||||
|
||||
inline
|
||||
void init(int nlabels){
|
||||
|
@ -178,6 +178,9 @@ LineIterator::LineIterator(const Mat& img, Point pt1, Point pt2,
|
||||
{
|
||||
ptr = img.data;
|
||||
err = plusDelta = minusDelta = plusStep = minusStep = count = 0;
|
||||
ptr0 = 0;
|
||||
step = 0;
|
||||
elemSize = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -77,6 +77,9 @@ FilterEngine::FilterEngine()
|
||||
maxWidth = 0;
|
||||
|
||||
wholeSize = Size(-1,-1);
|
||||
dx1 = 0;
|
||||
borderElemSize = 0;
|
||||
dx2 = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -87,6 +90,11 @@ FilterEngine::FilterEngine( const Ptr<BaseFilter>& _filter2D,
|
||||
int _rowBorderType, int _columnBorderType,
|
||||
const Scalar& _borderValue )
|
||||
{
|
||||
startY0 = 0;
|
||||
endY = 0;
|
||||
dstY = 0;
|
||||
dx2 = 0;
|
||||
rowCount = 0;
|
||||
init(_filter2D, _rowFilter, _columnFilter, _srcType, _dstType, _bufType,
|
||||
_rowBorderType, _columnBorderType, _borderValue);
|
||||
}
|
||||
@ -566,7 +574,7 @@ struct RowVec_8u32s
|
||||
|
||||
struct SymmRowSmallVec_8u32s
|
||||
{
|
||||
SymmRowSmallVec_8u32s() { smallValues = false; }
|
||||
SymmRowSmallVec_8u32s() { smallValues = false; symmetryType = 0; }
|
||||
SymmRowSmallVec_8u32s( const Mat& _kernel, int _symmetryType )
|
||||
{
|
||||
kernel = _kernel;
|
||||
@ -870,7 +878,7 @@ struct SymmRowSmallVec_8u32s
|
||||
|
||||
struct SymmColumnVec_32s8u
|
||||
{
|
||||
SymmColumnVec_32s8u() { symmetryType=0; }
|
||||
SymmColumnVec_32s8u() { symmetryType=0; delta = 0; }
|
||||
SymmColumnVec_32s8u(const Mat& _kernel, int _symmetryType, int _bits, double _delta)
|
||||
{
|
||||
symmetryType = _symmetryType;
|
||||
@ -1018,7 +1026,7 @@ struct SymmColumnVec_32s8u
|
||||
|
||||
struct SymmColumnSmallVec_32s16s
|
||||
{
|
||||
SymmColumnSmallVec_32s16s() { symmetryType=0; }
|
||||
SymmColumnSmallVec_32s16s() { symmetryType=0; delta = 0; }
|
||||
SymmColumnSmallVec_32s16s(const Mat& _kernel, int _symmetryType, int _bits, double _delta)
|
||||
{
|
||||
symmetryType = _symmetryType;
|
||||
@ -1152,7 +1160,7 @@ struct SymmColumnSmallVec_32s16s
|
||||
|
||||
struct RowVec_16s32f
|
||||
{
|
||||
RowVec_16s32f() {}
|
||||
RowVec_16s32f() { sse2_supported = false; }
|
||||
RowVec_16s32f( const Mat& _kernel )
|
||||
{
|
||||
kernel = _kernel;
|
||||
@ -1199,7 +1207,7 @@ struct RowVec_16s32f
|
||||
|
||||
struct SymmColumnVec_32f16s
|
||||
{
|
||||
SymmColumnVec_32f16s() { symmetryType=0; }
|
||||
SymmColumnVec_32f16s() { symmetryType=0; delta = 0; sse2_supported = false; }
|
||||
SymmColumnVec_32f16s(const Mat& _kernel, int _symmetryType, int, double _delta)
|
||||
{
|
||||
symmetryType = _symmetryType;
|
||||
@ -1355,6 +1363,9 @@ struct RowVec_32f
|
||||
{
|
||||
haveSSE = checkHardwareSupport(CV_CPU_SSE);
|
||||
haveAVX2 = checkHardwareSupport(CV_CPU_AVX2);
|
||||
#if defined USE_IPP_SEP_FILTERS
|
||||
bufsz = -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
RowVec_32f( const Mat& _kernel )
|
||||
@ -1478,7 +1489,7 @@ private:
|
||||
|
||||
struct SymmRowSmallVec_32f
|
||||
{
|
||||
SymmRowSmallVec_32f() {}
|
||||
SymmRowSmallVec_32f() { symmetryType = 0; }
|
||||
SymmRowSmallVec_32f( const Mat& _kernel, int _symmetryType )
|
||||
{
|
||||
kernel = _kernel;
|
||||
@ -1675,6 +1686,7 @@ struct SymmColumnVec_32f
|
||||
symmetryType=0;
|
||||
haveSSE = checkHardwareSupport(CV_CPU_SSE);
|
||||
haveAVX2 = checkHardwareSupport(CV_CPU_AVX2);
|
||||
delta = 0;
|
||||
}
|
||||
SymmColumnVec_32f(const Mat& _kernel, int _symmetryType, int, double _delta)
|
||||
{
|
||||
@ -1898,7 +1910,7 @@ if ( haveAVX2 )
|
||||
|
||||
struct SymmColumnSmallVec_32f
|
||||
{
|
||||
SymmColumnSmallVec_32f() { symmetryType=0; }
|
||||
SymmColumnSmallVec_32f() { symmetryType=0; delta = 0; }
|
||||
SymmColumnSmallVec_32f(const Mat& _kernel, int _symmetryType, int, double _delta)
|
||||
{
|
||||
symmetryType = _symmetryType;
|
||||
@ -2030,7 +2042,7 @@ struct SymmColumnSmallVec_32f
|
||||
|
||||
struct FilterVec_8u
|
||||
{
|
||||
FilterVec_8u() {}
|
||||
FilterVec_8u() { delta = 0; _nz = 0; }
|
||||
FilterVec_8u(const Mat& _kernel, int _bits, double _delta)
|
||||
{
|
||||
Mat kernel;
|
||||
@ -2113,7 +2125,7 @@ struct FilterVec_8u
|
||||
|
||||
struct FilterVec_8u16s
|
||||
{
|
||||
FilterVec_8u16s() {}
|
||||
FilterVec_8u16s() { delta = 0; _nz = 0; }
|
||||
FilterVec_8u16s(const Mat& _kernel, int _bits, double _delta)
|
||||
{
|
||||
Mat kernel;
|
||||
@ -2196,7 +2208,7 @@ struct FilterVec_8u16s
|
||||
|
||||
struct FilterVec_32f
|
||||
{
|
||||
FilterVec_32f() {}
|
||||
FilterVec_32f() { delta = 0; _nz = 0; }
|
||||
FilterVec_32f(const Mat& _kernel, int, double _delta)
|
||||
{
|
||||
delta = (float)_delta;
|
||||
|
@ -104,6 +104,7 @@ GMM::GMM( Mat& _model )
|
||||
for( int ci = 0; ci < componentsCount; ci++ )
|
||||
if( coefs[ci] > 0 )
|
||||
calcInverseCovAndDeterm( ci );
|
||||
totalSampleCount = 0;
|
||||
}
|
||||
|
||||
double GMM::operator()( const Vec3d color ) const
|
||||
|
@ -1219,16 +1219,15 @@ public:
|
||||
m_type = ippiGetDataType(src.type());
|
||||
m_levelsNum = histSize+1;
|
||||
ippiHistogram_C1 = getIppiHistogramFunction_C1(src.type());
|
||||
m_fullRoi = ippiSize(src.size());
|
||||
m_bufferSize = 0;
|
||||
m_specSize = 0;
|
||||
if(!ippiHistogram_C1)
|
||||
{
|
||||
ok = false;
|
||||
return;
|
||||
}
|
||||
|
||||
m_fullRoi = ippiSize(src.size());
|
||||
m_bufferSize = 0;
|
||||
m_specSize = 0;
|
||||
|
||||
if(ippiHistogramGetBufferSize(m_type, m_fullRoi, &m_levelsNum, 1, 1, &m_specSize, &m_bufferSize) < 0)
|
||||
{
|
||||
ok = false;
|
||||
@ -3530,6 +3529,8 @@ cvCalcArrBackProjectPatch( CvArr** arr, CvArr* dst, CvSize patch_size, CvHistogr
|
||||
CV_Error( CV_StsBadSize, "The patch width and height must be positive" );
|
||||
|
||||
dims = cvGetDims( hist->bins );
|
||||
if (dims < 1)
|
||||
CV_Error( CV_StsOutOfRange, "Invalid number of dimensions");
|
||||
cvNormalizeHist( hist, norm_factor );
|
||||
|
||||
for( i = 0; i < dims; i++ )
|
||||
|
@ -6171,7 +6171,7 @@ static bool ocl_warpTransform_cols4(InputArray _src, OutputArray _dst, InputArra
|
||||
_dst.create( dsize.area() == 0 ? src.size() : dsize, src.type() );
|
||||
UMat dst = _dst.getUMat();
|
||||
|
||||
float M[9];
|
||||
float M[9] = {0};
|
||||
int matRows = (op_type == OCL_OP_AFFINE ? 2 : 3);
|
||||
Mat matM(matRows, 3, CV_32F, M), M1 = _M0.getMat();
|
||||
CV_Assert( (M1.type() == CV_32F || M1.type() == CV_64F) && M1.rows == matRows && M1.cols == 3 );
|
||||
@ -6269,7 +6269,7 @@ static bool ocl_warpTransform(InputArray _src, OutputArray _dst, InputArray _M0,
|
||||
_dst.create( dsize.area() == 0 ? src.size() : dsize, src.type() );
|
||||
UMat dst = _dst.getUMat();
|
||||
|
||||
double M[9];
|
||||
double M[9] = {0};
|
||||
int matRows = (op_type == OCL_OP_AFFINE ? 2 : 3);
|
||||
Mat matM(matRows, 3, CV_64F, M), M1 = _M0.getMat();
|
||||
CV_Assert( (M1.type() == CV_32F || M1.type() == CV_64F) &&
|
||||
@ -6364,7 +6364,7 @@ void cv::warpAffine( InputArray _src, OutputArray _dst,
|
||||
if( dst.data == src.data )
|
||||
src = src.clone();
|
||||
|
||||
double M[6];
|
||||
double M[6] = {0};
|
||||
Mat matM(2, 3, CV_64F, M);
|
||||
if( interpolation == INTER_AREA )
|
||||
interpolation = INTER_LINEAR;
|
||||
|
@ -398,8 +398,9 @@ CV_EXPORTS Ptr<LineSegmentDetector> createLineSegmentDetector(
|
||||
|
||||
LineSegmentDetectorImpl::LineSegmentDetectorImpl(int _refine, double _scale, double _sigma_scale, double _quant,
|
||||
double _ang_th, double _log_eps, double _density_th, int _n_bins)
|
||||
:SCALE(_scale), doRefine(_refine), SIGMA_SCALE(_sigma_scale), QUANT(_quant),
|
||||
ANG_TH(_ang_th), LOG_EPS(_log_eps), DENSITY_TH(_density_th), N_BINS(_n_bins)
|
||||
: img_width(0), img_height(0), LOG_NT(0), w_needed(false), p_needed(false), n_needed(false),
|
||||
SCALE(_scale), doRefine(_refine), SIGMA_SCALE(_sigma_scale), QUANT(_quant),
|
||||
ANG_TH(_ang_th), LOG_EPS(_log_eps), DENSITY_TH(_density_th), N_BINS(_n_bins)
|
||||
{
|
||||
CV_Assert(_scale > 0 && _sigma_scale > 0 && _quant >= 0 &&
|
||||
_ang_th > 0 && _ang_th < 180 && _density_th >= 0 && _density_th < 1 &&
|
||||
|
@ -441,7 +441,7 @@ cvGetQuadrangleSubPix( const void* srcarr, void* dstarr, const CvMat* mat )
|
||||
CV_Assert( src.channels() == dst.channels() );
|
||||
|
||||
cv::Size win_size = dst.size();
|
||||
double matrix[6];
|
||||
double matrix[6] = {0};
|
||||
cv::Mat M(2, 3, CV_64F, matrix);
|
||||
m.convertTo(M, CV_64F);
|
||||
double dx = (win_size.width - 1)*0.5;
|
||||
|
@ -359,7 +359,7 @@ cv::RotatedRect cv::fitEllipse( InputArray _points )
|
||||
|
||||
// New fitellipse algorithm, contributed by Dr. Daniel Weiss
|
||||
Point2f c(0,0);
|
||||
double gfp[5], rp[5], t;
|
||||
double gfp[5] = {0}, rp[5] = {0}, t;
|
||||
const double min_eps = 1e-8;
|
||||
bool is_float = depth == CV_32F;
|
||||
const Point* ptsi = points.ptr<Point>();
|
||||
|
@ -203,6 +203,7 @@ public:
|
||||
results = &_results;
|
||||
results_prob = !_results_prob.empty() ? &_results_prob : 0;
|
||||
rawOutput = _rawOutput;
|
||||
value = 0;
|
||||
}
|
||||
|
||||
const Mat* c;
|
||||
|
@ -81,6 +81,7 @@ public:
|
||||
params.use1SERule = false;
|
||||
params.truncatePrunedTree = false;
|
||||
params.priors = Mat();
|
||||
oobError = 0;
|
||||
}
|
||||
virtual ~DTreesImplForRTrees() {}
|
||||
|
||||
|
@ -115,7 +115,7 @@ DTreesImpl::WorkData::WorkData(const Ptr<TrainData>& _data)
|
||||
maxSubsetSize = 0;
|
||||
}
|
||||
|
||||
DTreesImpl::DTreesImpl() {}
|
||||
DTreesImpl::DTreesImpl() : _isClassifier(false) {}
|
||||
DTreesImpl::~DTreesImpl() {}
|
||||
void DTreesImpl::clear()
|
||||
{
|
||||
|
@ -569,6 +569,9 @@ HaarEvaluator::HaarEvaluator()
|
||||
lbufSize = Size(0, 0);
|
||||
nchannels = 0;
|
||||
tofs = 0;
|
||||
sqofs = 0;
|
||||
varianceNormFactor = 0;
|
||||
hasTiltedFeatures = false;
|
||||
}
|
||||
|
||||
HaarEvaluator::~HaarEvaluator()
|
||||
@ -770,6 +773,8 @@ LBPEvaluator::LBPEvaluator()
|
||||
features = makePtr<std::vector<Feature> >();
|
||||
optfeatures = makePtr<std::vector<OptFeature> >();
|
||||
scaleData = makePtr<std::vector<ScaleData> >();
|
||||
optfeaturesPtr = 0;
|
||||
pwin = 0;
|
||||
}
|
||||
|
||||
LBPEvaluator::~LBPEvaluator()
|
||||
@ -885,6 +890,9 @@ Ptr<FeatureEvaluator> FeatureEvaluator::create( int featureType )
|
||||
|
||||
CascadeClassifierImpl::CascadeClassifierImpl()
|
||||
{
|
||||
#ifdef HAVE_OPENCL
|
||||
tryOpenCL = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
CascadeClassifierImpl::~CascadeClassifierImpl()
|
||||
@ -1440,7 +1448,7 @@ void CascadeClassifierImpl::detectMultiScale( InputArray _image, std::vector<Rec
|
||||
|
||||
CascadeClassifierImpl::Data::Data()
|
||||
{
|
||||
stageType = featureType = ncategories = maxNodesPerTree = 0;
|
||||
stageType = featureType = ncategories = maxNodesPerTree = minNodesPerTree = 0;
|
||||
}
|
||||
|
||||
bool CascadeClassifierImpl::Data::read(const FileNode &root)
|
||||
|
@ -184,7 +184,7 @@ protected:
|
||||
|
||||
struct Stump
|
||||
{
|
||||
Stump() { }
|
||||
Stump() : featureIdx(0), threshold(0), left(0), right(0) { }
|
||||
Stump(int _featureIdx, float _threshold, float _left, float _right)
|
||||
: featureIdx(_featureIdx), threshold(_threshold), left(_left), right(_right) {}
|
||||
|
||||
|
@ -218,6 +218,7 @@ cv::DetectionBasedTracker::SeparateDetectionWork::SeparateDetectionWork(Detectio
|
||||
|
||||
cascadeInThread = _detector;
|
||||
#ifndef USE_STD_THREADS
|
||||
second_workthread = 0;
|
||||
int res=0;
|
||||
res=pthread_mutex_init(&mutex, NULL);//TODO: should be attributes?
|
||||
if (res) {
|
||||
|
@ -53,12 +53,14 @@ public:
|
||||
{
|
||||
fullAffine = true;
|
||||
name_ = "ShapeTransformer.AFF";
|
||||
transformCost = 0;
|
||||
}
|
||||
|
||||
AffineTransformerImpl(bool _fullAffine)
|
||||
{
|
||||
fullAffine = _fullAffine;
|
||||
name_ = "ShapeTransformer.AFF";
|
||||
transformCost = 0;
|
||||
}
|
||||
|
||||
/* Destructor */
|
||||
|
@ -90,6 +90,14 @@ public:
|
||||
binsDim3 = 0;
|
||||
dimension = 0;
|
||||
nMaxIt = 500;
|
||||
|
||||
m_pLeave = 0;
|
||||
m_iEnter = 0;
|
||||
nNBV = 0;
|
||||
m_nItr = 0;
|
||||
m_iTo = 0;
|
||||
m_iFrom = 0;
|
||||
m_pEnter = 0;
|
||||
}
|
||||
|
||||
~EmdL1()
|
||||
|
@ -72,6 +72,7 @@ public:
|
||||
shapeContextWeight=1.0f;
|
||||
sigma=10.0f;
|
||||
name_ = "ShapeDistanceExtractor.SCD";
|
||||
costFlag = 0;
|
||||
}
|
||||
|
||||
/* Destructor */
|
||||
|
@ -61,6 +61,7 @@ public:
|
||||
setInnerRadius(_innerRadius);
|
||||
setOuterRadius(_outerRadius);
|
||||
setRotationInvariant(_rotationInvariant);
|
||||
meanDistance = 0;
|
||||
}
|
||||
|
||||
void extractSCD(cv::Mat& contour, cv::Mat& descriptors,
|
||||
@ -107,7 +108,7 @@ class SCDMatcher
|
||||
{
|
||||
public:
|
||||
// the full constructor
|
||||
SCDMatcher()
|
||||
SCDMatcher() : minMatchCost(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -54,6 +54,7 @@ public:
|
||||
regularizationParameter=0;
|
||||
name_ = "ShapeTransformer.TPS";
|
||||
tpsComputed=false;
|
||||
transformCost = 0;
|
||||
}
|
||||
|
||||
ThinPlateSplineShapeTransformerImpl(double _regularizationParameter)
|
||||
@ -61,6 +62,7 @@ public:
|
||||
regularizationParameter=_regularizationParameter;
|
||||
name_ = "ShapeTransformer.TPS";
|
||||
tpsComputed=false;
|
||||
transformCost = 0;
|
||||
}
|
||||
|
||||
/* Destructor */
|
||||
|
@ -149,8 +149,10 @@ protected:
|
||||
@param num_errs_per_measurement Number of error terms (components) per match
|
||||
*/
|
||||
BundleAdjusterBase(int num_params_per_cam, int num_errs_per_measurement)
|
||||
: num_params_per_cam_(num_params_per_cam),
|
||||
num_errs_per_measurement_(num_errs_per_measurement)
|
||||
: num_images_(0), total_num_matches_(0),
|
||||
num_params_per_cam_(num_params_per_cam),
|
||||
num_errs_per_measurement_(num_errs_per_measurement),
|
||||
features_(0), pairwise_matches_(0), conf_thresh_(0)
|
||||
{
|
||||
setRefinementMask(Mat::ones(3, 3, CV_8U));
|
||||
setConfThresh(1.);
|
||||
|
@ -217,6 +217,7 @@ Rect FeatherBlender::createWeightMaps(const std::vector<UMat> &masks, const std:
|
||||
|
||||
MultiBandBlender::MultiBandBlender(int try_gpu, int num_bands, int weight_type)
|
||||
{
|
||||
num_bands_ = 0;
|
||||
setNumBands(num_bands);
|
||||
|
||||
#if defined(HAVE_OPENCV_CUDAARITHM) && defined(HAVE_OPENCV_CUDAWARPING)
|
||||
|
@ -162,7 +162,7 @@ void VoronoiSeamFinder::findInPair(size_t first, size_t second, Rect roi)
|
||||
}
|
||||
|
||||
|
||||
DpSeamFinder::DpSeamFinder(CostFunction costFunc) : costFunc_(costFunc) {}
|
||||
DpSeamFinder::DpSeamFinder(CostFunction costFunc) : costFunc_(costFunc), ncomps_(0) {}
|
||||
|
||||
|
||||
void DpSeamFinder::find(const std::vector<UMat> &src, const std::vector<Point> &corners, std::vector<UMat> &masks)
|
||||
|
@ -854,6 +854,9 @@ namespace
|
||||
BTVL1::BTVL1()
|
||||
{
|
||||
temporalAreaRadius_ = 4;
|
||||
procPos_ = 0;
|
||||
outPos_ = 0;
|
||||
storePos_ = 0;
|
||||
}
|
||||
|
||||
void BTVL1::collectGarbage()
|
||||
|
@ -89,6 +89,9 @@ public:
|
||||
nShadowDetection = defaultnShadowDetection2;
|
||||
fTau = defaultfTau;// Tau - shadow threshold
|
||||
name_ = "BackgroundSubtractor.KNN";
|
||||
nLongCounter = 0;
|
||||
nMidCounter = 0;
|
||||
nShortCounter = 0;
|
||||
}
|
||||
//! the full constructor that takes the length of the history,
|
||||
// the number of gaussian mixtures, the background ratio parameter and the noise strength
|
||||
@ -113,6 +116,9 @@ public:
|
||||
nShadowDetection = defaultnShadowDetection2;
|
||||
fTau = defaultfTau;
|
||||
name_ = "BackgroundSubtractor.KNN";
|
||||
nLongCounter = 0;
|
||||
nMidCounter = 0;
|
||||
nShortCounter = 0;
|
||||
}
|
||||
//! the destructor
|
||||
~BackgroundSubtractorKNNImpl() {}
|
||||
|
@ -1451,7 +1451,7 @@ getRTMatrix( const Point2f* a, const Point2f* b,
|
||||
}
|
||||
else
|
||||
{
|
||||
double sa[4][4]={{0.}}, sb[4]={0.}, m[4];
|
||||
double sa[4][4]={{0.}}, sb[4]={0.}, m[4] = {0};
|
||||
Mat A( 4, 4, CV_64F, sa ), B( 4, 1, CV_64F, sb );
|
||||
Mat MM( 4, 1, CV_64F, m );
|
||||
|
||||
|
@ -96,6 +96,8 @@ public:
|
||||
m_end = m_start + DEFAULT_BLOCK_SIZE;
|
||||
m_is_opened = false;
|
||||
m_f = 0;
|
||||
m_current = 0;
|
||||
m_pos = 0;
|
||||
}
|
||||
|
||||
~BitStream()
|
||||
@ -591,6 +593,12 @@ public:
|
||||
{
|
||||
rawstream = false;
|
||||
nstripes = -1;
|
||||
height = 0;
|
||||
width = 0;
|
||||
moviPointer = 0;
|
||||
channels = 0;
|
||||
outfps = 0;
|
||||
quality = 0;
|
||||
}
|
||||
|
||||
MotionJpegWriter(const String& filename, double fps, Size size, bool iscolor)
|
||||
|
@ -63,7 +63,7 @@ namespace videostab
|
||||
class CV_EXPORTS FastMarchingMethod
|
||||
{
|
||||
public:
|
||||
FastMarchingMethod() : inf_(1e6f) {}
|
||||
FastMarchingMethod() : inf_(1e6f), size_(0) {}
|
||||
|
||||
/** @brief Template method that runs the Fast Marching Method.
|
||||
|
||||
|
@ -63,6 +63,11 @@ StabilizerBase::StabilizerBase()
|
||||
setTrimRatio(0);
|
||||
setCorrectionForInclusion(false);
|
||||
setBorderMode(BORDER_REPLICATE);
|
||||
curPos_ = 0;
|
||||
doDeblurring_ = false;
|
||||
doInpainting_ = false;
|
||||
processingStartTime_ = 0;
|
||||
curStabilizedPos_ = 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -85,7 +85,7 @@ namespace cv
|
||||
namespace videostab
|
||||
{
|
||||
|
||||
WobbleSuppressorBase::WobbleSuppressorBase() : motions_(0), stabilizationMotions_(0)
|
||||
WobbleSuppressorBase::WobbleSuppressorBase() : frameCount_(0), motions_(0), motions2_(0), stabilizationMotions_(0)
|
||||
{
|
||||
setMotionEstimator(makePtr<KeypointBasedMotionEstimator>(makePtr<MotionEstimatorRansacL2>(MM_HOMOGRAPHY)));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user