Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Image Normalization

Subject: Image Normalization

From: amitesh kumar

Date: 29 Mar, 2011 19:33:04

Message: 1 of 11

hello
I need source code for image normalization and inverse normalization. i tried to search in file exchange and found one file , but that is not working properly,sply its inverse normalization.i dont how its happening ,but when i am applying that normalization technique to image , it is converting most of the pixel value into 0 or very low . so i am unable to getting the watermark image after extraction from the cover image.so if any one having some idea or some other code, plz share it with me so that i can sort out my problem. thanks in advance....

Subject: Image Normalization

From: ImageAnalyst

Date: 29 Mar, 2011 21:22:50

Message: 2 of 11

amitesh kumar:
How do you define normalization? Is it simply this
normalizedImage = originalImage/max(max(originalImage));
or do you have some other definition? Is your image color or
monochrome?
ImageAnalyst

Subject: Image Normalization

From: Chen

Date: 27 Apr, 2011 11:17:05

Message: 3 of 11

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <bf989f6c-e9ad-4c4f-a504-23889e62c3c5@a11g2000pri.googlegroups.com>...
> amitesh kumar:
> How do you define normalization? Is it simply this
> normalizedImage = originalImage/max(max(originalImage));
> or do you have some other definition? Is your image color or
> monochrome?
> ImageAnalyst

Hi~ I used "normalizedImage = originalImage/max(max(originalImage));" to normalize my image, and my friend suggest me to use:
normalizedImage = originalImage-mim(min(originalImage))/(max(max(originalImage))-mim(min(originalImage)));

I wonder if the first one is correct or not?

Subject: Image Normalization

From: ImageAnalyst

Date: 27 Apr, 2011 12:02:18

Message: 4 of 11

It just depends on what you want. The first normalizes 0 to 0 and
your max value to 1, while the second formula normalizes your min
value to 0 and your max value to 1. I don't know which way you want
it or prefer it. Neither is necessarily right or wrong - they're just
different. Depends on what you want.

Subject: Image Normalization

From: Chen

Date: 4 May, 2011 07:02:05

Message: 5 of 11

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <0ed917bd-f39a-4d9d-ae7e-76a35e6e22b5@26g2000yqa.googlegroups.com>...
> It just depends on what you want. The first normalizes 0 to 0 and
> your max value to 1, while the second formula normalizes your min
> value to 0 and your max value to 1. I don't know which way you want
> it or prefer it. Neither is necessarily right or wrong - they're just
> different. Depends on what you want.

Thank you very much!

Subject: Image Normalization

From: Yumnam Kirani

Date: 4 May, 2011 08:29:04

Message: 6 of 11

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <0ed917bd-f39a-4d9d-ae7e-76a35e6e22b5@26g2000yqa.googlegroups.com>...
> It just depends on what you want. The first normalizes 0 to 0 and
> your max value to 1, while the second formula normalizes your min
> value to 0 and your max value to 1. I don't know which way you want
> it or prefer it. Neither is necessarily right or wrong - they're just
> different. Depends on what you want.

The second is the correct method and the first method is wrong. Because, when the image matrix does not contain 0 or have some negative values, the elements of the modified matrix will not be between 0 and 1. Whereas in the second method, regardless of the values in the image matrix, the modified matrix will always have values between 0 and 1.

Yumnam Kirani Singh
Tronglaobi Awang Leikai

Subject: Image Normalization

From: Yumnam Kirani

Date: 4 May, 2011 08:39:05

Message: 7 of 11

"Yumnam Kirani" <kirani.singh@gmail.com> wrote in message <ipr2og$63m$1@fred.mathworks.com>...
> ImageAnalyst <imageanalyst@mailinator.com> wrote in message <0ed917bd-f39a-4d9d-ae7e-76a35e6e22b5@26g2000yqa.googlegroups.com>...
> > It just depends on what you want. The first normalizes 0 to 0 and
> > your max value to 1, while the second formula normalizes your min
> > value to 0 and your max value to 1. I don't know which way you want
> > it or prefer it. Neither is necessarily right or wrong - they're just
> > different. Depends on what you want.
>
> The second is the correct method and the first method is wrong. Because, when the image matrix does not contain 0 or have some negative values, the elements of the modified matrix will not be between 0 and 1. Whereas in the second method, regardless of the values in the image matrix, the modified matrix will always have values between 0 and 1.
>
> Yumnam Kirani Singh
> Tronglaobi Awang Leikai
Sorry, I mentioned in the previous post that the first method is wrong. But that is not exactly true. The first method is true only when the minimum value in the matrix is zero. Otherwise, the first method is wrong. So, better go gor second method which is always true.

Yumnam Kirani Singh
Tronglaobi Awang Leikai

Subject: Image Normalization

From: ImageAnalyst

Date: 4 May, 2011 12:15:32

