Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I move a 640 x 480 by 8 bit gray scale IMAQ image into an image buffer in memory that is 640 * 480 bytes long.

I'm trying to convert IMAQ images that are 8 bit gray scale. I need only the image; not the border or the image alignment. I need them to fit into memory that is row oriented, i.e., pixel (0,0) is in location m,
pixel (0,1) is in location m + 1, pixel (1,0) is in location m + 1 * image width, in general pixel location (x,y) is in location m + (y * image width) + x.
0 Kudos
Message 1 of 3
(3,171 Views)
If I understood you correctly you should use the IMAQ ImagetoArray VI and then you can easily transform your arrays - if not, please e-mail again and describe your problem more detailed ...
0 Kudos
Message 2 of 3
(3,171 Views)
Michael, Thank you for your answer. After searching for a while I found the function you mentioned. I have tried it and it works. It took me a few tries to figure out that the matrix notation is just a different order of expressing the array size.

In any event I was looking for a way to directly address the image; for speed reasons. There is a blurb in the help file that describes the format of the image in memory. It shows the border and alignment. It is described in the help file entry for IMAQ GetImagePixelPtr. I found no discussion on how to either read or set the alignment size. Since the function IMAQ ImageBorderSize will return the borer size, if I knew the alignment size, then I could access each pixel directly.

Again, thanks for respondi
ng.
0 Kudos
Message 3 of 3
(3,171 Views)