Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
i am checking pixel similarity
original image is-http://puu.sh/5xEyy[^]
image can be split into four different parts
each part is different
code for split image
Java
package testing1;;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
public class imagesplit {
	BufferedImage img;
	static BufferedImage img1;
	static BufferedImage img2;
	static BufferedImage img3;
	static BufferedImage img4;
	public static void main(String[] args) throws IOException {
		BufferedImage img=ImageIO.read(new File("paint1.png"));
		int height=img.getHeight()/2;
		int width=img.getWidth()/2;
		img1=img.getSubimage(0, 0, height, width);
		ImageIO.write(img1, "png", new File("out1.png"));
		img2=img.getSubimage(width, 0, height, width);
		ImageIO.write(img2, "png", new File("out2.png"));
		img3=img.getSubimage(0, height, height, width);
		ImageIO.write(img3, "png", new File("out3.png"));
		img4=img.getSubimage(width, height, width, height);
		ImageIO.write(img4, "png", new File("out4.png"));
		}
	
	}

I want to check group of pixel similarity means i want to match part1,part2,part3,part4 only road pixel if pixel match then display image.
Posted
Updated 2-Dec-13 5:05am
v6
Comments
Sergey Alexandrovich Kryukov 2-Dec-13 10:45am    
Pixels cannot be "similar", they are too small for that; they are either identical, or different... :-)
—SA
baliram bhande 2-Dec-13 10:51am    
sorry i want say identical .mean if when compare two image in that we can check road is present or not mean road connected or not if connected then show

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900