提交 c751e901 编写于 作者: V Victor Erukhimov

Changed interface for drawMatches

上级 b34f0a2f
......@@ -2137,9 +2137,9 @@ struct CV_EXPORTS DrawMatchesFlags
};
// Draws matches of keypints from two images on output image.
CV_EXPORTS void drawMatches( const Mat& img1, const Mat& img2,
const vector<KeyPoint>& keypoints1, const vector<KeyPoint>& keypoints2,
const vector<int>& matches, const vector<char>& mask, Mat& outImg,
CV_EXPORTS void drawMatches( const Mat& img1, const vector<KeyPoint>& keypoints1,
const Mat& img2, const vector<KeyPoint>& keypoints2,
const vector<int>& matches, Mat& outImg, const vector<char>& mask = vector<char>(),
const Scalar& matchColor = Scalar::all(-1), const Scalar& singlePointColor = Scalar::all(-1),
int flags = DrawMatchesFlags::DEFAULT );
......
......@@ -45,9 +45,9 @@ using namespace std;
namespace cv
{
CV_EXPORTS void drawMatches( const Mat& img1, const Mat& img2,
const vector<KeyPoint>& keypoints1, const vector<KeyPoint>& keypoints2,
const vector<int>& matches, const vector<char>& mask, Mat& outImg,
CV_EXPORTS void drawMatches( const Mat& img1, const vector<KeyPoint>& keypoints1,
const Mat& img2,const vector<KeyPoint>& keypoints2,
const vector<int>& matches, Mat& outImg, const vector<char>& mask,
const Scalar& matchColor, const Scalar& singlePointColor,
int flags )
{
......
......@@ -98,7 +98,7 @@ void doIteration( const Mat& img1, Mat& img2, bool isWarpPerspective,
mask[i1] = 1;
}
// draw inliers
drawMatches( img1, img2, keypoints1, keypoints2, matches, mask, drawImg, CV_RGB(0, 255, 0), CV_RGB(0, 0, 255) );
drawMatches( img1, keypoints1, img2, keypoints2, matches, drawImg, mask, CV_RGB(0, 255, 0), CV_RGB(0, 0, 255) );
// draw outliers
/*for( size_t i1 = 0; i1 < mask.size(); i1++ )
mask[i1] = !mask[i1];
......@@ -107,7 +107,7 @@ void doIteration( const Mat& img1, Mat& img2, bool isWarpPerspective,
}
else
{
drawMatches( img1, img2, keypoints1, keypoints2, matches, vector<char>(), drawImg, CV_RGB(0, 255, 0) );
drawMatches( img1, keypoints1, img2, keypoints2, matches, drawImg, vector<char>(), CV_RGB(0, 255, 0) );
}
imshow( winName, drawImg );
......
......@@ -42,7 +42,7 @@ int main(int argc, char** argv)
// drawing the results
namedWindow("matches", 1);
Mat img_matches;
drawMatches(img1, img2, keypoints1, keypoints2, matches, vector<char>(), img_matches);
drawMatches(img1, keypoints1, img2, keypoints2, matches, img_matches);
imshow("matches", img_matches);
waitKey(0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册