LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

extracting pointer information and displaying it as an image

Hey,
 
I am using Intel's OpenCV image processing library in LabVIEW.

There's a pointer to a struct IplImage that is passed around in order to run image processing functions.
 
The struct IplImage is defined as: 
    typedef struct _IplImage
    {
        int  nSize;         /* sizeof(IplImage) */
        int  ID;            /* version (=0)*/
        int  nChannels;     /* Most of OpenCV functions support 1,2,3 or 4 channels */
        int  alphaChannel;  /* ignored by OpenCV */
        int  depth;         /* pixel depth in bits: IPL_DEPTH_8U, IPL_DEPTH_8S, IPL_DEPTH_16U,
                               IPL_DEPTH_16S, IPL_DEPTH_32S, IPL_DEPTH_32F and IPL_DEPTH_64F are supported */
        char colorModel[4]; /* ignored by OpenCV */
        char channelSeq[4]; /* ditto */
        int  dataOrder;     /* 0 - interleaved color channels, 1 - separate color channels.
                               cvCreateImage can only create interleaved images */
        int  origin;        /* 0 - top-left origin,
                               1 - bottom-left origin (Windows bitmaps style) */
        int  align;         /* Alignment of image rows (4 or 8).
                               OpenCV ignores it and uses widthStep instead */
        int  width;         /* image width in pixels */
        int  height;        /* image height in pixels */
        struct _IplROI *roi;/* image ROI. when it is not NULL, this specifies image region to process */
        struct _IplImage *maskROI; /* must be NULL in OpenCV */
        void  *imageId;     /* ditto */
        struct _IplTileInfo *tileInfo; /* ditto */
        int  imageSize;     /* image data size in bytes
                               (=image->height*image->widthStep
                               in case of interleaved data)*/
        char *imageData;  /* pointer to aligned image data */
        int  widthStep;   /* size of aligned image row in bytes */
        int  BorderMode[4]; /* border completion mode, ignored by OpenCV */
        int  BorderConst[4]; /* ditto */
        char *imageDataOrigin; /* pointer to a very origin of image data
                                  (not necessarily aligned) -
                                  it is needed for correct image deallocation */
    }
    IplImage;
 
I am having problems with closing OpenCV's GUI window when called from LabVIEW in Linux. A solution to this may be to not use OpenCV's GUI window in LabVIEW for Linux, but rather pass back the pointer to the processed image in LabVIEW. From that pointer, we can send it to a C wrapper to extract some information that we want from the struct in order and pass back those values to LabVIEW. Then LabVIEW will process those values and display the image. What will I need to extract from the pointer (via a C wrapper) in order to display the image onto LabVIEW?
 
I attached a LabVIEW example that I found. This example loads and displays an image. I am thinking of doing something similar to that. Instead of loading an image from the file dialog, I will pass all of the necessary information to Draw Flattened Pixmap.
Message 1 of 4
(3,668 Views)

elliott.ee,

What kind of problems are you having with closing OpenCV's GUI window? I see a lot of information and some proposed solutions, but I'm not sure what exactly the problems and symptoms are. Or maybe you were just thinking out loud...but a description of the problem might clarify the situation some.

Have a good one!

Tyler S

 

0 Kudos
Message 2 of 4
(3,630 Views)
My description of my problems with interfacing OpenCV with LabVIEW is contained in this discussion
Basically, the code works in C in Linux, C in Windows, LabVIEW for Windows, but not in LabVIEW for Linux.
 
We finally were able to get OpenCV to interface with LabVIEW for Linux by doing some complex edition to make install. However, LabVIEW was still having trouble with the function to close all HighGUI windows. Even though it went through the function, it will not close the HighGUI window. Also the HighGUI window freezes and when it eventually closes, it crashes LabVIEW.
When I test it by writing C programs, the function does what it is supposed to do.
0 Kudos
Message 3 of 4
(3,619 Views)

Were you able to get a OpenCV    cvloadimage pointer to allow LV to recieve that image into a picture control?

 

Thanks

Tim C. 

1:30 Seconds ARRRGHHH!!!! I want my popcorn NOW! Isn't there anything faster than a microwave!
0 Kudos
Message 4 of 4
(3,222 Views)