Gago-Silva
Gago-Silva

Reputation: 1961

image comparison in R

I am looking for the best way to compare 2 or more images. The images I have are now in matrix format, so basically I am comparing matrices.

They aren't square (but this isn't a problem). This is an example of what I have with only two matrices:

#Original data
M1<-cbind(c(0,0,20,40,50,35),c(0,0,5,20,90,80),c(0,0,10,25,85,0),c(58,70,20,50,0,5))
#Data to be compared with M1
M2<-cbind(c(0,5,25,25,60,15),c(0,30,15,10,116,67),c(0,2,9,20,90,1),c(69,50,22,30,0,2))

I can check for the differences and the correlation, but I also want to be able to say for example, if:

Same thing for low values.

By high values I mean maximum values, for example if the max value in M1 is in position (M1_maxvalue(x,y)), than I M2 max value should be a similar value observed in M1 as well as in the same or close position M1_maxvalue(x,y).

I can extract the positions, the variation of the positions of the maximum values, however I am looking for existent methods where I can base my comparisons.

What type of calculations can I use to do such type of analysis? I can use both image processing packages as well as matrices algorithms.

Upvotes: 3

Views: 3526

Answers (1)

Carl Witthoft
Carl Witthoft

Reputation: 21532

Sounds like a job better handled with ImageJ or SAODS9 at http://hea-www.harvard.edu/RD/ds9/ .

IIRC those apps have built-in tools for spot and blob-finding, which may save you a lot of time and pain.

Upvotes: 2

Related Questions