提交 e6d9486a 编写于 作者: M Maksim Shabunin

Fixed several issues found by static analysis

上级 9a8e47a7
......@@ -1133,6 +1133,7 @@ CV_IMPL void cvFindExtrinsicCameraParams2( const CvMat* objectPoints,
if( cvDet(&_RR) < 0 )
cvScale( &_RRt, &_RRt, -1 );
sc = cvNorm(&_RR);
CV_Assert(fabs(sc) > DBL_EPSILON);
cvSVD( &_RR, &matW, &matU, &matV, CV_SVD_MODIFY_A + CV_SVD_U_T + CV_SVD_V_T );
cvGEMM( &matU, &matV, 1, 0, 0, &matR, CV_GEMM_A_T );
cvScale( &_tt, &_t, cvNorm(&matR)/sc );
......
......@@ -164,7 +164,9 @@ cv::Mat findHomography1D(cv::InputArray _src,cv::InputArray _dst)
Mat H = dst_T.inv()*Mat(H_, false)*src_T;
// enforce frobeniusnorm of one
double scale = 1.0/cv::norm(H);
double scale = cv::norm(H);
CV_Assert(fabs(scale) > DBL_EPSILON);
scale = 1.0 / scale;
return H*scale;
}
void polyfit(const Mat& src_x, const Mat& src_y, Mat& dst, int order)
......
......@@ -654,7 +654,7 @@ class float16_t
public:
#if CV_FP16_TYPE
float16_t() {}
float16_t() : h(0) {}
explicit float16_t(float x) { h = (__fp16)x; }
operator float() const { return (float)h; }
static float16_t fromBits(ushort w)
......@@ -681,7 +681,7 @@ protected:
__fp16 h;
#else
float16_t() {}
float16_t() : w(0) {}
explicit float16_t(float x)
{
#if CV_AVX2
......
......@@ -332,7 +332,8 @@ public:
int poolingType;
float spatialScale;
PoolingInvoker() : src(0), rois(0), dst(0), mask(0), avePoolPaddedArea(false), nstripes(0),
PoolingInvoker() : src(0), rois(0), dst(0), mask(0), pad_l(0), pad_t(0), pad_r(0), pad_b(0),
avePoolPaddedArea(false), nstripes(0),
computeMaxIdx(0), poolingType(MAX), spatialScale(0) {}
static void run(const Mat& src, const Mat& rois, Mat& dst, Mat& mask, Size kernel,
......
......@@ -79,7 +79,7 @@ PFMDecoder::~PFMDecoder()
{
}
PFMDecoder::PFMDecoder()
PFMDecoder::PFMDecoder() : m_scale_factor(0), m_swap_byte_order(false)
{
m_strm.close();
}
......
......@@ -1532,6 +1532,7 @@ icvFindContoursInInterval( const CvArr* src,
tmp_prev->link = 0;
// First line. None of runs is binded
tmp.pt.x = 0;
tmp.pt.y = 0;
CV_WRITE_SEQ_ELEM( tmp, writer );
upper_line = (CvLinkedRunPoint*)CV_GET_WRITTEN_ELEM( writer );
......
......@@ -240,6 +240,7 @@ void HOGDescriptor::computeGradient(InputArray _img, InputOutputArray _grad, Inp
CV_INSTRUMENT_REGION();
Mat img = _img.getMat();
CV_Assert(!img.empty());
CV_Assert( img.type() == CV_8U || img.type() == CV_8UC3 );
Size gradsize(img.cols + paddingTL.width + paddingBR.width,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册