Skip to main content
Remove redundant obsenity, fix typos, make formula formating consistent
Source Link

How to perform an image normalization after for ex.example adding a constant to it?

I had some magical tasks to do on my lessons. I had to write an app which performs some operations: basic (adding, substractingsubtracting, multiplying a constant and a second image), geometric, filtering, histograms etc. There were ~50 tasks.

I've made them all, even with Prewitt filters and other down/upbandwith and gradient things.

Now, my teacher sent me an info, that I did my normalization wrong in basic operations, for ex.example in adding a constant.

As he wrote in his document there are 3 ways of handling the pixel overflow >255 or <0:

  • cutting the overflow - which means a simple clamp
  • scaling images before processing - dafuq
  • NORMALIZATIONnormalization of the final image - scaling and moving the image function with a specified range that the final image fills the given range.

I've left first two and got the third one, causebecause he said it's the correct way. I've read somewhere that I still need to combine it with a clamp (0,255).

Now, I got his formula:

enter image description here$$\large f_{norm}=Z_{rep}[(f-f_{min})\div(f_{max}-f_{min})]$$

And I thought it's easy to understand, but I have some problems with it.

As I understand:

  • Fnorm$f_{norm}$ - final pixel (normalized)
  • f$f$ - given pixel
  • fmin$f_{min}$ - minimum
  • fmax$f_{max}$ - extremum
  • Zrep$Z_{rep}$ - clamp 0-255?

I have the following questions:

  1. Are fmin$f_{min}$ and fmax$f_{max}$ taken from the given image, or from the image after the operation (for ex. adding a constant)? I know what extremes are, but I can't figure it out which two should I use in this formula.

  2. Is Zrep$Z_{rep}$ really a clamp method as I thought which just cuts to 0-255? I've read somewhere that even with normalization there can be an overflow.

  3. Does normalization work like: no matter what value you'll add or substractsubtract from the image, I'll make for you a beautiful 0-255 values? Or am I wrong?

I've even made some calculations, made some images in photoshop with extremes 30,200 and even 0,255, put them into the formula and got some results, but I still don't know if it's done well.

I'm sitting here for 3 weeks, really and can't get which extremes should I use and if I should clamp or not.

If there's anyone that could help me with it I would be grateful! Thanks very much!

How to perform an image normalization after for ex. adding a constant to it?

I had some magical tasks to do on my lessons. I had to write an app which performs some operations: basic (adding, substracting, multiplying a constant and a second image), geometric, filtering, histograms etc. There were ~50 tasks.

I've made them all, even with Prewitt filters and other down/upbandwith and gradient things.

Now, my teacher sent me an info, that I did my normalization wrong in basic operations, for ex. in adding a constant.

As he wrote in his document there are 3 ways of handling the pixel overflow >255 or <0:

  • cutting the overflow - which means a simple clamp
  • scaling images before processing - dafuq
  • NORMALIZATION of the final image - scaling and moving the image function with a specified range that the final image fills the given range.

I've left first two and got the third one, cause he said it's the correct way. I've read somewhere that I still need to combine it with a clamp (0,255).

Now, I got his formula:

enter image description here

And I thought it's easy to understand, but I have some problems with it.

As I understand:

  • Fnorm - final pixel (normalized)
  • f - given pixel
  • fmin - minimum
  • fmax - extremum
  • Zrep - clamp 0-255?

I have the following questions:

  1. Are fmin and fmax taken from the given image, or from the image after the operation (for ex. adding a constant)? I know what extremes are, but I can't figure it out which two should I use in this formula.

  2. Is Zrep really a clamp method as I thought which just cuts to 0-255? I've read somewhere that even with normalization there can be an overflow.

  3. Does normalization work like: no matter what value you'll add or substract from the image, I'll make for you a beautiful 0-255 values? Or am I wrong?

I've even made some calculations, made some images in photoshop with extremes 30,200 and even 0,255, put them into the formula and got some results, but I still don't know if it's done well.

