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 :)
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
Cheers :)