mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
Fixed ~20 potential errors identified by the MS complier.
This commit is contained in:
@@ -2029,7 +2029,7 @@ void cv::fitLine( InputArray _points, OutputArray _line, int distType,
|
||||
bool is2d = points.checkVector(2) >= 0;
|
||||
|
||||
CV_Assert( (is2d || is3d) && (points.depth() == CV_32F || points.depth() == CV_32S) );
|
||||
CvMat _cpoints = points.reshape(2 + is3d);
|
||||
CvMat _cpoints = points.reshape(2 + (int)is3d);
|
||||
float line[6];
|
||||
cvFitLine(&_cpoints, distType, param, reps, aeps, &line[0]);
|
||||
|
||||
|
||||
@@ -322,8 +322,12 @@ cvPyrMeanShiftFiltering( const CvArr* srcarr, CvArr* dstarr,
|
||||
{
|
||||
const int cn = 3;
|
||||
const int MAX_LEVELS = 8;
|
||||
cv::Mat* src_pyramid = new cv::Mat[MAX_LEVELS+1];
|
||||
cv::Mat* dst_pyramid = new cv::Mat[MAX_LEVELS+1];
|
||||
|
||||
if( (unsigned)max_level > (unsigned)MAX_LEVELS )
|
||||
CV_Error( CV_StsOutOfRange, "The number of pyramid levels is too large or negative" );
|
||||
|
||||
std::vector<cv::Mat> src_pyramid(max_level+1);
|
||||
std::vector<cv::Mat> dst_pyramid(max_level+1);
|
||||
cv::Mat mask0;
|
||||
int i, j, level;
|
||||
//uchar* submask = 0;
|
||||
@@ -346,9 +350,6 @@ cvPyrMeanShiftFiltering( const CvArr* srcarr, CvArr* dstarr,
|
||||
if( src0.size() != dst0.size() )
|
||||
CV_Error( CV_StsUnmatchedSizes, "The input and output images must have the same size" );
|
||||
|
||||
if( (unsigned)max_level > (unsigned)MAX_LEVELS )
|
||||
CV_Error( CV_StsOutOfRange, "The number of pyramid levels is too large or negative" );
|
||||
|
||||
if( !(termcrit.type & CV_TERMCRIT_ITER) )
|
||||
termcrit.max_iter = 5;
|
||||
termcrit.max_iter = MAX(termcrit.max_iter,1);
|
||||
@@ -523,8 +524,6 @@ cvPyrMeanShiftFiltering( const CvArr* srcarr, CvArr* dstarr,
|
||||
}
|
||||
}
|
||||
}
|
||||
delete[] src_pyramid;
|
||||
delete[] dst_pyramid;
|
||||
}
|
||||
|
||||
void cv::pyrMeanShiftFiltering( InputArray _src, OutputArray _dst,
|
||||
|
||||
Reference in New Issue
Block a user