Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I figure out why the python_binder does not wrap the output type of the second argument properly neither with my declaration nor with the one of @berak. It seem to be related to the name of the second argument. Inspired by the declaration of the OpenCV's function split I just change my declaration from :

CV_EXPORTS_W void read_myJFile(const String& filename, OutputArrayOfArrays img);

to

CV_EXPORTS_W void read_myJFile(const String& filename, OutputArrayOfArrays mv);

By just doing that I saw the wraping type in the file:

opencv/build/modules/python_bindings_generator/pyopencv_generated_funcs.h

change from Mat to vector_Mat.

I guess the reason why the binder use the name of the output variable to determine the wrapping type is related to the fact that OutputArrayOfArrays is a typedef of OutputArray, samething for InputArrayOfArrays is a typedef of InputArray (this is not true for InputArray, OutputArray and InputOutputArray that are three different classes). The fact they are typedef mean the binder cannot deduct the type of the wrapping output variable by just analysing the type of the output variable.

@berak thank you for your help.