qusetion about image histogram modification
9 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi,
I want to ask about image histogram modification
I have write a code that redestribute the graylevels combonents of image histogram, so I create tranformation function to map histogram components to the new one, but I don't know how to apply the transformation function on the original image.
please help
0 Commenti
Risposta accettata
Image Analyst
il 19 Nov 2011
I have a File Exchange submission called "Custom-shaped" histogram that does exactly that. http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
I start out by getting the custom shape by segmenting an image and I provide demo images of a car, woman in a bikini, and cityscape so that the histogram will have the shape of a car, woman, and cityscape. But you can skip the part that generates the shape from an image and just start with some array that defines the shape you want.
I suggest you look at my code because it's not a few trivial lines of code that someone can put into a reply here. Not if you want it done correctly and accurately. There are some nuances that you might not think of at first, like how to distribute bins spatially. For example if the bin at gray level 145 is supposed to get distributed to bins 100-130 in the new image, which pixels in the old image get set to 100, which get set to 101, which get set to 102, and so on. It's a lot trickier than you might think at first.
The code can also do PERFECT histogram equalization to give a perfectly flat histogram with uniform spatial redistribution. You won't find that code in any MATLAB function or any Answers or Newsgroup posting. They all give shapes, or, at best, a sort of flat histogram but with slight randomness to it. I've not seen any that give a perfectly flat histogram like I do, probably because it's somewhat advanced and lengthy.
Don't say "Oh it looks too complicated for me" like a lot of people say with my code. Challenge yourself. You can handle it if you just take it one step at a time. It's very well commented.
0 Commenti
Più risposte (1)
Vedere anche
Categorie
Scopri di più su Histograms in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!