NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
g_l_g_s
Posts: 14
0 Kudos
Accepted Solution

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

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.

Trusted Enthusiast
DFGray
Posts: 2,565
0 Kudos

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

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.

Using LabVIEW 2009 - 2012 on Windows 7 64-bit
Member
g_l_g_s
Posts: 14
0 Kudos

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

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.

 

 

Trusted Enthusiast
DFGray
Posts: 2,565
0 Kudos

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

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.

Using LabVIEW 2009 - 2012 on Windows 7 64-bit
Member
g_l_g_s
Posts: 14
0 Kudos

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

Dear DFGray,

 

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

 

Member
newtron
Posts: 1
0 Kudos

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

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.

Trusted Enthusiast
DFGray
Posts: 2,565
0 Kudos

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

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.

Using LabVIEW 2009 - 2012 on Windows 7 64-bit
By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page