Return to Snippet

Revision: 1704
at November 10, 2006 00:11 by whitetiger


Updated Code
public BufferedImage EdgeW(BufferedImage bi)
	{
		BufferedImage buff = new BufferedImage(bi.getWidth(), bi.getHeight(), bi.getType());
		
		Kernel kernel = new Kernel(3, 3, new float[] {
														-1f, 0f, 1f, 
														-2f, 0f, 2f, 
														-1f, 0f, 1f
													 });
		
		ConvolveOp op = new ConvolveOp(kernel);
		op.filter(bi, buff);
		
		return buff;
	}


	public BufferedImage EdgeH(BufferedImage bi)
	{
		BufferedImage buff = new BufferedImage(bi.getWidth(), bi.getHeight(), bi.getType());
		
		Kernel kernel = new Kernel(3, 3, new float[] {
														-1f, -2f, -1f, 
														 0f,  0f,  0f, 
														 1f,  2f,   1f
													 });
		
		ConvolveOp op = new ConvolveOp(kernel);
		op.filter(bi, buff);
		
		return buff;
	}

Revision: 1703
at November 9, 2006 23:54 by whitetiger


Initial Code
public BufferedImage EdgeW(BufferedImage bi)
	{
		BufferedImage buff = new BufferedImage(bi.getWidth(), bi.getHeight(), bi.getType());
		
		Kernel kernel = new Kernel(3, 3, new float[] {
														-1f, 0f, 1f, 
														-2f, 0f, 2f, 
														-1f, 0f, 1f
													 });
		
		ConvolveOp op = new ConvolveOp(kernel);
		op.filter(bi, buff);
		
		return buff;
	}


	public BufferedImage EdgeH(BufferedImage bi)
	{
		BufferedImage buff = new BufferedImage(bi.getWidth(), bi.getHeight(), bi.getType());
		
		Kernel kernel = new Kernel(3, 3, new float[] {
														-1f, -2f, -1f, 
														 0f,  0f,  0f, 
														 1f,  2f,   1f
													 });
		
		ConvolveOp op = new ConvolveOp(kernel);
		op.filter(bi, buff);
		
		return buff;
	}

Initial URL

                                

Initial Description

                                

Initial Title
Java - EdgeW / EdgeH

Initial Tags
image, java, filter, images

Initial Language
Java