Results 1 to 2 of 2
Thread: green channel extraction
- 01-27-2012, 11:28 AM #1
Member
- Join Date
- Jan 2012
- Posts
- 4
- Rep Power
- 0
green channel extraction
i'm trying to mask non-green and alpha channels from images. The following code worked for single image but when i tried working for multiple images i get a black image as output, instead of green. Can anyone help me?
Java Code:public class green { private Vector<Integer> w = null; private Vector<Integer> h = null; private int pixelCol; private BufferedImage[] g=null; public BufferedImage[] MaskNongreen(BufferedImage bi[]) // input images array { w = new Vector<Integer>(); h = new Vector<Integer>(); g=new BufferedImage[bi.length]; for(int i=0;i<bi.length;i++) { w.add(bi[i].getWidth()); h.add(bi[i].getHeight()); g[i]=new BufferedImage(w.get(i),h.get(i),bi[i].getType()); for (int x=0; x < w.size(); x++) { for (int y = 0; y <h.size(); y++) { pixelCol=bi[i].getRGB(x,y); pixelCol &= 0x0FF00FF00; //masks nongreen and alpha g[i].setRGB(x, y, pixelCol); } } } return g; } }
- 01-27-2012, 12:14 PM #2
Member
- Join Date
- Jan 2012
- Posts
- 4
- Rep Power
- 0
Similar Threads
-
10 green bottles
By Dave013 in forum New To JavaReplies: 2Last Post: 10-25-2011, 07:41 PM -
Why do I get this green text?
By thestubbsinator in forum New To JavaReplies: 5Last Post: 06-07-2010, 01:04 PM -
[SOLVED] Expected Range: Red Green Blue
By AndrewM16921 in forum New To JavaReplies: 1Last Post: 04-03-2009, 08:59 PM -
Need Support for Using Network service providers channel to carry speech
By Nagasubramanian in forum Sun Java Wireless ToolkitReplies: 0Last Post: 02-13-2009, 01:10 PM -
Help with Java IRC Chat Channel
By sari in forum New To JavaReplies: 1Last Post: 02-03-2009, 08:21 AM
Bookmarks