Store a 12-bit gray scale image

I'm using a video camera to acquire images. This camera delivers 12-bit gray scale images so 4096 levels of grey. However, when I store these images on my HD on PNG format, the maximum value of a pixel is 256. Which is normal because the 3 colors R, V, B are coded onto 8 bits each. How is it possible to keep the signal dynamic of the image delivered by the camera? Does it exist an image format which would allow me to store the pixel values onto 12 bits ?

I'm using the IMAQ function "IMAQ Write PNG file" to store the images. But then when you open these stored images with a basic software (such as Paint) each pixel is coded onto 256 levels. Do you think I should turn "Use bit depth?" option to True ?

Similar Messages

  • How can I save the 12-bits gray scale image ?

    Software & Hardware
    NI-IMAQ Vision 6.0
    NI-IMAQ for 1394 2.0.0
    Hamamatsu C4742-95
    I acqured the 12-bits gray scale image (Format7 , 640X512 size , 12bits) successfully.
    And CWIMAQViewer display the correct image of which the range is from 0(black) to 4096(white).
    But, I don't find the way to save this image with 12-bits format T.T
    Always, CWIMAQVision object save this image to 8-bit format.
    I tested all formats - tiff, bmp, aip, png.
    I think there are two possible problems.
    1. I dont't know the way to save the 12bits gray scale image. :{
    2. I dont't know the way to read the 12bits gray scale image that saved correctly.
    How can I save and load the 12-bits gray scale image ?
    What is the solution for this problem T.T ?

    Hello,
    I would recommend taking a look at the "ReadImage" Visual Basic project for more information on setting the image type and saving the image to file.  When you run the program, make sure you select 16 bit for your image.  You can also add another button to this example for saving the image.  Within the click subroutine for the button, you can add the line:
    CWIMAQVision1.WritePNGFile CWIMAQViewer1.Image, "C://image.png"
    This method will save the image in the viewer as a png file.  As long as it was loaded as a 16 bit image, it should save all of the 12 bit information into the file.  You could then test the new image by loading it using the example (you can see the pixel values by right-clicking on the viewer and selecting Settings>>Show Image Info.  The pixel value displayed in the info bar corresponds to the mouse position.
    Best Regards,
    Jesse D.
    Applications Engineering
    National Instruments

  • How to Convert FLIR Gray Scale Image to a Temperatur​e Map in NI VBAI

    I have been working with a FLIR A315 Infra-Red camera and NI's VBAI software.  I need to determine the presence and continuity of a hot mastic foam that has been injected into the hollow bulb of a rubber weatherstrip seal in 4 adjacent locations that flow together inside the weatherstrip bulb to form a continuous foamed mastic plug.
    So far, I have been able to trigger image acquistions in VBAI from a FLIR IR camera by monitoring an Allen-Bradley PLC's status bit.   The communication with the FLIR A315 camera is via the IMAQdx GigE driver.  However, I haven't figured out how to detemine the temperatures from the gray scale images I receive from the FLIR camera.  I wonder if someone could give me some pointers on how to do this.
    I have attached some images below to illustrate what I am working with and how far I've gotten.
    iPhone_Photo.jpg - shows a photograph of the weatherstrip section that the FLIR IR camera is "looking" at.
    FLIR_IR_Monitor.jpg - a screen capture of a FLIR IR monitor utility that shows temperatures measured at a number of points and areas (showing it can be done)
    NI_VBAI.jpg - part of my VBAI 2010 project which shows the image I've acquired from the FLIR A315 IR Camera
    So, I am part of the way there, but so far have not found a way to map the gray scale image that VBAI is acquiring from the FLIR IR camera into a heat map from which I can determine temperatures - and would appreciate some help on how to do this.
    Kind regards,
    Nick
    Solved!
    Go to Solution.
    Attachments:
    iPhone_Photo.jpg ‏239 KB
    FLIR_IR_Monitor.jpg ‏113 KB
    NI_VBAI.jpg ‏205 KB

    Hello,
    Image provided by FLIR camera are unsigned 16bit.
    Depending on the FLIR temperature scale you selected (10mK or 100mK), you will have to divide by a 10 or 100 factor to get K values. Don't select radiometric output.
    So if your object is cold, the population of the histogram of your image will be on the left part of it and if the object is hot, the population of the histogram will be on the right part.
    If you want your temperature values in Celcius, just add 273,15 to the Kelvin Value.
    Then you can add a color palette in VBAI (FLIR iron is available)
    Hope this helps

  • 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.
    Solved!
    Go to Solution.

    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.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • Gray scale Image Processing

    sir/madam, please explain how to extract pixels from monochrome(or gray scale image, which is having JPG file format. As I am doing visual cryptography application, I am facing this problem. thank you one and all. bye

    it would be no different (though the data might be easier to interpret) than doing it will a full colour picture.
    Load the file into an Image, and operate on that.
    An image is easily loaded by code like this:
        public Image loadImage(String filename) throws IOException {
            return new ImageIcon(getClass().getResource(filename)).getImage();
        }Turn that into a BufferedImage, and you can access each pixel at your leasure.

  • How to control "colorrange= high 5% dark 254%" in Gray scale image

    Hello every one,
    Our client wants to change the passport size image in B/W art work to do this below comments from client:
    “Change the picture (parts supplied look ADV Material) Picture in black, 200 dpi colorrange= high 5% dark 254%, file extension= .tif”
    In this comments I didn’t understand “colorrange= high 5% dark 254%” unfortunately I don’t have contact details to ask more details to client. Please some one share with me does i control the same in Gray scale image
    Thanks in Advance
    Regards,
    Siva

    Your client's comments don't make any sense.
    “colorrange= high 5% dark 254%
    Except Color Rage from the Select menu in Photoshop which apparently is not what is meant here, there is no such term "colorrange" neither in Photoshop nor it is something popular in the design and printing terminology. If this is a print job, percentage suggests ink coverage but if so, while "dark 254%"  makes sense, the word "high" from "high 5%" doesn't make any sense. If the client was trying to communicate what Zeno is guessing then in the context of the comment, 254 cannot be described as "dark" because this affects the highlights.
    If it was me, I will not procede until it is made clear what the task is.

  • Gray scale images – too dark

    CS5.5 or CC – I have experienced several times that flat grayscale imaged - corrected and nice in PhotoShop turns up much too dark when placed in InDesign.
    I make sure no effect or colors are applied to the frame or picture, but still no effect.
    If I force transparency on the actual spread (by placing two white items on top of each other, the topmost multiplied on the master page) then it looks correct at once.
    It makes no difference if it is a flat grayscale jpg or a psd, even a psd with a white background turns out this way.
    Why is that? - Do you know?
    BR Nina Storm

    ID previews grayscales two different ways, when there's transparency on the page or Overprint Sep Preview is turned on, grayscales preview via the CMYK profile. With no transparency (or an RGB Transparency Blend space) they preview as sGray (2.2 Gamma), which is useful for screen design.
    You can use your InDesign document's CMYK profile as the grayscale profile in Photoshop to get more consistent previews between ID and PS. Check this thread:
    http://forums.adobe.com/message/6123199#6123199

  • How to convert color image(24 bit) YUV 4:2:2 to gray scale 8 bit image

    I am using sony DFW-X700 color camera for one of vision applications.Does NI Compact Vision System(CVS) support YUV 4:2:2 format(8 bit each).I want to do gray scale processing, so i need to convert the YUV color into gray scale (8-bit) in the software(like Labview). Please suggest us how to do this conversion for better gray scale image clarity from color.

    In YUV color space, Y represents the gray scale; in RGB color space, R=G=B represents gray scale. You can simply set R=G=B=Y, to convert YUV to RGB. If the original color depth is 24 bit, then the result is 24 bit too.
    You can create gray scale color table like this:
    array size = 256;
    [0] = 0x000000;
    [1] = 0x010101;
    [2] = 0x020202;
    [255] = 0xFFFFFF;
    To convert 24 bit gray scale to 8 bit, check every pixel in 24 bit image to find the array index according to the color table, and replace the pixel with array index.
    George Zou
    http://gtoolbox.yeah.net
    George Zou
    http://webspace.webring.com/people/og/gtoolbox

  • Gray scale photos images are different but should be the same; help?

    I send a gray scale image from Lightroom (Edit with ...) and it opened CS4 photoshop.
    I made a blank document , 11x14".
    I used Windows/arrange/ tile to view the blank and the gray scale image. I tired various methods of bringing the gray scale image to the blank one (move tool, select all and move, copy and paste). Each time, I did this within seconds of each other (I made no changes to fill, opacity, and I used Normal). I brought the image in twice so I could print out the SAME image twice on the larger 11x14 at Sams club in order to use the Epson 7800 printer and not the old wet process on the Fugi machine. One image is darker(lighter) than the other every time. I even tried another image and I got two different exposures.
    I wonder if it it only happens with the grayscale images? Perhaps it is a problem coming from Lightroom 2.5?
    I did a three image 16x20 and I didn't notice the difference - partly because they were three differenct images in color. I will try two color images from the same file tomorrow.
    Any thoughts? I haven't found a possible setting problem that would have been applied between the operations.
    Rich

    Paulo,
    Thanks. I was ready to believe the monitor idea but I still have some reservations.
    I don't doubt what you said about the pixels (sounds correct to me).
    Why?
    I tried another monitor and the images I attached also look like the top one is darker (vertically).
    Also, the same is true if I scrolled the images. It seems to me that I should see a difference as I slowly scroll the image vertically. I didn't see a difference.
    Read on please.
    At any rate (I long for a CRT - my 21" crapped out last year), I am using  two SAMSUNG screens, the
    one attached to the main computer is the Syncmaster T220 - a well rated
    monitor; as far as I knew , read and had friends who recommended them.
    The other I just tried is attached to the second computer a couple of feet away. It is the syncMaster T240HD. 
    So, if it is an LCD monitor problem, it is with both and the same
    company. I would think I would have read some bad reports about these
    LCDs?
    Also, wouldn't the color images also be different when presented the same way? (they aren't).
    However, I went back to the original T220 LCD display and moved an image in to a blank one as before, then did the control J to copy the layer, and the images we different again. But, I zoomed in more than usual and scrolled the images and they were lighter at the bottom of the screen and darker at the top of the screen!!!!!!
    That is good news and bad news! $$$$$$
    If it is the monitor problem, then both images should print as the same.????
    Secondly, the display (LCD) attached to the machine at Sams showed the same difference between the two images. AND, I recall that the display is also a Samsung (I will check that tomorrow).
    What a bunch of coincidences! I guess I have to search the web for some Samsung answers? and contact the company?
    I want to explore as much on my end as possible.
    Hunt and another suggested the Control-J to avoid the problem by copying the layer. That didn't work either.
    I suppose I could tweak one of the images after bringing them in but I don't know how (I clicked the layer and I wasn't able to do anything - like lighten that image).
    Again, thanks for the help. I think the question maybe answered.
    I will send the screen capture shortly.
    Rich

  • Gray scale color table

    I want to make a picture out of an 8-bit unsigned integer 2D matrix of data. I can successfully do that using the "draw unflattened pixmap" function. However, it requires a color map. If you don't wire the color map, it uses the default labview color map. I want to use a gray scale color map (numbers between 0 and 255 corresponding to colors ranging from white to black). I am not sure how to make this color map and implement it. I appreciate any help.
    Solved!
    Go to Solution.

    Jahan wrote:
    The problem seems to be solved this way. Although it seemed to work (I got a gray scale image), I am not sure if what I have done is technically correct (if there is a better way of doing it). If someone wants to comment on it, I would appreciate.
    Yes, this is technically correct (top). (Typically you can do it once, then right-click the indicator and "change to constant" and delete the loop code.)
    You might also flatten the rgb tool code to the diagram (bottom). This has the advantage that the entirel loop will be calculated once at compile time and internally folded into a constant so the loop actually never spins during execution of the program (See also). (Of course this particular loop is trivial and nothing to worry about, performance wise. ) 
    Message Edited by altenbach on 03-14-2009 09:57 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    greyscale.png ‏6 KB

  • Converting Gray Scale to RGB

    Can anybody tell me how to convert a Gray Scale image to RGB image?
    I have written a Code:
    public BufferedImage convertToRGB(BufferedImage input){
    ColorSpace RGBSpace = ColorSpace.getInstance (ColorSpace.CS_LINEAR_RGB);
    ColorConvertOp rgbConvert = new ColorConvertOp (RGBSpace, null);
    BufferedImage output = new BufferedImage (input.getWidth(), input.getHeight(), BufferedImage.TYPE_INT_ARGB);
    return rgbConvert.filter (input, output);
    But this doesn't seem to work.
    please help me
    thanx

    Try this:
    public BufferedImage convertToRGB(BufferedImage input)
    ColorSpace RGBSpace = ColorSpace.getInstance(ColorSpace.CS_sRGB);
    ColorConvertOp rgbConvert = new ColorConvertOp(RGBSpace, null);
    output = rgbConvert.filter(input, null);
    return output;
    }

  • Image to gray scale - jdk 1.6

    Hi , I have been trying to convert an image to gray scale. Source image is gif and has some transparent area. same code if run on java 1.5 works great, Transparent area remains transparent after conversion. But on java 1.6 same code results in black area for transparent area. I have tried multiple methods. All results same.
    I have to run this code on server side, so can not use screen device related APIs.
    Any help would be great. Please help.
    Regards,
    Abhinav

    To get better help sooner, post a SSCCE (Short, Self Contained, Compilable and Executable that shows your present approach in converting to grayscale. For the image, preferably link to a web resource so that members here can run your program without modification.
    Also, you could search the net for "color to gray scale algorithm" where you will find many algorithms, some of which will undoubtedly provide you with a solution.
    db

  • Want to convert an array to image in gray scale

    i have an image that i have read into the vi. using the draw unflattened pixmap , i have an array of numbers .after some mathematical computations on the array i should be able to convert the array back to the image. how can i convert from array to image.and then from image to gray scale?

    I am not sure what you are doing. Can you post a simple example program?

  • How to create an gray scale png image from intensitie​s values

    Hi,
      I would like create a gray scale png image from set of intensities values which is saved in excel sheet . Is IMAQ tool necessary for this vi?
    thanks & regards
    Manoj

    You posted in the feedback forum, which is not correct for your question. I am guessing you are talking about LabVIEW since you mention "vi".
    manojkp89 wrote:
    Is IMAQ tool necessary for this vi?
    The answer is NO. Plain LabVIEW is sufficient.
    LabVIEW Champion . Do more with less code and in less time .

  • Difference between intensity and gray scale value

    Hi I am a new learner of NI vision, please bare with me.
    1. I am quite confused by the terms of light intensity and gray scale value of pixels. Can anyone explain the difference to me? Or are they totally same thing? 
    2. I am currently processing a Grayscale (I16) image file. The bit depth of the image is 12 Bits. But I saw someone used IMAQ Histograph with the Number of Classes set as 8192(13 Bit), don't know why.
    Thanks, Jane
    Solved!
    Go to Solution.

    Hello Jane,
    1. Correct, gray scale and intensity are the same thing.
    2. The number of calsses one selects is a judgement call.  By increasing or decreasing the number of classes the more or less granular the histogram becomes.  Without some context I cannot speculate as to why someone would use 8192 classes.
    David A
    National Instruments
    FlexRIO Product Support Engineer

Maybe you are looking for