I have three images that should have similar range of histogram is the rescaling a correct procedure?

6 visualizzazioni (ultimi 30 giorni)
I have three images that should have similar range of histogram is the rescaling a correct procedure or there may be better solution?
I afraid of any lost of information in my images. Is there any better idea?

Risposte (3)

Bhavana Ravirala
Bhavana Ravirala il 25 Ago 2022
Hi ,
For this, you can adjust the contrast of the image with the help of “imcontrast” tool. Or you can adjust the contrast by using different functions.
Refer to the below documentations to know more about the functions and “imcontrast” tool
Hope this helps!!
  3 Commenti
2NOR_Kh
2NOR_Kh il 25 Ago 2022
I thought imadjust will change my information in a way that suprpesses the low frequency information and making the high frequency info more highlighed. Either of these two changes, I might avoid them.
Also, I used 'rescale' function, if the imcontrast in not causing information loss I'll prefer imcontrast.
DGM
DGM il 26 Ago 2022
imadjust(), imcontrast(), and rescale() all do similar things. They have no awareness of spatial frequency. It is strictly a linear mapping of intensity values. When both input and output ranges are specified, the transformation is equivalent to:
outpict = (outmax-outmin)*(inpict-inmin)/(inrgmax-inmin) + outmin;
The histogram will simply be translated/stretched, but the general shape of the distribution won't change unless you specify an input range that forces truncation.
Using rescale(), you can either specify the output levels alone, and the input levels are implicitly specified by the image extrema:
y = rescale(x,outmin,outmax);
or you can specify both the output and input levels:
y = rescale(x,outmin,outmax'inputmin',inmin,'inputmax',inmax);
Using imadjust(), you can specify input levels and output levels explicitly:
y = imadjust(x,[inmin inmax],[outmin outmax]);
... though imadjust expects those parameters to be normalized, and it expects the image to be correctly-scaled for its class. Rescale() does not.
Using imcontrast() only allows the adjustment of the input range, not the output range. Imcontrast() does the same thing as imadjust(), it's just less flexible. Its only unique ability is that it's a GUI tool.
If you're after something that's dependent on spatial frequency, or if you're after something that will reshape the distribution shown in the histogram, then that's a different story, and you might want to elaborate.

Accedi per commentare.


Image Analyst
Image Analyst il 26 Ago 2022
Modificato: Image Analyst il 26 Ago 2022
It really depends on what you want to achieve. Explain why you think you want all images to have a similar histogram. It might or might not be needed, depending on what your goal is. Also explain if you just want it for a visually pleasing and comparable display, or if you want to actually change the original pixel values into something different.
Plus we need to know why they're different in the first place. Should they be the same, but, for example, your camera automatically adjusts its parameters (so they're not the same for every photo), or your lighting flickers?
  4 Commenti
2NOR_Kh
2NOR_Kh il 26 Ago 2022
actually my purpose is more analyzing than visualising. The next step is to calculate few parameters based on my image, and I can't do anything on the other two images which I applied my filters on.
Image Analyst
Image Analyst il 27 Ago 2022
What calculations? I can't imagine any calculations that you'd do that can't be done on the original 3 images.

Accedi per commentare.


Image Analyst
Image Analyst il 26 Ago 2022
If (like @DGM mentioned) you're after something that will reshape the histograms to something custom, see my File Exchange program:
For example in the demo image below, I reshape the original histogram on the left to the silouhette of the woman as show on the right.
You can basically give any histogram you want, of any number of bins and any shape, and the process illustrated in the program will change the image such that the new histogram will have the number of bins and counts (shape) you specified.
  2 Commenti
2NOR_Kh
2NOR_Kh il 26 Ago 2022
That is not what I'm looking for but your algorithm is really interesting. Can you explain a little bit more about the functions of this method? what information this method will give us ?
Image Analyst
Image Analyst il 27 Ago 2022
It gives no information. It's just a fun toy with no real world use. Sure you could use it to give a perfectly flat histogram if you wanted but most people know that perfectly flat histograms, which histogram equalization functions attempt to deliver but rarely do because they're too simple and not sophistcated enough, are not useful. Histogram equalized images are not needed for image analysis as far as I've ever seen in my 40+ years of image processing, and they tend to produce harsh, awful, unnatural looking images.
It's like my Maze solving algorithm (also in my File Exchange) - no real use and just for fun.

Accedi per commentare.

Prodotti


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by