Search code examples
c++opencvlabview

How to convert a labview image type to opencv image type (or Mat)?


I'm using LabView to acquire an image from a usb camera and then I want to process this image using openCV functions through a dll file (which is used in call function VI). Now I want to convert the image format that Labview produce to process it with opencv. How can I do so?


Solution

  • You can use the "IMAQ GetImagePixelPtr" to get the pointer on the image in LabView.

    In the dll, you should be able to get it like this :

        int function(unsigned __int8 *LVImagePointer, int lineWidth, int height, int width)
        {
            Mat image(height, width, CV_8UC1, LVImagePointer, lineWidth);
            ...
        }