Vision Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
dreeves73

Make IMAQ image a native data type

Status: New

This is probably not a simple thing for NI to implement but I always thought it would make sense to make the IMAQ image a native data type. When I first started using LabVIEW, it took me a while to get used to the image data type and understand that it is just a pointer to a named image in memory and the pointer is passed between image operators. I am used to it now but it still seems clunky to me. Why can't an image constant or control implicitly create an image and they can be implicitly destroyed at the end of a program. Branching a wire would create two copies of an image that could be operated on independently. At the moment my imaging code always looks quite messy because I often need to create temporary image buffers for intermediate operations.

 

I think this would make the imaging tools a more wholistic addition to labVIEW and make it feel less like something that was adapted from another language. Sure there would be some impact on performance, but isn't that why we use LabVIEW? Simpler programming at a higher level. 

3 Comments
KiwiWires
Member

I agree that by ref is annoying when doing imaging processing due to the temporary images. I have worked on a large vision project and had issues with images becoming corrupted.

I thought my code had another thread referencing the same image by mistake  - as it was difficult to find / probe where it was occasionally falling over.

 

I ended up documenting all the create image calls and its image name (as the legacy code sometimes had rather generic names like "temp" - so I added the VI's name as a prefix). I also checked all the VIs were not reentrant.

 

However it turned out to be a subtle bug where the temporary image was wired to the dest input instead of the original image ref. By value would reduce these issues. 

 

Now we have DVRs, classes etc the vision module does feel a bit clunky. DAQmx is a nicer API.  

 

KiwiWires
Member

Just to add some more - it also doesn't feel complete. Especially when it should be optimized for speed. E.g. IMAQ Copy copies everything layers and data. I only need to copy the image and not the overlay from source image. There is also no copy a subset of an image (would be useful when only interested in ROI of camera view). 

 

There are lot of IMAQ function 2 VIs on palate. 

IMAQ AVI2 doesn't support custom image data. 

 

It feels like the vision needs some attention. 

cy...
Active Participant

I agree that using ref is quite messy indeed for image processing, but OP also mentioned branching creating copies and I can see more problems coming out from that, especially when dealing with larger images. perhaps for troubleshooting purposes, enable snapshot function on the image controls instead?

 

 

CY (expired CLAD)