正确的图像用于局部暗/光斑,均衡亮度/强度(局部位置,而不是暗/中/亮区域) [英] Correct image for local dark / light spots, equalise luminance / intensity (local in location, not by dark/medium/light areas)

查看:752
本文介绍了正确的图像用于局部暗/光斑,均衡亮度/强度(局部位置,而不是暗/中/亮区域)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有一个黑暗点的图像,看起来很简单,所以我想我可以打造一个亮度图,反转它,然后将其应用到我的图像,以消除黑点。然而,我可以找到两种均衡方法:均衡整个图像(使用直方图)或将图像分割成黑暗中和浅色部分,并均衡您想要的图像。第一种方法不能帮助我的问题,第二种方法也使得图像中的黑色物体变得更轻。我相信有一个简单的方法可以做到这一点(很久以前我看到有人在演示文稿中做到这一点),虽然我没有找到它,但是没有找到它。



所以我的问题:如何创建一个这样的图像的亮度图:



img src =https://s15.postimg.org/pzt3bjwbf/lenadarkspots.jpgalt =lena spotted>



所以我得到一个这样的地图:





我可以反向应用以获得更好的图像:





我主要使用Matlab并具有一些有限的Python和数学知识,但是Matlab示例对我来说最有用。我想到的一个方法就是采用fft2并使低频率变空,但这只会破坏所有对比度,而不仅仅是我想要的部分。



类似但不同的SO问题这没有帮助我:



图像均衡



阈值化基于渐变的图像



图像直方图



Matlab - 本地直方图均衡



如何找出光,中,深色?

解决方案

你会ha以非常精确地模拟这个过程工作的黑点的性质。你能否表征黑暗的梯度是线性的,指数的,功率的,三角的还是其他可预测的函数?它总是完全循环吗?



照片中有直线元素有助于,并可能提供样本来源来计算黑斑的性质。如果将三维或二次函数的暗点视为三维(X,Y,亮度),则可以根据一定数量的已知点解决。


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?

解决方案

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.

这篇关于正确的图像用于局部暗/光斑,均衡亮度/强度(局部位置,而不是暗/中/亮区域)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