Can someone please tell me what is the use of normalizing
an image? i've read that, this is to remove the effect of
any change in intensity.
can i make the intensity of 2 images similar or same?
"Choo " <cyching84@yahoo.com.au> wrote in message
<g3c94m$d66$1@fred.mathworks.com>...
> Can someone please tell me what is the use of normalizing
> an image? i've read that, this is to remove the effect of
> any change in intensity.
> can i make the intensity of 2 images similar or same?
>
> and,how to do normalizing?
Indeed you are right, converting an RGB image into
normalized RGB removes the effect of any intensity
variations. An interesting experiment is to take a
photograph of something like a single colour Rose flower,
Converting this into normalized RGB converts the rose to an
amorphous blob of colour, as all of the detail of the
flower is caused by a gentle change in intensity caused by
the shadowing of the petals.
How to do it is quite simple
1) Split your RGB image into three seperate greyscale
images representing the red, green, blue colour planes
2) For each pixel in the image take the three corresponding
components from the red, green, blue matrices - calculate
the following (Remember to cast into doubles, else you will
get zero on your division)
Apply these transformations to evey pixel in the image.
3) Reform a colour image back into UINT8 (you need to
additionally scale the image by a factor of sqrt(3) to get
fully saturated colour representation). Restack the three
normalized planes to form an RGB image, and display. From
memory one of the many ways to do this is
Image_normalizedRGB = cat3(NormalizedRed,NormalizedGreen,
NormalizedBlue);
4) Things to watch for - when you get a true black pixel
Red = Green = Blue = 0, so your transformation equation
will try to compute 0/0 and fall over laughing, catch this
possibility and set the ratio to (1/sqrt(3)) which is
normalized grey. Also look out for noise in the image that
sometimes occurs in regions that were very dark in the
original image.
For speed you might get away with the approximation.
NormalizedRed` = Red/(Red + Green + Blue); etc
Normalizing can provide exactly what you need to compare
two images taken under variations of illumination PROVIDING
the colour temperature of the light source doesn't change
as the illumination output varies. e.g. a Tungsten lamp
will generate a cooler colour temperature if driven with a
lower voltage, so this might give problems - however
variation in daylight caused by clouds, or other shadowing
is easily taken out.
"Dave Robinson" <dave.robinson@somewhere.biz> wrote in
message <g3da0i$mb$1@fred.mathworks.com>...
> "Choo " <cyching84@yahoo.com.au> wrote in message
> <g3c94m$d66$1@fred.mathworks.com>...
> > Can someone please tell me what is the use of
normalizing
> > an image? i've read that, this is to remove the effect
of
> > any change in intensity.
> > can i make the intensity of 2 images similar or same?
> >
> > and,how to do normalizing?
>
> Indeed you are right, converting an RGB image into
> normalized RGB removes the effect of any intensity
> variations. An interesting experiment is to take a
> photograph of something like a single colour Rose flower,
> Converting this into normalized RGB converts the rose to
an
> amorphous blob of colour, as all of the detail of the
> flower is caused by a gentle change in intensity caused
by
> the shadowing of the petals.
>
> How to do it is quite simple
>
> 1) Split your RGB image into three seperate greyscale
> images representing the red, green, blue colour planes
>
> Image_red = Image_rgb(:,1);
> Image_green = Image_rgb(:,2);
> Image_blue = Image_rgb(:,3);
>
> 2) For each pixel in the image take the three
corresponding
> components from the red, green, blue matrices - calculate
> the following (Remember to cast into doubles, else you
will
> get zero on your division)
>
> NormalizedRed = r/sqrt(Red^2 + Green^2 + Blue^2);
> NormalizedGreen = g/sqrt(Red^2 + Green^2 + Blue^2);
> NormalizedBlue = b/sqrt(Red^2 + Green^2 + Blue^2);
>
> Apply these transformations to evey pixel in the image.
>
> 3) Reform a colour image back into UINT8 (you need to
> additionally scale the image by a factor of sqrt(3) to
get
> fully saturated colour representation). Restack the three
> normalized planes to form an RGB image, and display. From
> memory one of the many ways to do this is
> Image_normalizedRGB = cat3(NormalizedRed,NormalizedGreen,
> NormalizedBlue);
>
> 4) Things to watch for - when you get a true black pixel
> Red = Green = Blue = 0, so your transformation equation
> will try to compute 0/0 and fall over laughing, catch
this
> possibility and set the ratio to (1/sqrt(3)) which is
> normalized grey. Also look out for noise in the image
that
> sometimes occurs in regions that were very dark in the
> original image.
>
> For speed you might get away with the approximation.
>
> NormalizedRed` = Red/(Red + Green + Blue); etc
>
> Normalizing can provide exactly what you need to compare
> two images taken under variations of illumination
PROVIDING
> the colour temperature of the light source doesn't change
> as the illumination output varies. e.g. a Tungsten lamp
> will generate a cooler colour temperature if driven with
a
> lower voltage, so this might give problems - however
> variation in daylight caused by clouds, or other
shadowing
> is easily taken out.
>
> Hope that helps
>
> Regards
>
> Dave Robinson
>
>
Whoops Sorry
"Dave Robinson" <dave.robinson@somewhere.biz> wrote in
message <g3dcfr$i92$1@fred.mathworks.com>...
> "Dave Robinson" <dave.robinson@somewhere.biz> wrote in
> message <g3da0i$mb$1@fred.mathworks.com>...
> > "Choo " <cyching84@yahoo.com.au> wrote in message
> > <g3c94m$d66$1@fred.mathworks.com>...
> > > Can someone please tell me what is the use of
> normalizing
> > > an image? i've read that, this is to remove the
effect
> of
> > > any change in intensity.
> > > can i make the intensity of 2 images similar or same?
> > >
> > > and,how to do normalizing?
> >
> > Indeed you are right, converting an RGB image into
> > normalized RGB removes the effect of any intensity
> > variations. An interesting experiment is to take a
> > photograph of something like a single colour Rose
flower,
> > Converting this into normalized RGB converts the rose
to
> an
> > amorphous blob of colour, as all of the detail of the
> > flower is caused by a gentle change in intensity caused
> by
> > the shadowing of the petals.
> >
> > How to do it is quite simple
> >
> > 1) Split your RGB image into three seperate greyscale
> > images representing the red, green, blue colour planes
> >
> > Image_red = Image_rgb(:,1);
> > Image_green = Image_rgb(:,2);
> > Image_blue = Image_rgb(:,3);
> >
> > 2) For each pixel in the image take the three
> corresponding
> > components from the red, green, blue matrices -
calculate
> > the following (Remember to cast into doubles, else you
> will
> > get zero on your division)
> >
> > NormalizedRed = r/sqrt(Red^2 + Green^2 + Blue^2);
> > NormalizedGreen = g/sqrt(Red^2 + Green^2 + Blue^2);
> > NormalizedBlue = b/sqrt(Red^2 + Green^2 + Blue^2);
> >
> > Apply these transformations to evey pixel in the image.
> >
> > 3) Reform a colour image back into UINT8 (you need to
> > additionally scale the image by a factor of sqrt(3) to
> get
> > fully saturated colour representation). Restack the
three
> > normalized planes to form an RGB image, and display.
From
> > memory one of the many ways to do this is
> > Image_normalizedRGB = cat3
(NormalizedRed,NormalizedGreen,
> >
NormalizedBlue);
> >
> > 4) Things to watch for - when you get a true black
pixel
> > Red = Green = Blue = 0, so your transformation equation
> > will try to compute 0/0 and fall over laughing, catch
> this
> > possibility and set the ratio to (1/sqrt(3)) which is
> > normalized grey. Also look out for noise in the image
> that
> > sometimes occurs in regions that were very dark in the
> > original image.
> >
> > For speed you might get away with the approximation.
> >
> > NormalizedRed` = Red/(Red + Green + Blue); etc
> >
> > Normalizing can provide exactly what you need to
compare
> > two images taken under variations of illumination
> PROVIDING
> > the colour temperature of the light source doesn't
change
> > as the illumination output varies. e.g. a Tungsten lamp
> > will generate a cooler colour temperature if driven
with
> a
> > lower voltage, so this might give problems - however
> > variation in daylight caused by clouds, or other
> shadowing
> > is easily taken out.
> >
> > Hope that helps
> >
> > Regards
> >
> > Dave Robinson
> >
> >
> Whoops Sorry
>
> NormalizedRed = r/sqrt(Red^2 + Green^2 + Blue^2);
> NormalizedGreen = g/sqrt(Red^2 + Green^2 + Blue^2);
> NormalizedBlue = b/sqrt(Red^2 + Green^2 + Blue^2);
>
> Should read
>
> NormalizedRed = Red/sqrt(Red^2 + Green^2 + Blue^2);
> NormalizedGreen = Green/sqrt(Red^2 + Green^2 + Blue^2);
> NormalizedBlue = Blue/sqrt(Red^2 + Green^2 + Blue^2);
>
> Hope I caught it before it confused you
>
> Regards
>
> Dave Robinson
Thank you very much for explaining in such details! though
it's quite difficult for my understanding,as i'm just a
beginner in MATLAB, i'll try my best to understand it and
try it out!
On Jun 18, 8:27=A0pm, "Choo " <cychin...@yahoo.com.au> wrote:
> Can someone please tell me what is the use of normalizing
> an image? i've read that, this is to remove the effect of
> any change in intensity.
> can i make the intensity of 2 images similar or same?
>
> and,how to do normalizing?
------------------------------------------------------------------
Choo:
I think what you're wanting to do is called "histogram matching" or
"histogram warping." You can Google them. It's been talked a lot on
newsgroups, some here and a lot on sci.image.processing. The best
paper I've seen on the topic is by Mark Grundland and Neil Dodgson: http://www.cl.cam.ac.uk/~mg290/Portfolio/ColorHistogramWarp.html
It's very nice work. I wouldn't be surprised if it ended up being one
of the classic papers in that area. What's really nice is that it
does a wonderful job on color images, which is a lot tougher to do
than with monochrome images.
Look at that page - I think you'll find it does what you want.
Good luck,
ImageAnalyst
"Dave Robinson" <dave.robinson@somewhere.biz> wrote in
message <g3dcfr$i92$1@fred.mathworks.com>...
> "Dave Robinson" <dave.robinson@somewhere.biz> wrote in
> message <g3da0i$mb$1@fred.mathworks.com>...
> > "Choo " <cyching84@yahoo.com.au> wrote in message
> > <g3c94m$d66$1@fred.mathworks.com>...
> > > Can someone please tell me what is the use of
> normalizing
> > > an image? i've read that, this is to remove the
effect
> of
> > > any change in intensity.
> > > can i make the intensity of 2 images similar or same?
> > >
> > > and,how to do normalizing?
> >
> > Indeed you are right, converting an RGB image into
> > normalized RGB removes the effect of any intensity
> > variations. An interesting experiment is to take a
> > photograph of something like a single colour Rose
flower,
> > Converting this into normalized RGB converts the rose
to
> an
> > amorphous blob of colour, as all of the detail of the
> > flower is caused by a gentle change in intensity caused
> by
> > the shadowing of the petals.
> >
> > How to do it is quite simple
> >
> > 1) Split your RGB image into three seperate greyscale
> > images representing the red, green, blue colour planes
> >
> > Image_red = Image_rgb(:,1);
> > Image_green = Image_rgb(:,2);
> > Image_blue = Image_rgb(:,3);
> >
> > 2) For each pixel in the image take the three
> corresponding
> > components from the red, green, blue matrices -
calculate
> > the following (Remember to cast into doubles, else you
> will
> > get zero on your division)
> >
> > NormalizedRed = r/sqrt(Red^2 + Green^2 + Blue^2);
> > NormalizedGreen = g/sqrt(Red^2 + Green^2 + Blue^2);
> > NormalizedBlue = b/sqrt(Red^2 + Green^2 + Blue^2);
> >
> > Apply these transformations to evey pixel in the image.
> >
> > 3) Reform a colour image back into UINT8 (you need to
> > additionally scale the image by a factor of sqrt(3) to
> get
> > fully saturated colour representation). Restack the
three
> > normalized planes to form an RGB image, and display.
From
> > memory one of the many ways to do this is
> > Image_normalizedRGB = cat3
(NormalizedRed,NormalizedGreen,
> >
NormalizedBlue);
> >
> > 4) Things to watch for - when you get a true black
pixel
> > Red = Green = Blue = 0, so your transformation equation
> > will try to compute 0/0 and fall over laughing, catch
> this
> > possibility and set the ratio to (1/sqrt(3)) which is
> > normalized grey. Also look out for noise in the image
> that
> > sometimes occurs in regions that were very dark in the
> > original image.
> >
> > For speed you might get away with the approximation.
> >
> > NormalizedRed` = Red/(Red + Green + Blue); etc
> >
> > Normalizing can provide exactly what you need to
compare
> > two images taken under variations of illumination
> PROVIDING
> > the colour temperature of the light source doesn't
change
> > as the illumination output varies. e.g. a Tungsten lamp
> > will generate a cooler colour temperature if driven
with
> a
> > lower voltage, so this might give problems - however
> > variation in daylight caused by clouds, or other
> shadowing
> > is easily taken out.
> >
> > Hope that helps
> >
> > Regards
> >
> > Dave Robinson
> >
> >
> Whoops Sorry
>
> NormalizedRed = r/sqrt(Red^2 + Green^2 + Blue^2);
> NormalizedGreen = g/sqrt(Red^2 + Green^2 + Blue^2);
> NormalizedBlue = b/sqrt(Red^2 + Green^2 + Blue^2);
>
> Should read
>
> NormalizedRed = Red/sqrt(Red^2 + Green^2 + Blue^2);
> NormalizedGreen = Green/sqrt(Red^2 + Green^2 + Blue^2);
> NormalizedBlue = Blue/sqrt(Red^2 + Green^2 + Blue^2);
>
> Hope I caught it before it confused you
>
> Regards
>
> Dave Robinson
for "NormalizedRed = Red/sqrt(Red^2 + Green^2 + Blue^2); "
where does the "Red" comes from?
"Choo " <cyching84@yahoo.com.au> wrote in message <g3frs0
$cko$1@fred.mathworks.com>...
> "Dave Robinson" <dave.robinson@somewhere.biz> wrote in
> message <g3dcfr$i92$1@fred.mathworks.com>...
> > "Dave Robinson" <dave.robinson@somewhere.biz> wrote in
> > message <g3da0i$mb$1@fred.mathworks.com>...
> > > "Choo " <cyching84@yahoo.com.au> wrote in message
> > > <g3c94m$d66$1@fred.mathworks.com>...
>
> for "NormalizedRed = Red/sqrt(Red^2 + Green^2 + Blue^2); "
> where does the "Red" comes from?
>
Sorry about that - I have used it so often, I overlooked
the fact that I haven't defined it.
I hope you are OK with the concept that we have three
single plane images containing the Red, Green, Blue
component of the image. What I should have defined that
Red = Image_Red[x,y]; etc.
In other words Red is the red component of a single pixel.
So you apply the transformation for every pixel in your
image, so you will end up with a Normalized image which is
the same size as your original image.
ImageAnalyst's solution is excellent advice (as usual),
providing that the illumination variation across your two
comparison images are uniform - e.g. someone closed the
aperture of the camera, or the sun went down. If the
illumination variation varies across the image, e.g. a
local shadow falls across a region of the image, then
Normalization will produce a better result than colour
histogram equalization,
"Dave Robinson" <dave.robinson@somewhere.biz> wrote in
message <g3ftrm$s20$1@fred.mathworks.com>...
> "Choo " <cyching84@yahoo.com.au> wrote in message <g3frs0
> $cko$1@fred.mathworks.com>...
> > "Dave Robinson" <dave.robinson@somewhere.biz> wrote in
> > message <g3dcfr$i92$1@fred.mathworks.com>...
> > > "Dave Robinson" <dave.robinson@somewhere.biz> wrote
in
> > > message <g3da0i$mb$1@fred.mathworks.com>...
> > > > "Choo " <cyching84@yahoo.com.au> wrote in message
> > > > <g3c94m$d66$1@fred.mathworks.com>...
> >
> > for "NormalizedRed = Red/sqrt(Red^2 + Green^2 +
Blue^2); "
> > where does the "Red" comes from?
> >
>
> Sorry about that - I have used it so often, I overlooked
> the fact that I haven't defined it.
>
> I hope you are OK with the concept that we have three
> single plane images containing the Red, Green, Blue
> component of the image. What I should have defined that
>
> Red = Image_Red[x,y]; etc.
>
> In other words Red is the red component of a single
pixel.
> So you apply the transformation for every pixel in your
> image, so you will end up with a Normalized image which
is
> the same size as your original image.
>
> ImageAnalyst's solution is excellent advice (as usual),
> providing that the illumination variation across your two
> comparison images are uniform - e.g. someone closed the
> aperture of the camera, or the sun went down. If the
> illumination variation varies across the image, e.g. a
> local shadow falls across a region of the image, then
> Normalization will produce a better result than colour
> histogram equalization,
>
Yup..i'm ok with the 3 single RGB planes concept. thank you!
"Dave Robinson" <dave.robinson@somewhere.biz> wrote in
message <g3ftrm$s20$1@fred.mathworks.com>...
> "Choo " <cyching84@yahoo.com.au> wrote in message <g3frs0
> $cko$1@fred.mathworks.com>...
> > "Dave Robinson" <dave.robinson@somewhere.biz> wrote in
> > message <g3dcfr$i92$1@fred.mathworks.com>...
> > > "Dave Robinson" <dave.robinson@somewhere.biz> wrote
in
> > > message <g3da0i$mb$1@fred.mathworks.com>...
> > > > "Choo " <cyching84@yahoo.com.au> wrote in message
> > > > <g3c94m$d66$1@fred.mathworks.com>...
> >
> > for "NormalizedRed = Red/sqrt(Red^2 + Green^2 +
Blue^2); "
> > where does the "Red" comes from?
> >
>
> Sorry about that - I have used it so often, I overlooked
> the fact that I haven't defined it.
>
> I hope you are OK with the concept that we have three
> single plane images containing the Red, Green, Blue
> component of the image. What I should have defined that
>
> Red = Image_Red[x,y]; etc.
>
> In other words Red is the red component of a single
pixel.
> So you apply the transformation for every pixel in your
> image, so you will end up with a Normalized image which
is
> the same size as your original image.
>
> ImageAnalyst's solution is excellent advice (as usual),
> providing that the illumination variation across your two
> comparison images are uniform - e.g. someone closed the
> aperture of the camera, or the sun went down. If the
> illumination variation varies across the image, e.g. a
> local shadow falls across a region of the image, then
> Normalization will produce a better result than colour
> histogram equalization,
>
There's a question again..what does the parameter x & y
represent in "Red = Image_Red[x,y]; ". I'm really a
beginner here..
"Choo " <cyching84@yahoo.com.au> wrote in message
<g3mqoe$5tm$1@fred.mathworks.com>...
> "Dave Robinson" <dave.robinson@somewhere.biz> wrote in
> message <g3ftrm$s20$1@fred.mathworks.com>...
> > "Choo " <cyching84@yahoo.com.au> wrote in message
<g3frs0
> > $cko$1@fred.mathworks.com>...
In pseudo-code
for y =1-->numberof rows in image
for x = 1 -->number of columns in the image
Red = Image_red[y,x]
Green = Image_green[y,x]
Blue = Image_blue[y,x]
NormalizedRed = Red/sqrt(Red^2 + Green^2 + Blue^2)
etc.
I clearly explained that in the paragraph which stated
"In other words Red is the red component of a single pixel.
So you apply the transformation for every pixel in your
image, so you will end up with a Normalized image which is
the same size as your original image."
"Dave Robinson" <dave.robinson@somewhere.biz> wrote in
message <g3qpae$9ds$1@fred.mathworks.com>...
> "Choo " <cyching84@yahoo.com.au> wrote in message
> <g3mqoe$5tm$1@fred.mathworks.com>...
> > "Dave Robinson" <dave.robinson@somewhere.biz> wrote in
> > message <g3ftrm$s20$1@fred.mathworks.com>...
> > > "Choo " <cyching84@yahoo.com.au> wrote in message
> <g3frs0
> > > $cko$1@fred.mathworks.com>...
>
> In pseudo-code
> for y =1-->numberof rows in image
> for x = 1 -->number of columns in the image
> Red = Image_red[y,x]
> Green = Image_green[y,x]
> Blue = Image_blue[y,x]
>
> NormalizedRed = Red/sqrt(Red^2 + Green^2 + Blue^2)
> etc.
>
> I clearly explained that in the paragraph which stated
>
> "In other words Red is the red component of a single
pixel.
> So you apply the transformation for every pixel in your
> image, so you will end up with a Normalized image which
is
> the same size as your original image."
>
> Regards
>
> Dave Robinson
>
>
I want normalize RGB images. It mean I want to get images into one
color area, because of im doing undergraduate project about face
recognition. So if you know this, pls send me,
Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central. Read the complete Disclaimer prior to use.