944,066 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 26188
  • Java RSS
You are currently viewing page 1 of this multi-page discussion thread
Jun 5th, 2005
0

Comparing Images For Similarity

Expand Post »
Hi,

I was wondering if there was a way to compare two images for similarity (i.e. checking to see if signature is same as signature on a credit card). Thankx in advanced.

--
C++
Reputation Points: 12
Solved Threads: 2
Posting Whiz
Ghost is offline Offline
352 posts
since Aug 2004
Jun 5th, 2005
0

Re: Comparing Images For Similarity

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:

Java Syntax (Toggle Plain Text)
  1. Image one = new Image(...);
  2. Image two = new Image(...);
  3. if(one.equals(two)){
  4. //... true
  5. }
  6. else{
  7. //false
  8. }



I've never really done this, so I don't know how either approach will work out.
Reputation Points: 113
Solved Threads: 19
Postaholic
server_crash is offline Offline
2,108 posts
since Jun 2004
Jun 5th, 2005
0

Re: Comparing Images For Similarity

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....
Reputation Points: 25
Solved Threads: 11
Junior Poster
tonakai is offline Offline
121 posts
since Feb 2005
Jun 5th, 2005
0

Re: Comparing Images For Similarity

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.
Reputation Points: 12
Solved Threads: 2
Posting Whiz
Ghost is offline Offline
352 posts
since Aug 2004
Jun 5th, 2005
0

Re: Comparing Images For Similarity

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
Reputation Points: 25
Solved Threads: 11
Junior Poster
tonakai is offline Offline
121 posts
since Feb 2005
Jun 5th, 2005
0

Re: Comparing Images For Similarity

thanx. i edited my above post and added a few questions. could you help?

Thanks again.
Reputation Points: 12
Solved Threads: 2
Posting Whiz
Ghost is offline Offline
352 posts
since Aug 2004
Jun 5th, 2005
0

Re: Comparing Images For Similarity

I'm going somewhere right now, but I'll get back to you on the questions a little later...Hope you don't mind.

I think the method in pixel grabber is .grabPixels()
Reputation Points: 113
Solved Threads: 19
Postaholic
server_crash is offline Offline
2,108 posts
since Jun 2004
Jun 5th, 2005
0

Re: Comparing Images For Similarity

I dont think .grabPixels returns an array of ints. Second, just so you know, im trying to compare two signatures. they may be slightly different from each other.

thanx.
Reputation Points: 12
Solved Threads: 2
Posting Whiz
Ghost is offline Offline
352 posts
since Aug 2004
Jun 5th, 2005
0

Re: Comparing Images For Similarity

unfortunately, pixel grabber never works.
Reputation Points: 12
Solved Threads: 2
Posting Whiz
Ghost is offline Offline
352 posts
since Aug 2004
Jun 5th, 2005
0

Re: Comparing Images For Similarity

sorry for being vague. when i check if int array one = int array two, it always turns out false. when i check if pixelGrabber.grapPixels() == pixelGrabber.grabPixels() it's always true.

any suggestions ??????????
thanx.
Reputation Points: 12
Solved Threads: 2
Posting Whiz
Ghost is offline Offline
352 posts
since Aug 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Java tests?
Next Thread in Java Forum Timeline: Using User Defined Class to handle Binary Files





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC