HDR imagining with inverted local patterns

1 次查看(过去 30 天)
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

回答(1 个)

Image Analyst
Image Analyst 2017-4-29
I don't know what their AGC function does, but you might try histogram expansion with imadjust() or mat2gray().
  3 个评论
Image Analyst
Image Analyst 2017-4-29
编辑:Image Analyst 2017-4-29
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
Walter Roberson 2017-4-30
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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Image Filtering and Enhancement 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by