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.

Similar Messages

  • 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

  • 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 ?

  • 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 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.

  • 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

  • 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

  • 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

  • Need Help for Image Processing

    Hi everyone,
    my name is Davide and I am a new member. I apologize in advance for my English that It's not very good.
    I have to do an exercise where I have to draw a SAR(Synthetic Aperture Radar) Image. The problem is that the input image is composed by a binary raster plus an XML parameters file. The XML file contains all the information to correctly read the image.
    I downloaded Java Advancing Imaging Library but I've never worked with this image format and I don't know where to start.
    Can anyone help me? How should i do with the binary raster file? How can i read it?
    Thank you very much.

    Hi everyone again,
    I followed your advice and I studied the theory on raster data so I have made some step forward. Now I have a new problem that I will try to explain you in the better way. I was able to obtain from the binary raster data an array of float.
    From the XML parameters file I know that the rows number are 1000, the columns number are 2000, the pixel type is complex float and that the real and imaginary parts are put side-by-side on a column basis. I created two array, one of the real parts and one of the imaginary parts:
    for (int i=0;i < SIZE_X*SIZE_Y; i++){
       if(i%2 == 0){
          real[k] = bin_input;
    if(Math.abs(real[k]) > max_value_re){
    max_value_re = Math.abs(real[k]);
    k++;
    }else{
    img[n] = bin_input[i];
    if(Math.abs(img[n]) > max_value_im){
    max_value_im = Math.abs(img[n]);
    n++;
    Then I create an array with the absolute value of complex number:for (int i=0;i < SIZE_X/2*SIZE_Y; i++){
    mag[i] = (float) (Math.sqrt(Math.pow(real[i]/max_value_re,2) + Math.pow(img[i]/max_value_im,2)));
    Now I have an array of float with values from 0 and 1. I tried to create a gray scale image because in the XML file it says that the number of channels is 1:BufferedImage theImage = new BufferedImage(SIZE_X/2, SIZE_Y, BufferedImage.TYPE_4BYTE_ABGR);
    WritableRaster wr = (WritableRaster) theImage.getData();
    wr.setPixels(0, 0, SIZE_X/2, SIZE_Y, mag);
    File outputfile = new File("C:\\Sviluppo\\workspace\\Java\\SAR\\Milano.png");
    try {
    ImageIO.write(theImage, "png", outputfile);
    } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    The problem is that the image is all black as if the method is not able to interpret the float values and puts everything at zero.
    First of all, do you think the process can be right or is there some logical/theorical error? If it's ok, How can I fix the problem?
    Thank you.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • 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;
    }

  • 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

  • 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 .

Maybe you are looking for

  • ATG Endeca CRS Integration baseline_update.bat fails

    Hi, I have deployed the CRS through cim.bat and after that I am trying to run the following scripts and fails with the below errors. I am able to deploy the dicsover application that comes with the Endeca. Here are the steps I am trying to do after d

  • ABAP Dictionary Activation Ended with errors - View missing

    [http://www.flickr.com/photos/38387539@N02/4393402777/] [http://www.flickr.com/photos/38387539@N02/4393402771/] Hi All, I transported a table with additional new fields to production system but the transport log shows that the table could not be acti

  • SLD- Same business System

    Hi, I have an APO system which has developement and production only. We had developed an interface via PI where PI environments are in Dev/QA/Regression and Production. Our SLD is shared between DEV/QA/Regression and separeate SLD in Production. I am

  • Clearing down messages from Error Topic

    We are using AIA Foundation Pack 2.3 and trung to develop interfaces between JDE and eBusiness Suite. I am running some test scenarios which are failing and it is kicking off the AIA BPEL Error Handling. From what I can see it writes the error messag

  • Enhancement M06E0004, EXIT_SAPLEBND_002, ZXM06U22

    Hi Experts, I am writing some logic while PO creation in the user exist ZXM06U22. As per my understanding this user exit should trigger for all the company code but its getting triggere for only few company code, I am not able to understand why its n