Skip to content

Commit

Permalink
drawMatches python bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
abidrahmank committed Jul 11, 2013
1 parent 68a992b commit 5d863f7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
8 changes: 4 additions & 4 deletions modules/features2d/include/opencv2/features2d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1404,15 +1404,15 @@ CV_EXPORTS_W void drawKeypoints( const Mat& image, const std::vector<KeyPoint>&
const Scalar& color=Scalar::all(-1), int flags=DrawMatchesFlags::DEFAULT );

// Draws matches of keypints from two images on output image.
CV_EXPORTS void drawMatches( const Mat& img1, const std::vector<KeyPoint>& keypoints1,
CV_EXPORTS_W void drawMatches( const Mat& img1, const std::vector<KeyPoint>& keypoints1,
const Mat& img2, const std::vector<KeyPoint>& keypoints2,
const std::vector<DMatch>& matches1to2, Mat& outImg,
const std::vector<DMatch>& matches1to2, CV_OUT Mat& outImg,
const Scalar& matchColor=Scalar::all(-1), const Scalar& singlePointColor=Scalar::all(-1),
const std::vector<char>& matchesMask=std::vector<char>(), int flags=DrawMatchesFlags::DEFAULT );

CV_EXPORTS void drawMatches( const Mat& img1, const std::vector<KeyPoint>& keypoints1,
CV_EXPORTS_AS(drawMatchesKnn) void drawMatches( const Mat& img1, const std::vector<KeyPoint>& keypoints1,
const Mat& img2, const std::vector<KeyPoint>& keypoints2,
const std::vector<std::vector<DMatch> >& matches1to2, Mat& outImg,
const std::vector<std::vector<DMatch> >& matches1to2, CV_OUT Mat& outImg,
const Scalar& matchColor=Scalar::all(-1), const Scalar& singlePointColor=Scalar::all(-1),
const std::vector<std::vector<char> >& matchesMask=std::vector<std::vector<char> >(), int flags=DrawMatchesFlags::DEFAULT );

Expand Down
9 changes: 6 additions & 3 deletions modules/python/src2/cv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ using namespace cv;
typedef cv::softcascade::ChannelFeatureBuilder softcascade_ChannelFeatureBuilder;

typedef std::vector<uchar> vector_uchar;
typedef std::vector<char> vector_char;
typedef std::vector<int> vector_int;
typedef std::vector<float> vector_float;
typedef std::vector<double> vector_double;
Expand All @@ -112,6 +113,8 @@ typedef std::vector<KeyPoint> vector_KeyPoint;
typedef std::vector<Mat> vector_Mat;
typedef std::vector<DMatch> vector_DMatch;
typedef std::vector<String> vector_String;

typedef std::vector<std::vector<char> > vector_vector_char;
typedef std::vector<std::vector<Point> > vector_vector_Point;
typedef std::vector<std::vector<Point2f> > vector_vector_Point2f;
typedef std::vector<std::vector<Point3f> > vector_vector_Point3f;
Expand Down Expand Up @@ -830,7 +833,7 @@ template<typename _Tp> struct pyopencvVecConverter
}
};

template <typename _Tp>
template<typename _Tp>
bool pyopencv_to(PyObject* obj, std::vector<_Tp>& value, const ArgInfo info)
{
return pyopencvVecConverter<_Tp>::to(obj, value, info);
Expand Down Expand Up @@ -888,9 +891,9 @@ template<typename _Tp> static inline PyObject* pyopencv_from_generic_vec(const s

template<typename _Tp> struct pyopencvVecConverter<std::vector<_Tp> >
{
static bool to(PyObject* obj, std::vector<std::vector<_Tp> >& value, const char* name="<unknown>")
static bool to(PyObject* obj, std::vector<std::vector<_Tp> >& value, const ArgInfo info)
{
return pyopencv_to_generic_vec(obj, value, name);
return pyopencv_to_generic_vec(obj, value, info);
}

static PyObject* from(const std::vector<std::vector<_Tp> >& value)
Expand Down

0 comments on commit 5d863f7

Please sign in to comment.