3 Replies - 9434 Views - Last Post: 26 February 2009 - 03:19 PM Rate Topic: -----

#1 GokulVS   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 24-February 09

Image comparison

Post icon  Posted 24 February 2009 - 04:54 AM

plz help me to write coding in c#.net for comparing images
Is This A Good Question/Topic? 0
  • +

Replies To: Image comparison

#2 Todilo   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 86
  • Joined: 13-November 07

Re: Image comparison

Posted 24 February 2009 - 04:59 AM

http://tinyurl.com/dytfq8
Was This Post Helpful? 0
  • +
  • -

#3 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6259
  • View blog
  • Posts: 24,028
  • Joined: 23-August 08

Re: Image comparison

Posted 24 February 2009 - 05:27 AM

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Post your code like this: :code:

Thanks.
Was This Post Helpful? 0
  • +
  • -

#4 StCroixSkipper   User is offline

  • D.I.C Head
  • member icon

Reputation: 10
  • View blog
  • Posts: 121
  • Joined: 23-December 08

Re: Image comparison

Posted 26 February 2009 - 03:19 PM

View PostGokulVS, on 24 Feb, 2009 - 03:54 AM, said:

plz help me to write coding in c#.net for comparing images


The easiest way to determine if two image files are identical is to pass the data through an Encryption Hashing function. Here is some code:

		public static byte[] CalcMd5Hash(string filename)
		{
			MD5 md5 = new MD5CryptoServiceProvider();
			FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read);
			byte[] md5Hash = md5.ComputeHash(fs);
			fs.Close();
			fs.Dispose();
			return md5Hash;
		}




If two files calculate the same MD5 hash, the files are almost guaranteed to be identical. Hash collisions are possible but the size of the hash code is 256 bits wide which is a huge number.
Was This Post Helpful? 1

Page 1 of 1