| | |
Comparing Images For Similarity
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jun 2004
Posts: 2,108
Reputation:
Solved Threads: 18
Basicly there's three steps:
> 1. convert the two images to an array of integer.
> 2. compare the two arrays.
> 3. then decide if they're a similar or not.
You convert the two images into an array by creating a PixelGrabber, and then getting the pixels. You can also store colors and compare to make it more accurate.
Now, you can try just comparing Image Objects, but I don't know how accurate that would be:
I've never really done this, so I don't know how either approach will work out.
> 1. convert the two images to an array of integer.
> 2. compare the two arrays.
> 3. then decide if they're a similar or not.
You convert the two images into an array by creating a PixelGrabber, and then getting the pixels. You can also store colors and compare to make it more accurate.
Now, you can try just comparing Image Objects, but I don't know how accurate that would be:
Java Syntax (Toggle Plain Text)
Image one = new Image(...); Image two = new Image(...); if(one.equals(two)){ //... true } else{ //false }
I've never really done this, so I don't know how either approach will work out.
it is a very deep subject and hard one, and comparing pixel-by-pixel is a very slow approch, i suggest you searching "image processing"....
in GIMP's web site you can find source code of this program which is a very good image processing tool....
in GIMP's web site you can find source code of this program which is a very good image processing tool....
server_crash, i tried your second technique and it turns out the images are never the same. I'm going to try your first method. could you please go into a little more detail on the first method. specifically, what method in the pixel grabber class returns an array of ints. thanx.
tonakai, what exactly is gimp? I'm a little confused. thanx for trying to help.
I also have one more question:
How do you copy a pictre to the clipboard
Thanks for all your help. I really appreciate it.
tonakai, what exactly is gimp? I'm a little confused. thanx for trying to help.
I also have one more question:
How do you copy a pictre to the clipboard
Thanks for all your help. I really appreciate it.
gimp is a program like abode photoshop but it is free. and you can have the source code. they may also help you, because these guys are all interested in image processing.
you can also find ready to use image processing libraries, but i am not sure where to look. if you want next year i am going to have a course, so i can give more information
you can also find ready to use image processing libraries, but i am not sure where to look. if you want next year i am going to have a course, so i can give more information
![]() |
Other Threads in the Java Forum
- Previous Thread: java
- Next Thread: switch statement on String in Java
| Thread Tools | Search this Thread |
-xlint android api applet application array arrays automation bi binary blackberry block bluetooth chat class classes client code compile compiler component database developmenthelp eclipse error exception fractal freeze functiontesting game gameprogramming givemetehcodez graphics gui html ide image input integer j2me j2seprojects java javac javaprojects jetbrains jni jpanel jtable julia learningresources lego linux list login loop loops mac map method methods mobile myregfun netbeans newbie notdisplaying number online page print problem program programming project qt recursion scanner screen server set singleton size sms sort spamblocker sql string swing system template textfields threads time title tree tutorial-sample update variablebinding windows working xor






