0

I am trying to communicate between python and c++. Here is the link to the main source code I am using: https://github.com/rajatsaxena/pyImageListToVectorMatcpp which is mostly inspired from here https://github.com/Algomorph/pyboostcvconverter. I want to be able to take a tuple of numpy array (OpenCV images) at python end, the process in c++ and then finally return a tuple of numpy array (OpenCV images).

But I start getting this error:

In function ‘PyObject* pbcvt::getStitchingParams(PyObject*)’:
/home/**/pyImageListToVectorMatcpp/src/python_module.cpp:96:69: error: cannot convert ‘std::vector<cv::Mat>’ to ‘PyObject* {aka _object*}’ for argument ‘1’ to ‘std::vector<cv::Mat> pbcvt::fromTupleToVector(PyObject*)’
         vector<Mat> InputImage = pbcvt::fromTupleToVector(InputImage);
                                                                     ^
/home/**/pyImageListToVectorMatcpp/src/python_module.cpp: In function ‘void pbcvt::init_module_pbcvt()’:
/home/**/pyImageListToVectorMatcpp/src/python_module.cpp:459:34: error: too few arguments to function ‘std::vector<cv::Mat> pbcvt::fromTupleToVector(PyObject*)’
         pbcvt::fromTupleToVector();
                                  ^
In file included from /home/**/pyImageListToVectorMatcpp/src/python_module.cpp:4:0:
/home/**/pyImageListToVectorMatcpp/include/pyImageListToVectorMatcpp.hpp:73:13: note: declared here
 vector<Mat> fromTupleToVector(PyObject* o);
             ^
make[2]: *** [CMakeFiles/pbcvt.dir/src/python_module.cpp.o] Error 1
make[1]: *** [CMakeFiles/pbcvt.dir/all] Error 2
make: *** [all] Error 2

This is because of some problem with my tuple to vector converter script src/pyboost_cv2_converter.cpp obviously which I am not being able to figure out.

1 Answer 1

1

Judging by your code here, your argument to the fromTupleToVector should be the starting-with-lowercase inputImage, which is the argument to getStitchingParams and has type PyObject*.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.