Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

SOLVED: how to make image comparison for web cam image capture

Nikhil Khade:

I am working on image Comparison i have code but I am not able to comparison image and what mistake in that i don't no please help me ( image comparison problem show H:\ error: illegal escape character) pourpose of making this This project is aimed to identify the criminals in any investigation department. Here the technique is we already store some images of the criminals in our database along with his details and that images are segmented into many slices say eyes, hairs, lips, nose, etc. These images are again stored in another database record so to identify any criminals; eyewitnesses will see the images or slices that appear on the screen by using it we develop the face, which may or may not be matched with our images. If any image is matched up to 99% then we predict that he is only the criminal. Thus using this project it provides a very friendly environment for both operator and eyewitness to easily design any face can identify criminals very easy.

package image.analysis.comparison;
import java.awt.Image;
import java.awt.image.BufferedImage;

import javax.imageio.ImageIO;

* Image comparison done here is using pixels

public class ImageComparison {

public boolean compareTwoImages(File fileOne, File fileTwo) {
Boolean isTrue = true;
Image imgOne =;
Image imgTwo =;
BufferedImage bufImgOne =;
BufferedImage bufImgTwo =;
int imgOneHt = bufImgOne.getHeight();
int imgTwoHt = bufImgTwo.getHeight();
int imgOneWt = bufImgOne.getWidth();
int imgTwoWt = bufImgTwo.getWidth();
if(imgOneHt!=imgTwoHt ||(imgOneWt!=imgTwoWt)){
System.out.println(" size are not equal ");
isTrue = false;
for(int x =0; x for(int y =0; y if(bufImgOne.getRGB(x, y) != bufImgTwo.getRGB(x, y) ){
System.out.println(" size are not equal ");
isTrue = false;
}catch (IOException e) {
// TODO Auto-generated catch block
return isTrue;

public static void main(String[] args) {

File f = new File("H:\eropal.png");
File f2 = new File("H:\eropal1.png");
ImageComparison imgComp = new ImageComparison();
System.out.println(imgComp.compareTwoImages(f, f2));



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered

This post first appeared on Stack Solved, please read the originial post: here

Share the post

SOLVED: how to make image comparison for web cam image capture


Subscribe to Stack Solved

Get updates delivered right to your inbox!

Thank you for your subscription