High-Speed Digitizers

cancel
Showing results for 
Search instead for 
Did you mean: 

How to transfer a 2D array from NI-scop into a gray scale image and save it

Solved!
Go to solution

Dear all,

 

I acquired a 2D array and want to transfer it into a gray scale image (12 bits) and save it into my hard disk but I don't know how to do it.

 

I can use Intensity graph to show the 2Darray into gray scale image, but the intensity graph.vi can not save the image in real time.

 

Thank you.

0 Kudos
Message 1 of 11
(8,422 Views)

The 12-bits makes it rather difficult.  If you are willing to save as 8-bit grayscale, you can use the internal picture funtions.  Use Flatten to Pixmap to convert your array to a pixmap, then store it as a PNG.  For 12-bit, you will need to use the call library node with an external library.  Two that may work (although I have not done this) are ImageMagick and LibTiff.

0 Kudos
Message 2 of 11
(8,418 Views)

Thank you DFGray,

 

I have finisehd the 8-bits according to your suggestion.

 

I saw there are also 24bits option on the Flatten to Pixmap VI, but when I ascale the array by 2^24-1 and then connect to the Flaten to Pixmap, then save the image, but when I oprn the saved image I found ther is no image information but noise.

 

I want to have larger bit-depth because of the requirement of my project, so can you tell me how can I save the iamge in 24-bits depth correctly?

 

Thank you.

 

 

0 Kudos
Message 3 of 11
(8,407 Views)
Solution
Accepted by topic author g_l_g_s

The 24-bit is a color image with 8-bits per color channel per pixel (interleaved, if I remember correctly).  It is not a 24-bit gray-level, so I don't think it will work for you.  I believe the IMAQ library (a LabVIEW add-on) will handle 16-bit gray-scale, if you can get a copy.

 

As a native LabVIEW workaround, you could also split your image into two 8-bit images, with one image representing the high bytes, the other the low.  You could then combine them when you do the analysis, if your analysis program is capable of this.

0 Kudos
Message 4 of 11
(8,405 Views)

Dear DFGray,

 

Thank you, I finished it using IMAQ functions and save the format into 16 bits .

 

0 Kudos
Message 5 of 11
(8,399 Views)

hello everyone,

i might have the same problem, i am using image acquistion in labview

i am acquring a 16 bit grayscale image from a camera and a GPU is changing into a lookup table with varied colours.

but when i want to store the resulting image, it gets stored as an 8 bit avi file.

 

how can store it as a 16bit file? 

thank for the help.

0 Kudos
Message 6 of 11
(8,224 Views)

There are three options listed in the discussion above.  The IMAQ one is the easiest, but also is an extra add-in the LabVIEW that is purchased separately.  The other two will require more coding, but are free.

0 Kudos
Message 7 of 11
(8,215 Views)

What is the way to change the cluster data output of the "Flatten to Pixmap" sub-VI into the IMAQ picture?

0 Kudos
Message 8 of 11
(7,471 Views)

Hi meBaga, 

 

What do you mean by changing the cluster output of the Flatten Pixmap.vi? You can unbundle it to obtain specific portions of the data that are included in the cluster, but you cannot change the cluster itself. 

 

-N

National Instruments
Staff Certification Engineer
0 Kudos
Message 9 of 11
(7,453 Views)

Actually I am new to LabVIEW. I want to know that, after I get the cluster output, what are the subVI(s) I need to add to generate a IMAQ image? 

 

As you mentioned, I need to unbundle the cluster. After that, The things I have are -

 

image type, image depth, image, mask, colors, rectangle. Using these, how can I create IMAQ Image?

0 Kudos
Message 10 of 11
(7,443 Views)