HDR imagining with inverted local patterns
1 view (last 30 days)
Show older comments
Hey there i want to make a HDR image from single image using that algorithm given below:
I coded almost whole schmeme except AGC block.Here is my code i attached:
So i have a problem.My color info is not good given below:
i could not use automatic gain control here because i dont know how to implement it(the other part of code is good i think you can see in attached files).In article "automatic gain control" part says:
_ The results are then processed using brightness enhancement and automatic gain control (AGC).Finally, we expand the luminance range from 0 to 255 using AGC and enhance the colour using RGB pixels processing_
In the internet i see automatic gain control in speech processing.but it includes dB parameters etc.How i can solve this problem.(article attached also)
Thank you
2 Comments
Image Analyst
on 29 Apr 2017
You added the tag Simulink? Are you trying to do this in Simulink instead of MATLAB?
Walter Roberson
on 29 Apr 2017
This appears to be a follow on to https://www.mathworks.com/matlabcentral/answers/330601-what-is-agc-in-image-processing-expand-luminance-range-0-to-255
Answers (1)
Image Analyst
on 29 Apr 2017
I don't know what their AGC function does, but you might try histogram expansion with imadjust() or mat2gray().
3 Comments
Image Analyst
on 29 Apr 2017
Edited: Image Analyst
on 29 Apr 2017
Your image must be floating point. One way to expand the gray level range to 0-255 and make it a uint8 like most images is to use mat2gray():
uint8Image = uint8(255 * mat2gray(floatingPointImage));
It just makes the min 0 and the max 255, so if you have an outlier pixel with a drastically different value, it may not optimally expand the histogram like imadjust would. It doesn't scale to small percentages at the tails of the histogram like imadjust does. You could replace mata2gray with imadjust() in the above line of code. Note that imadjust gives you an option where you can specify the amount you want to come in at the tails of the histogram.
Walter Roberson
on 30 Apr 2017
uint8Image = im2uint8(mat2gray(floatingPointImage));
is a bit better. 255 * version does not use equal density because uint8() rounds. Only the range [0, 1/2) after multiplication would be mapped to 0, [1/2, 3/2) maps to 1, [3/2, 5/2) maps to 2, and so on, each box after the first having effective width 1 but the first box only having effective width 1/2. At the high end, only [254.5, 255] would round to 255, again only effective width 1/2.
See Also
Categories
Find more on Image Filtering and Enhancement in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!