stereolabs / zed-opencv

ZED SDK interface sample for OpenCV
https://www.stereolabs.com/docs/opencv/
MIT License
137 stars 79 forks source link

OpenCV: unrecognized or unsupported array type #69

Closed dommy1C closed 2 years ago

dommy1C commented 5 years ago

Hi Admittedly I am using C# and EmguCV to Pinvoke against the ZED SDK. But someone here MAY be able to help.

So, I have this:

    public ERROR_CODE RetrieveImage(
        ZEDMat mat,
        VIEW view,
        ZEDMat.MEM mem = ZEDMat.MEM.MEM_GPU,
        Resolution resolution = new Resolution() )
    {
        return ( ERROR_CODE ) ( dllz_retrieve_image( mat.MatPtr, ( int ) view, ( int ) mem, resolution ) );
    }

    [DllImport(nameDll, EntryPoint = "dllz_retrieve_image")]
    private static extern int dllz_retrieve_image(System.IntPtr ptr, int type, int mem, Resolution resolution);

The ERROR_CODE returns a success.

But, as soon as I try to read/display the image I get this error:

Emgu.CV.Util.CvException HResult=0x80131500 Message=OpenCV: unrecognized or unsupported array type Source=Emgu.CV.World StackTrace: at Emgu.CV.CvInvoke.CvErrorHandler(Int32 status, IntPtr funcName, IntPtr errMsg, IntPtr fileName, Int32 line, IntPtr userData) at Emgu.CV.CvInvoke.cvGetRawData(IntPtr arr, IntPtr& data, Int32& step, Size& roiSize) at Emgu.CV.Image`2.get_Bitmap()

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment otherwise it will be automatically closed in 5 days