JAVA codes for Image Comparison

Hi.. Am looking for appropriate java codes for Comparing images.. I searched thru net but no apt codes related 2 it.. Anybody 2 help me out thre???😔

Replies

  • Reya
    Reya
    You mean to compare two images whether they are equal?
  • GULNAZ KMT
    GULNAZ KMT
    Yup.. Irrespective of size of the image, I need to write a JAVA code, where it'l compare the image given as an input with another image already contained in my database and return true if comparison matches. For Eg., if I give an image of computer, my code should be able to compare with images of computer in my database and return the o/p.. Database codin part, leave it upto me. I just need help in, how Java compares two images..
  • Ankita Katdare
    Ankita Katdare
    Hi Gulnaz,

    I searched for your query on the net and found this result:

    Mind Meat: Java Image Comparison / Motion Detection

    Does that help?
  • Ankita Katdare
    Ankita Katdare
    Here is some information about processing pixels in an image using Java :

    #-Link-Snipped-#
  • Morningdot Hablu
    Morningdot Hablu
    Sorry for late reply actually i am busy in exams.
    Well i have an idea how to compare two images check this code.
    Use it to compare two images hope it works.But it's just an idea you can edit it on your own way.
    import javax.swing.*;
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    /**/
    public class comp extends JApplet implements ActionListener
    {
    Button b;
    String str,str1;
    public void init()
    {
    b=new Button("submit");
    add(b);
    setLayout(new FlowLayout());
    b.addActionListener(this);
    }
    public void actionPerformed(ActionEvent e)
    {
    repaint();
    byte b1[]=new byte[60000];
    byte b2[]=new byte[60000];
    try
    {
    int i=0;
    FileInputStream f1=new FileInputStream("kk.jpg");
    f1.read(b1);
    FileInputStream f2=new FileInputStream("kk1.jpg");
    f2.read(b2);
    while(b1!=3 || b2!=3)
    {
    if(b1==b2)
    i++;
    else
    {
    str="not matched";
    break;
    }
    }
    if(b1[i-1]==b2[i-1])
    {
    str="matched";
    str1=Integer.toString(i);
    }
    }
    catch(Exception ee)
    {
    System.out.println("Exception caught");
    }
    }
    public void paint(Graphics g)
    {
    g.drawString(str,100,100);
    g.drawString(str1,200,200);
    }
    }

You are reading an archived discussion.

Related Posts

Hi all, Just yesterday i had unknowingly formatted my external hard drive! (that is 450 GB of data which includes office works, personal stuff, music, movies and all). I was...
Puzzle Taken From: Puzzles and Tests Once upon a time, Mars, the God of war, intended to test the IQ of the goddess Minerva. So, showing his shield, he told...
1. Ashland is north of East Liverpool and west of Coshocton. 2. Bowling green is north of Ashland and west of Fredericktown. 3. Dover is south and east of Ashland....
Hi guys. Please, help me to find any circuit diagram for LED display module. In this module is applied a drivers MBI5030GF for each 16 LEDs CPLD: EPM3064Ati100-10N and HC245....
Is there any IC to be used as a DAC converter?? regards