opencv / opencv

Open Source Computer Vision Library
https://opencv.org
Apache License 2.0
75.69k stars 55.61k forks source link

OpenCV-Python Bindings, vector<>, Matx<> conversion #25418

Open lahrims opened 2 weeks ago

lahrims commented 2 weeks ago

Describe the feature and motivation

I am following this to create openCV-python bindings to my code as custom module that can be used as a shared library.

With simpler structs and classes it runs without issues and i am able to import and work with them in python, however when i try converting classes that has arg types with vector<> or cv::Matx<> it fails

struct CV_EXPORTS_W_SIMPLE foo{ 
   CV_WRAP foo(int param, std::vector<someparameter> someparamter)   
       {someparameter =_someparameter}
   }

it fails or reads the python bindings as vector_someparameter

I have tried CV_EXPORTS_W, it also fails if i declare the said parameter as CV_PROP_RW to expose it to python.

Additional context

No response