Correct image for local dark / light spots, equalise luminance / intensity (local in location, not by dark/medium/light areas)

送分小仙女□ 提交于 2019-12-07 18:20:02

问题


So I have an image that has some dark spots, and they look pretty simple so I think I can creaat an luminance map, invert it and then apply it to my image to undo the dark spots. However all I can find is two methods for equalizing: equalize whole image(with histogram) or segment the image in dark meddium and light parts and equalize which you want. The first approach does not help my problem and the second approach also makes the dark objects in the image lighter. I am sure there is an easy way to do this (long ago I saw somebody do it in a presentation), although I havent been able to find it or come up with it yet.

So my question: how would I create a "luminance map" of an image like this:

So I get a map like this:

Which I can apply inversely to get a better image like this:

I understand I will have discretization errors at the corrected spots, but thats much better than the dark spots. I hope someone can help me do this, thanks!

I mainly use Matlab and have some limited python and mathematica knowledge, but a Matlab example would be most useful to me. One way I thought of myself was taking fft2 and nulling the low frequencies, but that would just destroy all contrast, not just the partss I want.

Similar but different SO questions that did not help me:

Image equalisation

thresholding an image based on gradient

Histogram of image

Matlab - Local Histogram Equalization

How to find out light, medium and dark color?


回答1:


You will have to very precisely model the nature of the dark spots for this process to work. Can you characterize whether the dark gradient is linear, exponential, power, trigonometric, or some other predictable function? Is it always exactly circular?

Having straight-line elements in the photo helps, and may provide a source of samples to calculate the nature of the dark spot from. If you treat the dark spot like a quadratic or cubic function in three dimensions (X, Y, luminance) then you can solve it based on a certain number of known points.



来源:https://stackoverflow.com/questions/19035835/correct-image-for-local-dark-light-spots-equalise-luminance-intensity-loca

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!