Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RMS contrast (image processing)- Am I correct?

547 views
Skip to first unread message

N N

unread,
Jul 3, 2008, 4:05:09 AM7/3/08
to
Dear All,
Could you offer some comments/suggestions regarding my
queries on image processing?

Aim 1: To find RMS contrast of an image (m code - below)
---------------------------------------
a=imread('pout.tif'); %including this image as it may be
available to all

b=double(a);%I guess all image files are stored as "uint";
so, I have converted them to "double" precision values

c=b/255; %gives me the pixel values between 0 and 1; did
this step as I want to see smaller values.

mean_pixels=mean(mean(c));

rms_cont=sqrt(sum((c(:)-mean_pixels).^2)) % I was hoping
that this would be between 0 and 1 (not the case)
-------------------------------------------------
Aim 2: To develop a group of images that have similar RMS
contrast (I do have images)

My queries:

1. As for aim 1 is concerned, is that the right way to
find RMS contrast of an image? Before developing this code
I was expecting the answer to be between 0 and 1 (not the
case); perhaps it goes to >100 for some images I’ve
developed (am questioning my own understanding therefore)

2. As for aim 2 is concerned, I intend to use ‘imadjust’
command to adjust the pixel values without compromising
image quality to acquire images with similar RMS contrast.

Thanks in advance for your time :)

Adam

unread,
Jul 3, 2008, 11:38:02 AM7/3/08
to
"N N" <cvlm...@hotmail.com> wrote in message
<g4i17l$ecp$1...@fred.mathworks.com>...

Aim 1: Looks to me like you're taking the standard deviation
of the image.

RMS => Root Mean Squared

sqrt(mean(c(:).^2))

also mean(c(:)) is a little faster than mean(mean(c)), would
be more noticeable on bigger images, or processing multiple
images (which it sounds like you do).

Not sure what significance RMS has to an image.

Aim 2: so you're "normalizing" the images? It affects the
contrast, not sure if that's part of the "quality"

~Adam

N N

unread,
Jul 7, 2008, 12:35:02 AM7/7/08
to
Thanks, Adam. Help is much appreciated. Yes, I was
calculating the SD instead of RMS, until you pointed out.

Cheers :)

0 new messages