I'm sitting here for 3 weeks, really and can't get which extremes should I use and if I should clamp or not.

If there's anyone that could help me with it I would be grateful! Thanks very much!

How to perform an image normalization after for example adding a constant to it?

I had some magical tasks to do on my lessons. I had to write an app which performs some operations: basic (adding, subtracting, multiplying a constant and a second image), geometric, filtering, histograms etc. There were ~50 tasks.

I've made them all, even with Prewitt filters and other down/upbandwith and gradient things.

Now, my teacher sent me an info, that I did my normalization wrong in basic operations, for example in adding a constant.

As he wrote in his document there are 3 ways of handling the pixel overflow >255 or <0:

  • cutting the overflow - which means a simple clamp
  • scaling images before processing
  • normalization of the final image - scaling and moving the image function with a specified range that the final image fills the given range.

I've left first two and got the third one, because he said it's the correct way. I've read somewhere that I still need to combine it with a clamp (0,255).

Now, I got his formula:

$$\large f_{norm}=Z_{rep}[(f-f_{min})\div(f_{max}-f_{min})]$$

And I thought it's easy to understand, but I have some problems with it.

As I understand:

  • $f_{norm}$ - final pixel (normalized)
  • $f$ - given pixel
  • $f_{min}$ - minimum
  • $f_{max}$ - extremum
  • $Z_{rep}$ - clamp 0-255?

I have the following questions:

  1. Are $f_{min}$ and $f_{max}$ taken from the given image, or from the image after the operation (for ex. adding a constant)? I know what extremes are, but I can't figure it out which two should I use in this formula.

  2. Is $Z_{rep}$ really a clamp method as I thought which just cuts to 0-255? I've read somewhere that even with normalization there can be an overflow.

  3. Does normalization work like: no matter what value you'll add or subtract from the image, I'll make for you a beautiful 0-255 values? Or am I wrong?

I've even made some calculations, made some images in photoshop with extremes 30,200 and even 0,255, put them into the formula and got some results, but I still don't know if it's done well.

I'm sitting here for 3 weeks, really and can't get which extremes should I use and if I should clamp or not.

Source Link
Jacob
  • 133
  • 5

How to perform an image normalization after for ex. adding a constant to it?

I had some magical tasks to do on my lessons. I had to write an app which performs some operations: basic (adding, substracting, multiplying a constant and a second image), geometric, filtering, histograms etc. There were ~50 tasks.

I've made them all, even with Prewitt filters and other down/upbandwith and gradient things.

Now, my teacher sent me an info, that I did my normalization wrong in basic operations, for ex. in adding a constant.

As he wrote in his document there are 3 ways of handling the pixel overflow >255 or <0:

  • cutting the overflow - which means a simple clamp
  • scaling images before processing - dafuq
  • NORMALIZATION of the final image - scaling and moving the image function with a specified range that the final image fills the given range.

I've left first two and got the third one, cause he said it's the correct way. I've read somewhere that I still need to combine it with a clamp (0,255).

Now, I got his formula:

enter image description here

And I thought it's easy to understand, but I have some problems with it.

As I understand:

  • Fnorm - final pixel (normalized)
  • f - given pixel
  • fmin - minimum
  • fmax - extremum
  • Zrep - clamp 0-255?

I have the following questions:

  1. Are fmin and fmax taken from the given image, or from the image after the operation (for ex. adding a constant)? I know what extremes are, but I can't figure it out which two should I use in this formula.

  2. Is Zrep really a clamp method as I thought which just cuts to 0-255? I've read somewhere that even with normalization there can be an overflow.

  3. Does normalization work like: no matter what value you'll add or substract from the image, I'll make for you a beautiful 0-255 values? Or am I wrong?

I've even made some calculations, made some images in photoshop with extremes 30,200 and even 0,255, put them into the formula and got some results, but I still don't know if it's done well.

I'm sitting here for 3 weeks, really and can't get which extremes should I use and if I should clamp or not.

If there's anyone that could help me with it I would be grateful! Thanks very much!