# How to compare pictures in MATLAB ?

Page 1 of 1

## 4 Replies - 21745 Views - Last Post: 29 November 2011 - 12:38 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'https://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=81484&amp;s=ace599b5b14a1c917a7ce6119657123a&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 has5me

Reputation: 0
• Posts: 1
• Joined: 18-January 09

# How to compare pictures in MATLAB ?

Posted 18 January 2009 - 03:51 AM

hello every body...

I want to compare one picture with several pictures saved in a folder, and find the most similar one using Matlab.

any help ?

Is This A Good Question/Topic? 0

## Replies To: How to compare pictures in MATLAB ?

### #2 numerical_jerome

Reputation: 12
• Posts: 167
• Joined: 16-September 07

## Re: How to compare pictures in MATLAB ?

Posted 18 January 2009 - 10:05 PM

MATLAB allows you to import an image file into an 3-d array of integer vales, of the form (XxYx[R,G,B]), using the function "imread()". Please note this is in contrast to the usual "everything on G-ds green earth should be handled internally as an array of doubles"

Once you have the images loaded, you have a number of options for determining what is the "most similar". You could do ANOVA (analysis of variance), and keep the file with the highest confidence. You could convolve the images by interleaving and multiplying the Fourier Transforms together, whichever image results in the largest envelope is the "most similar". You could interleave again and do one of several polynomial curve fits between their differences, "flattest" wins. or you could hybridize these techniques.

I have never worked on this, and could not tell you what silver bullet might give best results, so you will probably have to experiment.

Hope this helps,

-Jerome

### #3 Predictor

Reputation: 12
• Posts: 91
• Joined: 20-September 07

## Re: How to compare pictures in MATLAB ?

Posted 28 March 2009 - 05:40 AM

has5me, on 18 Jan, 2009 - 02:51 AM, said:

I want to compare one picture with several pictures saved in a folder, and find the most similar one using Matlab.

You will need to select a precise definition of "similar" to do this. Simply subtracting one image from the other would only be possible if the images were exactly the same size, and would only be useful under a very restricted set of circumstances. Do you have any further details as to your requirements?

-Will Dwinnell
Data Mining in MATLAB

### #4 bawiskar

Reputation: -3
• Posts: 2
• Joined: 27-February 10

## Re: How to compare pictures in MATLAB ?

Posted 03 October 2011 - 10:50 PM

I want to compare input image with a selected image to check whether it is similar plz provide me the code in matlab or any other language.

### #5 [email protected]

Reputation: -1
• Posts: 1
• Joined: 29-November 11

## Re: How to compare pictures in MATLAB ?

Posted 29 November 2011 - 12:38 AM

has5me, on 18 January 2009 - 03:51 AM, said:

hello every body...

I want to compare one picture with several pictures saved in a folder, and find the most similar one using Matlab.

any help ?

hi sir.....me too want to compare image with images in database....can u help me in writing codes...thank you