Jump to content

Labview OpenCV interface: passing array of images

Recommended Posts

Currently I am trying to build an interface between OpenCV C++ and LabVIEW, which I call through the call library function node. To start of I have installed the provided labview OpenCV utilities package, which includes c++ development tools for type conversion/wrapper for NIImage/cv::Mat. See my code bellow:


A single image (NIImage) is constructed from an "NIImageHandle" and an array in constructed from an "NIArrayHandle". In my test case I am sending the same image control as an "NIImageHandle" and contained in an array which is passed using the "NIArrayHandle". See my labview bd:


When running the vi the code has no problem constructing an "NIImage" from a single "NIImageHandle", but when constructing an "NIImage" from an image contained in an array which is passed as an "NIArrayHandle" I cannot seem to get a valid image. Some data is written to a text file to try and clarify what is happening inside the code:


I don't know if the Lava or labview forum is the right place to look for help, but that's my best guess. Is there a way I can get the image handle of images in LabVIEW, are there better solutions or is there even a solution? In case of the provided LabVIEW OpenCV C++ development tools the "NIImageHandle" is a private member variable of the "NIImage" class, but I made it public to see what is happening. So maybe the image handle of an imaq image is also private in LabVIEW.

Link to comment

Your image source is U8 grayscale, your destination is floating point double. Are you sure this is correct? Also, try using a different image other than one from the stack - pass another NIIMAGE to calibrate_response. I think you are overwriting the 1st image in the stack.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.