07-21-2009 08:39 PM
07-22-2009 02:57 AM
07-22-2009 03:32 AM
Hi, Lasnier,
From my point of view I will not recommend to use LabVIEW arrays as placeholder for acquired images, because:
- operations with LabVIEW arrays in most cases more slow in comparizon with IMAQ functions
- these arrays are not aligned in memory, so you will get more penalties
- overall memory usage may be bigger than expected by array buffer allocation
So, Image to Array is the operation which used pretty rarely. Which operation available for array and not available for images?
Andrey.
07-22-2009 01:36 PM
Thanks Vladimir. Actually I have NI-IMAQ and I don't have either of those functions (IMAQ Get Image or IMAQ Get Image Data) except for IMAQdx. I don't see them either in the list of functions for IMAQ Vision:
<http://www.alliancevision.com/us/products/software_ni/imaqvision.htm>
Where did you find those?
-Charles Lasnier
07-22-2009 01:41 PM
Andrey,
Thanks for your reply. I should consider getting IMAQ Vision and using the image arithametic. Most of my processing is extracting profiles and getting pixel values. In the end I need to get the numbers out for further processing outside of LabVIEW. The other applications don't understand the IMAQ Image data type, so I convert to arrays. Still, I may be able to save memory by working more with the images and less with arrays. This is desirable with the large amount of data I need.
-Charles Lasnier
07-22-2009 02:50 PM
If you make your image border 0 in the IMAQ Create VI, you can use the IMAQ GetImagePixelPtr VI to get the address of the first pixel and you can pass this address to C to analyze the image and treat the data like an array (if you don't have a border of 0, you'll need to take into account the extra pixels at the beginning and end of each row).
Hope this helps,
Brad
07-22-2009 03:09 PM
Actually, even with a border of 0 you will still likely have to account for padding at the beginning and end of each line because the lines of Vision images are always 32-byte(?) aligned for better performance. The help file for GetImagePixelPtr explains this pretty well and how to account for it via the LineWidth output of that VI. Generally most code in C that deals with image manipulation should have a way to account for this padding, since it is a common mechanism in image analysis to have both aligned image data and also borders.
Eric
07-22-2009 05:02 PM
07-22-2009 08:10 PM