Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Each pixel value in an image

Hi there,
 
I am using LD3500 series digital line scan camera (part no. LD3523PGK-022) along with a NI IMAQ PCI-1428 frame grabber card. My platform is MSVC and I am using ring acquistion for storing and processing the images online. My question is how can I access individual pixel values from an image stored in the buffer element? I am interested in finding the centroid of the image and any help in this regard is greatly appreciated. Thanks.
 
Best regards,
Sam
0 Kudos
Message 1 of 2
(3,110 Views)
 

Hello Sam,

If you are using the NI-IMAQ driver functions to acquire your images, then the image pixel data is stored in an array.  For example, in the ExtractBuffers example that ships with NI-IMAQ (in the C:\Program Files\National Instruments\NI-IMAQ\Sample\MSVC\Ring\ExtractBuffers directory), the variable named ImaqBuffers is an array of image buffers.  Each element of the array points to a memory location where the pixel data is stored.  If you extract or copy the buffer, you could access the memory locations to obtain the pixel values.

On the other hand, if you are using NI's Vision software, then the images are stored in an image datatype (similar to an array, just with extra information).  In this form, you could use the imaqCentroid function (available in the Vision software) to calculate the centroid of the image without needing to look at each pixel independently.  This is discussed in more detail in Chapter 1 of the Vision Concepts Manual.

Both of these types are discussed in the NI-IMAQ Images and IMAQ Vision Images in C tutorial.

Hope this helps to point you in the right direction.

Best Regards,

Jesse D.
Applications Engineering
National Instruments

0 Kudos
Message 2 of 2
(3,074 Views)