Message: 8 of 11

On May 4, 4:39 am, "Yumnam Kirani" <kirani.si...@gmail.com> wrote:
> Sorry, I  mentioned in the previous post that the first method is wrong. But that is not exactly true. The first method is true only when the minimum value in the matrix is zero. Otherwise, the first method is wrong. So, better go gor second method which is always true.
>
> Yumnam Kirani Singh
> Tronglaobi Awang Leikai
------------------------------------------------------------------------------------
I disagree. Let's say that your data has no zeros and has only values
between 100 and 200. His first method would divide everything by 200
so that his final data would go between 0 and 1 except that there
would be no pixel values between 0 and 0.5 and all the "normalized"
values that actually exist would go between 0.5 and 1.0. This is not
necessarily "wrong" - it could be just what is wanted, it just depends
on what a person wants. For example, if you have a camera with a
linear response (OECF, "gamma", etc.) that is calibrated such that
zero light gives 0 gray levels and now you're looking at some scene
with non-zero light levels, this may be just what is called for if you
wanted to do radiometry.

Subject: Image Normalization

From: Chen

Date: 5 May, 2011 02:40:19

Message: 9 of 11

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <61ca94c5-1926-404b-b03a-1d3e4e0bd050@35g2000yqm.googlegroups.com>...
> On May 4, 4:39 am, "Yumnam Kirani" <kirani.si...@gmail.com> wrote:
> > Sorry, I  mentioned in the previous post that the first method is wrong. But that is not exactly true. The first method is true only when the minimum value in the matrix is zero. Otherwise, the first method is wrong. So, better go gor second method which is always true.
> >
> > Yumnam Kirani Singh
> > Tronglaobi Awang Leikai
> ------------------------------------------------------------------------------------
> I disagree. Let's say that your data has no zeros and has only values
> between 100 and 200. His first method would divide everything by 200
> so that his final data would go between 0 and 1 except that there
> would be no pixel values between 0 and 0.5 and all the "normalized"
> values that actually exist would go between 0.5 and 1.0. This is not
> necessarily "wrong" - it could be just what is wanted, it just depends
> on what a person wants. For example, if you have a camera with a
> linear response (OECF, "gamma", etc.) that is calibrated such that
> zero light gives 0 gray levels and now you're looking at some scene
> with non-zero light levels, this may be just what is called for if you
> wanted to do radiometry.


Thank you for your comments ~

I think it may depend on the purposes/situations. As in my case, when I use the first normalization method to deal with an image in the Opponent color space (with a small number of negtive pixel values), and then input it to my algorithm, the output looks good; but when I switch to the second method, the output changes a lot... So, i think, maybe the second method changes the pixel distribution regardless of the original distribution related to zero.

Subject: Image Normalization

From: ImageAnalyst

Date: 5 May, 2011 02:52:44

Message: 10 of 11

Well they do give you different values (distributions). One will give
you values all the way down to zero, while the other may not. I
certainly don't know what your algorithm does or which it would like
better.

Subject: Image Normalization

From: Yumnam Kirani

Date: 5 May, 2011 06:11:07

Message: 11 of 11

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <61ca94c5-1926-404b-b03a-1d3e4e0bd050@35g2000yqm.googlegroups.com>...
> On May 4, 4:39 am, "Yumnam Kirani" <kirani.si...@gmail.com> wrote:
> > Sorry, I  mentioned in the previous post that the first method is wrong. But that is not exactly true. The first method is true only when the minimum value in the matrix is zero. Otherwise, the first method is wrong. So, better go gor second method which is always true.
> >
> > Yumnam Kirani Singh
> > Tronglaobi Awang Leikai
> ------------------------------------------------------------------------------------
> I disagree. Let's say that your data has no zeros and has only values
> between 100 and 200. His first method would divide everything by 200
> so that his final data would go between 0 and 1 except that there
> would be no pixel values between 0 and 0.5 and all the "normalized"
> values that actually exist would go between 0.5 and 1.0. This is not
> necessarily "wrong" - it could be just what is wanted, it just depends
> on what a person wants. For example, if you have a camera with a
> linear response (OECF, "gamma", etc.) that is calibrated such that
> zero light gives 0 gray levels and now you're looking at some scene
> with non-zero light levels, this may be just what is called for if you
> wanted to do radiometry.
By definition normalization we assume that the range is between inclusively between zero and 1 unless the range is not specified expliciltly as in range normalization. Dividing by the maximum value means you are interested to make the maximum value 1. This is nothing but scaling where the sacling factor is the maximum value. Dividing by maximum value may suit your apllication but that is not normalization. In your case of 100 and 200, instead of dividing by 200 if you divide by 205 or 210, your purpose may serve equally.

Yumnam Kirani Singh
Tronglaobi Awang Leikai

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us