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