LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

3rd party image processing

Hi,

I'm trying to use a 3rd party API to pass an image to, which has been opened by NI vision.  The third party app expects a pointer in memory to the image (also resolution, dpi etc).  My question is, can I just typecast the image reference to the integer the API expects, and get the resulting memory pointer?  Or is the pointer embedded in the information pointed to by the image reference?  How would I get at the address pointer? 

 

Thanks

0 Kudos
Message 1 of 5
(3,324 Views)
I don't have much knowledge on this but it could be of some help to you. You can use IMAQ GetImagePixelPtr to obtain the pointer to the image memory location. The image is stored in memory from top left to bottom right. For example the pixel referred to by column 0 and row 0 is the pixel in the top left hand corner of the image. The Help for GetImagePixelPointer contains additional information on how the image data is organized in memory; try to search the forums as well. This VI returns all the information you need to know to access the image data properly (if you need to pass an image to a DLL, for example).
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 2 of 5
(3,313 Views)
The VI Adnan is pointing out is in Vision Utilities -> Image Management -> External Libraries Support
Chilly Charly    (aka CC)
0 Kudos
Message 3 of 5
(3,304 Views)
That is working great, thanks very much.
0 Kudos
Message 4 of 5
(3,277 Views)

Hi,
I'm running into another problem regarding this.  The API I am using requires not only the pointer to the image, but the resolution in Dots Per Inch.  I have been working with a standalone vi to test out the 3rd party API, using an image loading from disk with NI tools (IMAQ create then IMAQ readfile).  To get the DPI, I have been using IMAQ GetImageInfo, which outputs the "units" (as in inches, cm etc), X step, and Y step.  I took those outputs, did some math, and converted to DPI.  It has been working great.  However, when recently trying to pass an image which has been "grabbed" from the camera, the IMAQ GetImageInfo returns an "undefined" for the unit, and "1.0000" for both X and Y step. 

One difference I can think of between the images loaded off of disk, and a grabbed one using IMAQ grab, is that I acquired my test images on disk using IMAX, then loaded cropped and saved them using an image editor.
My question is, does IMAQ GetImageInfo calculate X step and Y step, and units (and how does it determine units?), or does it rely on this information to be embedded as data in the image?  Maybe my image editors saved this information to the image itself during a save?  How can I get an image output from IMAQ grab to return units, X step and Y step using IMAQ GetImageInfo?

Thanks

David

0 Kudos
Message 5 of 5
(3,187 Views)