Merge pull request #424 from asmaloney:additional-checks

This commit is contained in:
Andrey Kamaev 2013-02-04 12:02:43 +04:00 committed by OpenCV Buildbot
commit 58c4d5f4b4

View File

@ -241,7 +241,6 @@ static void filterEllipticKeyPointsByImageSize( vector<EllipticKeyPoint>& keypoi
struct IntersectAreaCounter
{
IntersectAreaCounter() : bua(0), bna(0) {}
IntersectAreaCounter( float _dr, int _minx,
int _miny, int _maxy,
const Point2f& _diff,
@ -257,6 +256,9 @@ struct IntersectAreaCounter
void operator()( const BlockedRange& range )
{
CV_Assert( miny < maxy );
CV_Assert( dr > FLT_EPSILON );
int temp_bua = bua, temp_bna = bna;
for( int i = range.begin(); i != range.end(); i++ )
{
@ -461,7 +463,7 @@ void cv::evaluateFeatureDetector( const Mat& img1, const Mat& img2, const Mat& H
keypoints2 = _keypoints2 != 0 ? _keypoints2 : &buf2;
if( (keypoints1->empty() || keypoints2->empty()) && fdetector.empty() )
CV_Error( CV_StsBadArg, "fdetector must be no empty when keypoints1 or keypoints2 is empty" );
CV_Error( CV_StsBadArg, "fdetector must not be empty when keypoints1 or keypoints2 is empty" );
if( keypoints1->empty() )
fdetector->detect( img1, *keypoints1 );
@ -572,10 +574,10 @@ void cv::evaluateGenericDescriptorMatcher( const Mat& img1, const Mat& img2, con
correctMatches1to2Mask = _correctMatches1to2Mask != 0 ? _correctMatches1to2Mask : &buf2;
if( keypoints1.empty() )
CV_Error( CV_StsBadArg, "keypoints1 must be no empty" );
CV_Error( CV_StsBadArg, "keypoints1 must not be empty" );
if( matches1to2->empty() && dmatcher.empty() )
CV_Error( CV_StsBadArg, "dmatch must be no empty when matches1to2 is empty" );
CV_Error( CV_StsBadArg, "dmatch must not be empty when matches1to2 is empty" );
bool computeKeypoints2ByPrj = keypoints2.empty();
if( computeKeypoints2ByPrj )