Splitting an image into seperate RGB colour channels

Hi there everyone,
im pretty new to java and not that great to be perfectly honest : ( Anyhoo, i have to create a CBIR program that accepts an image and then splits it up into its three colour channels -RGB and then creates a histogram to display the frequency of the colour intensity of pixels in the range 0 -255.
However i am struggling to get the image split into the individual colour channels at the start.
I dont expect anyoiine to provide a solution but if anyone could provide any advice on how i could get started, what sort of classes methods to look at i would be most grateful
Many thanks for your time
Craig

Hi Rich123, many thanks for your advice, i'll be looking into those classes. Much appreciated

Similar Messages

  • I have a DAQ Assistant configured to read multiple channels at the same time. When I wire a graph indicator to the output, I see all of my signals jumbled together. How do I split them up into seperate signals?

    I have a DAQ Assistant configured to read 2 channels at the same
    time. When I wire a graph indicator to the output, I see the 2
    signals jumbled together. How do I split them up into seperate signals?
    When I wire any type of indicator it is showing just one output of a single channel.
    I want 2 indicators showing 2 different signals as expected from the 2 channels configured. How to do this?
    I have tried using split signal but it end up showing only 1 output from 1 signal in both the indicators.
    thanks in advance.
    Solved!
    Go to Solution.

    Yes you are right. I tried that but I did not get the result.
    I just found the way. When we launch split signal, we should expand it (split signal icon) from above and not from below. It took me a while to figure out this. 
    thanks 

  • Split an image into average small blocks

    Hi Guys:
    Is there any easy way for me to Split an image into average small blocks ? like following , i don't want to get the size of the entire image , and computer the x,y,hight,wight for every blocks , then use image extract

    Hi Abodefree,
    How many averaged blocks do you need? What size of block (in pixels) are you looking for?
    In genersal terms, what is your application -- why do you require the averaged blocks? Are you looking for the brightest quadrant (for example)? 
    Depending on your application, a convolution filter might be useful...
    -- Dave
    www.movimed.com - Custom Imaging Solutions

  • How convert an image into its RGB value

    i want to find out how to convert an image files such as .gif or .jpg into its RGB value so that i can find out how much amount of a particular colors contain in the image.

    Try this:
    public int countColors(String filename) throws IOException {
    BufferedImage image = ImageIO.read(new FileInputStream(filename));
    Set colors = new HashSet();
    int height = image.getHeight();
    int width = image.getWidth();
    for (int x = 0; x < width; x++) {
    for (int y = 0; y < height; y++) {
    colors.add(new Integer(image.getRGB(x, y)));
    return colors.size();

  • Splitting an image into two links

    OK, I have an image on a site that I would like to split into
    two links. I want the image to be intact, but I would like the
    image invisably split in two, so if you click on one part of the
    image it will take you to a sepearate page to the other half. any
    ideas? Many thanks

    select the image in design view of dw.
    use the "hotspot" tools in the lower left of the Property
    Inspector to draw
    the areas for the two clickable links. See the F1 help.
    Alan
    Adobe Community Expert, dreamweaver
    http://www.adobe.com/communities/experts/

  • How to split audio tracks into left and right channels as we do in FCP or Avid needed for dubbing?

    We are recording in two languages, one in left and the other in right channel. However, in Adobe Premiere Pro we are not able to split the track when we take up for rought cut. Both the tracks are found mixed. Pl help. Since we need to maintian the split track to dubb into other languages.

    You need to do this before adding the footage to the sequence:
    Select the clip (or multiple clips) in the bin
    Menu > Clip > Modify > Audio Channels (Shift G)
    Change 'Number of Audio Tracks' to 2
    Change 'Channel Format' to Mono
    Dismiss the info message.
    When you place the clip in a sequence it will now drop L and R into separate tracks (assuming your sequence allows that audio model).

  • [ask]Split an Image into 2 Icon

    Hi all, here's my problem just hoping any of you willing to help
    let say i have an image 800 x 800 pixels
    i want to store the image in 2 icon
    icon1 contain the image from width 0 to 400 pixels, with same height(800)
    icon2 form 401 to 800 also same height
    but icon1 and icon 2 have width have width and height same as the original image(800x800)
    how can we do this?
    i do a little bit of coding, here it is
    icon  = new ImageIcon("science/Page (1).jpg");
                    createLeftBufferedImages(icon);
                    icon  = new ImageIcon(bi);
                    icon2  = new ImageIcon("science/Page (1).jpg");
                    createRiteBufferedImages(icon2);
                    icon2  = new ImageIcon(bi);and
    public void createLeftBufferedImages(ImageIcon icon) {
                //init_bi();          
                biSrc = new BufferedImage(icon.getIconWidth()/2, icon.getIconHeight()
                        , BufferedImage.TYPE_INT_RGB);                   
                Graph  = biSrc.createGraphics();           
                Graph.drawImage(icon.getImage(), 0, 0, icon.getIconWidth(), icon.getIconHeight(),this);         
                bi=biSrc;
            public void createRiteBufferedImages(ImageIcon icon) {           
                biSrc = new BufferedImage(icon.getIconWidth()/2, icon.getIconHeight()
                        , BufferedImage.TYPE_INT_RGB);                               
                Graph  = biSrc.createGraphics();           
                Graph.drawImage(icon.getImage(), 0, 0, icon.getIconWidth(), icon.getIconHeight(),this);
                bi=biSrc;
            }but the problem i cant get the icon2 properly..
    how i solve this problem?
    thx

    but the problem i cant get the icon2 properly..How do you know this? Your code does nothing with the icon2 variable. Just because the icon2 variable is assigned a new Oject, does not mean the GUI will automatically display the icon. You still need to invoke a method like:
    labelTop.setIcon( icon2);
    If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.

  • Photoshop - combine red and green channel images into a merged image?

    Hi,
    I am a developmental biologist carrying out experiments on a type of microscope known as a Confocal Laser Scanning Microscope (CSLM).  Basically, this is a microscope coupled to some lasers which allow fluorescently-labelled parts of a biological sample to be imaged in high detail.
    For each sample there will be a set of two images produced, named and numbered as follows:
    sample01_g.tif
    sample01_r.tif
    Each image represents one fluorescent wavelength and correspond to green ( g ) and red ( r ).  These images are in rgb colour.
    I want to produce a merge of these two channels to generate a new TIFF file such that:
    Green channel is taken from sample01_g.tif
    Red channel is taken from sample01_r.tif
    Which would show me how the different channels co-localise, or not.
    This is fine to do by hand in Photoshop, but takes a long time when you have a couple of hundred images to process.  So, what I would like to do is write a script that batch automates the process, like a droplet.  I have the process outlined below:
    Create a new RGB TIFF called sample01_merge.tif
    Take the green channel from sample01_g.tif and copy it to the green channel of sample01_merge.tif
    Take the red channel from sample01_r.tif and copy it to the red channel of sample01_merge.tif
    Save sample01_merge.tif into a folder named "Merged Images" on the desktop
    Close the opened images
    Go to next set of images –> sample02_g.tif and sample02_r.tif
    Create a new RGB TIFF called sample02_merge.tif....and go through step 2-6, untill the last set of images has been processed.
    I have never used script before and would love to learn, but I am making slow progress and would like to have this problem solved sooner than I will be able to do so by myself.  So... I was wondering if anyone could give me some advice on how to go about doing this?
    Any help will be greatly appreciated!
    I use a Mac Pro running OSX 10.8.3 and Photoshop CS6 Extended
    Best regards,
    John

    Yes, as I said it wasn't finished and wasn't meant to be used. It was just to show that working with image sets based on a name pattern is easy.
    Here is a version that does do the merge and save using applyImage.
    Note: for applyImage to work the images in each set need to be the same size. Some of your jpeg samples were not. This worked with one set by not the other.
    // make a reference to the savedFolder
    var savedFolder = new Folder('~/desktop/Merged Image');
    // create the folder if it doesn't exists
    if(!savedFolder.exists) savedFolder.create();
    // get the source folder from the user and store in variable
    var sourceFolder = Folder.selectDialog();
    // make sure user selected a folder
    if(sourceFolder != null){
        // get an array of red images and store in variable
        var sourceFiles = sourceFolder.getFiles(/_r\.tif$/i);
        // make a loop to process all found sets.
        for(var i = 0; i < sourceFiles.length;i++){
            var redName = sourceFiles[i].name;
            var greenName = redName.replace('_r','_g');
            var redImage = open(sourceFiles[i]);// open the red file and store reference to document
            var greenImage = open(new File(sourceFolder+'/'+greenName));// open the green file and store reference that document
            // now select each channel and apply matching channel in redImge using lighten mode
            app.activeDocument.activeChannels = [app.activeDocument.channels.getByName(localize('$$$/ColorModes/RGB/ChannelName/Red=Red'))];
            applyChannel( charIDToTypeID( "Rd  " ), redImage.name );
            app.activeDocument.activeChannels = [app.activeDocument.channels.getByName(localize('$$$/ColorModes/RGB/ChannelName/Green=Green'))];
            applyChannel( charIDToTypeID( "Grn " ), redImage.name );
            app.activeDocument.activeChannels = [app.activeDocument.channels.getByName(localize('$$$/ColorModes/RGB/ChannelName/Blue=Blue'))];
            applyChannel( charIDToTypeID( "Bl  " ), redImage.name );
            // select the componet channel( rgb )
            selectComponentChannel();
            // save the merged document
            SaveAsTIFF(savedFolder+'/'+redName.replace(/_r\.tif$/i,'_merged.tif'),true);
            // close the open documents for next loop
            redImage.close(SaveOptions.DONOTSAVECHANGES);
            greenImage.close(SaveOptions.DONOTSAVECHANGES);
    function applyChannel( channelID, documentName ){
        // charIDToTypeID( "Rd  " )
        // charIDToTypeID( "Grn " )
        // charIDToTypeID( "Bl  " )
        var desc = new ActionDescriptor();
        var channelsDesc = new ActionDescriptor();
        var ref = new ActionReference();
        ref.putEnumerated( charIDToTypeID( "Chnl" ), charIDToTypeID( "Chnl" ), channelID);
        ref.putProperty( charIDToTypeID( "Lyr " ), charIDToTypeID( "Bckg" ) );
        ref.putName( charIDToTypeID( "Dcmn" ), documentName );
        channelsDesc.putReference( charIDToTypeID( "T   " ), ref );
        channelsDesc.putEnumerated( charIDToTypeID( "Clcl" ), charIDToTypeID( "Clcn" ), charIDToTypeID( "Lghn" ) );
        channelsDesc.putBoolean( charIDToTypeID( "PrsT" ), true );
        desc.putObject( charIDToTypeID( "With" ), charIDToTypeID( "Clcl" ), channelsDesc );
        executeAction( charIDToTypeID( "AppI" ), desc, DialogModes.NO );
    function SaveAsTIFF( inFileName, inLZW ) {
        var tiffSaveOptions = new TiffSaveOptions();
        if ( inLZW ) {
            tiffSaveOptions.imageCompression = TIFFEncoding.TIFFLZW;
        } else {
            tiffSaveOptions.imageCompression = TIFFEncoding.NONE;
        app.activeDocument.saveAs( File( inFileName ), tiffSaveOptions );
    function selectComponentChannel() {
        try{
            var map = {}
            map[DocumentMode.GRAYSCALE] = charIDToTypeID('Blck');
            map[DocumentMode.RGB] = charIDToTypeID('RGB ');
            map[DocumentMode.CMYK] = charIDToTypeID('CMYK');
            map[DocumentMode.LAB] = charIDToTypeID('Lab ');
            var desc = new ActionDescriptor();
                var ref = new ActionReference();
                ref.putEnumerated( charIDToTypeID('Chnl'), charIDToTypeID('Chnl'), map[app.activeDocument.mode] );
            desc.putReference( charIDToTypeID('null'), ref );
            executeAction( charIDToTypeID('slct'), desc, DialogModes.NO );
        }catch(e){}

  • Converting U8 image into RGB

    I have a pixelink camera that when I run through the IMAQdx vi's, it produces a BW image.  When I view the image, I can select from the palette bar when I right click on the image out display and select rainbow, temperature, etc....but I can't save these colored images.  I'm guessing that the image out viewer converts the U8 image into a RGB image for display.  I would expect that there would of been a VI (or maybe there is and I haven't seen it) that would do this task and allow you to save the image as a RGB.  Is there a VI to do this?
    Thanks,
    guilio_2008

    Do you have the NI Vision Development Module? If so, this sloppy little bit of code will let you change an image palette on the fly, then save out a copy of the color image you see. You can also choose a user defined palette and create your own palette with the color ramp next to the window.
    -root
    Message Edited by Root Canal on 05-05-2009 11:11 AM
    global variables make robots angry
    Attachments:
    happy colors.vi ‏67 KB
    forbidden planet.png ‏629 KB
    happy colors.PNG ‏211 KB

  • Split image into clickable sections

    Hi, I was wondering if anyone know how to split an image into several clickable sections. I am trying to make the game "Risk", and I am sort of stuck at this problem. I have been thinking of making an individual image button for every country with the respective country as image, but I hope there is a better way to do this. The best would be to just split the world map into country sections.
    Thank you in advance
    OhM

    A naive (but possibly sufficient) implementation could just be to keep a table mapping (x,y) pairs to countries. To keep the table smaller, you could map 10x10 blocks of pixels to countries.
    Ultimately this is about storing and then managing data.
    One hack (in my opinion) is to check the color of the clicked pixel in the image of the map. But that is nasty for a variety of reasons (such as, it keeps you from being able to easily change the map image, and things like text in the map (like the names of countries) kind of screws that up. But it's an option.
    You can also keep lists of pixels in sequence describing a polygon, and then use certain algorithms (which I don't recall right now) to determine whether a given point is inside or outside a given polygon.
    Also you can do things like "binary space partitions", I think.
    These last two things are computer graphics techniques, and are non-trivial to implement. I dimly recall them from college but recall no details. You can get a computer graphics textbook (which tend to be expensive) to get more info, or these days there's probably a wiki about it somewhere.
    But I'd suggest keeping it modular. Add a layer of abstraction, writing an API around this functionality. Then write an implementation with a simple table of locations or blocks of locations, and if this proves to be insufficient later, swap it out with something more sophisticated.

  • Converting greyscale images to single spot colour

    Hi there.
    I’m trying to convert a greyscale image into a single spot colour image. The spot colour is PMS425C, a grey version but as I’m only printing 2 colours I need to convert these images into one spot colour.
    Can somebody please assist?
    Thanks

    Did you see the monotone separated into cmyk?  If so, you may not be making the PDF correctly and the spot is being converted. It can still have cmyk channels but they are empty and will not end up as plates.  Check your output to PDF settings and make sure in the ink manager that spots are retained.  Also, there is more than one way to view in output preview which can be confusing at first.
    You should be exporting as PDF X/1a and if your settings are correct, when you view in output preview (separations)  in Acrobat, you should see the spot as spot.
    Try saving your monotone as .psd too many other formats will not support the monotone.  If you view separations in ID, you will be able to see if your file actually supports spot colour.

  • Read a excel file and split its sheets to seperate file ?

    Dear all :
    How to split a excel file into several file, each have one sheet.my code is as below,thanks:
    import org.apache.poi.hssf.usermodel.*;
    import java.io.*;
    import java.util.*;
    import org.apache.poi.poifs.filesystem.*;
    public class Extractxls {
    public static void main(String[] args) throws Exception
    try {
    POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(args[0]));
    HSSFWorkbook wb = new HSSFWorkbook(fs);
    int sheetCount = wb.getNumberOfSheets();
    System.out.println(sheetCount);
    try {
         while(sheetCount > 0) {
         sheetCount--;
         HSSFWorkbook wb1 = new HSSFWorkbook();
         HSSFSheet s = wb1.createSheet();
         String sheetName = wb.getSheetName(sheetCount);
         HSSFSheet sheet = wb.getSheet(sheetName);
    //     HSSFSheet sheet = wb.getSheetAt(sheetCount);
         System.out.println(sheet.toString());
         s = sheet;
    FileOutputStream fileOut = new FileOutputStream("atest" + sheetCount + ".xls");
    wb.write(fileOut);
    fileOut.close();
    } catch (Exception e) {
         System.err.println("Error: " + e.getMessage());
    } catch (Exception e) { e.toString();}

    The HSSFWorkbook class is part of the POI project:
    http://jakarta.apache.org/poi/
    Regards,
    Dave Gilbert
    JFreeChart Project Leader
    I understand poi porject, my problem is that POI can not read a excel file and split its sheets into seperate file (each have one sheet) ?Does any one know how to do it.

  • Spltting an image into its red green and blue components

    Hi,
    I need to split an image into 3 images, one the red component of the original image, one the green component, and one the blue.
    Any idea how this can be done?

    Hi,
    something along these lines:
    Robot robot = new Robot();
    // loop: get color for each pixel in image
    Color pixelColor = robot.getPixelColor(x, y);
    int red = pixelColor.getRed();
    int green = pixelColor.getGreen();
    int blue = pixelColor.getBlue();
    // do your stuff with these values
    Cheers,
    Jim

  • Wall decals over size.. functionality to cut image into piece on artboard ?

    1- I am doing wall decals, I am drawing a big tree (7 foot long). My vinyl roll size in 24 inches. Is there a functionality in Adobe Illustrator CS5.5 to split the image into section ready to cut ? My cutting software can do it but I want to do it in illustrator... is there a way ???
    2- I am not able to find information on how illustrator can help me to place the objects on the artboard (with spaces between each objects) to maximize the vinyl space available without have to place each object by hand one by one.
    Thanks Nancy

    This kind of stuff (vinyl cutting project setup) was a pain to do in Illustrator prior to its finally (literally decades late to the game) acquiring the ability to have more than one page in a file. It's still a pain comparitive to Adobe's other vector drawing program (FreeHand), due to Illustrator's still-yet-to-appear ability to draw to user-defined scale.
    This is how I routinely do it in FreeHand:
    1. Draw the whole design at a comfortable scale (ex: 1"=1') on a convenient page size (ex: tabloid, so I can print it on a desktop printer). Define spot color Swatches for each vinyl.
    2. When the design is done, add pages (one for each vinyl to be used) with either height or width the actual width of my vinyl (ex: 24"). Set ruler guides on each page to indicate what I consider a comfortable "maximum cut width" for the gripper/roller margin of my machine.
    3. Select all elements of a single vinyl color, duplicate them to one of the full-size pages. Do this for each vinyl.
    4. Scale the elements to actual size (ex: 1200%).
    5. For an element too large for the maximum cut width, place a pair of ruler guides separated by the amount of desired overlap (ex: .25").
    6. Duplicate the object in place. Use the Knife tool to slice the object along one of the guides. Delete the unwanted piece.
    7. Similarly cut the remaining (original) copy along the other guide. Delete the unwanted piece.
    8. Freely arrange (move and/or rotate) each of the pieces so as to maximize vinyl usage on each vinyl-specific page. Drag length of vinyl pages to fit final arrangement.
    9. Export the full-size pages only.
    10. Open the exports in my cutter driver software, and cut.
    I leave it to you to translate the same basic operations to Illustrator. Some of the reasons I still find Illustrator inferior for this:
    Still no support for user-defined ruler scales.
    Very unreliable snaps behavior at zooms.
    The infernal "Global" swatch designation.
    Pages interface (like many things) needlessly cumbersome compared to FreeHand's. (Separate "Artboard mode" is tedious for arranging Artboards, making page-specific guides, snapping Artboards to grid and to each other.)
    Inferior behaviors of Boolean path operations ("Pathfinders"). (Ex: converting compound paths to groups.)
    Inferior cutting tools (Ex: releasing compound of compound paths; failure to handle open, unfilled paths.)
    JET

  • Colours desaturate when I copy and paste an image into another file

    I'm using Illustrator CS4 with Windows Vista, 4GB RAM. I've created an image using lots of gradients and different shades of colour, and have tried copying it into a new file, but all the colours in the copied image are desaturated. For instance, a blue with an RGB value of 95 179 255, becomes 114 174 223 in the copied image. All the colours are similarly desaturated. It's very annoying! Anyone had a similar problem, or have any idea what's happening?

    Jacob,
    I am using Illustrator CS (ver.11.0.0) and all of my docs are cmyk. It might help you to know that this: the cmyk values in the original document were assigned as: c100 m55 y0 k0. When I close the doc and reopen it, the values change to: c93.74 m55.69 y2.35 k0. I don't understand why. Can you help?

Maybe you are looking for