Algomorph/pyboostcvconverter

Is dim>2 array conversion supported?

Closed this issue · 5 comments

Great work! Thanks!

Actually, before I come here, I have checked the rep
https://github.com/yati-sagade/opencv-ndarray-conversion/blob/master/conversion.h
Where I find dim>2 array may not be supported, see below code snippet.
Is this project solve this problem?

if( ndims > 2)
    {
        failmsg("toMat: Object has more than 2 dimensions");
    }

That excerpt is from conversion.cpp
Are you're trying to make an N-D OpenCV matrix?
I think it should work. Please try it & close this issue if it works.

Yes, I try to convert a N-D array in numpy to N-D mat in opencv. But, the conversion.cpp only support 2-D array.

@lc82111 , as I said, please try my code and see if it works for you.

@Algomorph, I have tried 4-D array conversion and it works as my expectation.

@lc82111 Very well, thanks for the report.