Move border type constants and Moments class to core module

This commit is contained in:
Andrey Kamaev
2013-04-10 15:54:14 +04:00
parent f4ae0cf19c
commit c98c246fc2
83 changed files with 541 additions and 639 deletions

View File

@@ -60,7 +60,7 @@ static inline void _drawKeypoint( Mat& img, const KeyPoint& p, const Scalar& col
int radius = cvRound(p.size/2 * draw_multiplier); // KeyPoint::size is a diameter
// draw the circles around keypoints with the keypoints size
circle( img, center, radius, color, 1, CV_AA, draw_shift_bits );
circle( img, center, radius, color, 1, LINE_AA, draw_shift_bits );
// draw orientation of the keypoint, if it is applicable
if( p.angle != -1 )
@@ -69,14 +69,14 @@ static inline void _drawKeypoint( Mat& img, const KeyPoint& p, const Scalar& col
Point orient( cvRound(cos(srcAngleRad)*radius ),
cvRound(sin(srcAngleRad)*radius )
);
line( img, center, center+orient, color, 1, CV_AA, draw_shift_bits );
line( img, center, center+orient, color, 1, LINE_AA, draw_shift_bits );
}
#if 0
else
{
// draw center with R=1
int radius = 1 * draw_multiplier;
circle( img, center, radius, color, 1, CV_AA, draw_shift_bits );
circle( img, center, radius, color, 1, LINE_AA, draw_shift_bits );
}
#endif
}
@@ -84,7 +84,7 @@ static inline void _drawKeypoint( Mat& img, const KeyPoint& p, const Scalar& col
{
// draw center with R=3
int radius = 3 * draw_multiplier;
circle( img, center, radius, color, 1, CV_AA, draw_shift_bits );
circle( img, center, radius, color, 1, LINE_AA, draw_shift_bits );
}
}
@@ -99,11 +99,11 @@ void drawKeypoints( const Mat& image, const std::vector<KeyPoint>& keypoints, Ma
}
else if( image.type() == CV_8UC1 )
{
cvtColor( image, outImage, CV_GRAY2BGR );
cvtColor( image, outImage, COLOR_GRAY2BGR );
}
else
{
CV_Error( CV_StsBadArg, "Incorrect type of input image.\n" );
CV_Error( Error::StsBadArg, "Incorrect type of input image.\n" );
}
}
@@ -129,7 +129,7 @@ static void _prepareImgAndDrawKeypoints( const Mat& img1, const std::vector<KeyP
if( flags & DrawMatchesFlags::DRAW_OVER_OUTIMG )
{
if( size.width > outImg.cols || size.height > outImg.rows )
CV_Error( CV_StsBadSize, "outImg has size less than need to draw img1 and img2 together" );
CV_Error( Error::StsBadSize, "outImg has size less than need to draw img1 and img2 together" );
outImg1 = outImg( Rect(0, 0, img1.cols, img1.rows) );
outImg2 = outImg( Rect(img1.cols, 0, img2.cols, img2.rows) );
}
@@ -141,12 +141,12 @@ static void _prepareImgAndDrawKeypoints( const Mat& img1, const std::vector<KeyP
outImg2 = outImg( Rect(img1.cols, 0, img2.cols, img2.rows) );
if( img1.type() == CV_8U )
cvtColor( img1, outImg1, CV_GRAY2BGR );
cvtColor( img1, outImg1, COLOR_GRAY2BGR );
else
img1.copyTo( outImg1 );
if( img2.type() == CV_8U )
cvtColor( img2, outImg2, CV_GRAY2BGR );
cvtColor( img2, outImg2, COLOR_GRAY2BGR );
else
img2.copyTo( outImg2 );
}
@@ -179,7 +179,7 @@ static inline void _drawMatch( Mat& outImg, Mat& outImg1, Mat& outImg2 ,
line( outImg,
Point(cvRound(pt1.x*draw_multiplier), cvRound(pt1.y*draw_multiplier)),
Point(cvRound(dpt2.x*draw_multiplier), cvRound(dpt2.y*draw_multiplier)),
color, 1, CV_AA, draw_shift_bits );
color, 1, LINE_AA, draw_shift_bits );
}
void drawMatches( const Mat& img1, const std::vector<KeyPoint>& keypoints1,
@@ -189,7 +189,7 @@ void drawMatches( const Mat& img1, const std::vector<KeyPoint>& keypoints1,
const std::vector<char>& matchesMask, int flags )
{
if( !matchesMask.empty() && matchesMask.size() != matches1to2.size() )
CV_Error( CV_StsBadSize, "matchesMask must have the same size as matches1to2" );
CV_Error( Error::StsBadSize, "matchesMask must have the same size as matches1to2" );
Mat outImg1, outImg2;
_prepareImgAndDrawKeypoints( img1, keypoints1, img2, keypoints2,
@@ -218,7 +218,7 @@ void drawMatches( const Mat& img1, const std::vector<KeyPoint>& keypoints1,
const std::vector<std::vector<char> >& matchesMask, int flags )
{
if( !matchesMask.empty() && matchesMask.size() != matches1to2.size() )
CV_Error( CV_StsBadSize, "matchesMask must have the same size as matches1to2" );
CV_Error( Error::StsBadSize, "matchesMask must have the same size as matches1to2" );
Mat outImg1, outImg2;
_prepareImgAndDrawKeypoints( img1, keypoints1, img2, keypoints2,