Ask Your Question

Revision history [back]

I want to convert keypoints in C++ to python

Hi,

Recently, I implemented a new method about detecting keypoints in C++. (the method is not included in OpenCV library yet) Then I want to evaluate the keypoint results in python. So I need to write a python wrapper to convert the keypoints in C++ to Keypoints in python.

Specifically: I performed vector<keypoint> kps1 = NewAlgorithm_KeypointDetector(XXX); //in C++ and then I want to transfer the keypoint result to python.

I searched many materials, including using CV_WRAP, but I don't know how to use it. Or I checked cv2.cpp file, there is pyopencv_from() and pyopencv_to() function, but I am not able to directly call them to do the python wrapper. Im using Boost.python currently, so how should I deal with it?

Thanks in advance.

Best regards, Weibo Qiu.

click to hide/show revision 2
None

updated 2018-11-15 07:53:07 -0600

berak gravatar image

I want to convert keypoints in C++ to python

Hi,

Recently, I implemented a new method about detecting keypoints in C++. (the method is not included in OpenCV library yet) Then I want to evaluate the keypoint results in python. So I need to write a python wrapper to convert the keypoints in C++ to Keypoints in python.

Specifically: I performed

vector<keypoint>
vector<KeyPoint> kps1 = NewAlgorithm_KeypointDetector(XXX); //in C++C++

and then I want to transfer the keypoint result to python.

I searched many materials, including using CV_WRAP, but I don't know how to use it. Or I checked cv2.cpp file, there is pyopencv_from() and pyopencv_to() function, but I am not able to directly call them to do the python wrapper. Im using Boost.python currently, so how should I deal with it?

Thanks in advance.

Best regards, Weibo Qiu.