comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: RMS error
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: RMS error [message #39395 is a reply to message #39392] Tue, 11 May 2004 15:34 Go to previous messageGo to previous message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
"David Fanning" wrote ...
> Julio writes:
>
>> I'd like to calculate Root Mean Square error using a base image and a
>> secondary image. How can I do that? Clues are welcome!
>
> rms_error = Sqrt( Total((img_1 - img2)^2)/N_Elements(img_1) )


A couple of questions:

1) Shouldn't you first cast img_1 and img_2 to something other than byte?
Subtracting byte arrays will result in points that wrap:

IDL> print, 213B-215B
254

When you really want:

IDL> print, 213s-215s
-2


2) Is this correct for true color images? Do you total the square of the
differences for each color plane or do you total the square of the sum of
the differences for each plane? That is:


IDL> print, TOTAL((img_1 - img_2)^2)
56825.0

or:

IDL> dr=reform(img_1[0,*,*] - img_2[0,*,*])
IDL> dg=reform(img_1[1,*,*] - img_2[1,*,*])
IDL> db=reform(img_1[2,*,*] - img_2[2,*,*])

IDL> print, total((dR + dG + dB)^2)
170325.


Now that I think about it the first approach looks correct but since I am
not an image analyst and I don't have even the most basic of references I
thought I would ask.


-Rick
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: graphics_level
Next Topic: IDL - fundamental question about image display

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 23:07:45 PDT 2025

Total time taken to generate the page: 1.76173 seconds