去除没有比较图像的图像的梯度 [英] remove gradient of a image without a comparison image

查看:229
本文介绍了去除没有比较图像的图像的梯度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我很难想象从我收到的图片中移除渐变的良好方法。



图像是由显微镜相机拍摄的照片,在中间有一个眩光。图像具有贯穿图像的图案。然而,我应该消除由相机光创建的图像上的光眩光。



不幸的是,由于相机的性质,不可能用黑色背景上的照片来找到梯度分布。我也没有没有梯度的比较图像。 (注意,当拍摄照片时,光眩光的位置总是一致的)



更容易的是,它有一个带有闪光灯的照片,以摆脱闪光。唯一的问题是我没有办法获得没有闪光灯的图像来比较,或者甚至获得一个只有闪光灯的黑色图像。



我当前的想法是行为边缘检测并在远离边缘的特定位置(由于颜色差异)获得样本,并使用它来测量梯度的分布,因为那些区域应该具有相对相同的颜色。但是我想知道是否有一个更容易和更好的方法来做到这一点。



如果需要,我会稍后公布图片的示例。



解决这个在c ++使用opencv如果这使得更容易。



感谢您对此问题的任何可能想法。如果有另一个链接,教程或帖子可以解决我的问题,我会非常感谢的帖子。





,因为你可以知道有一个灯光照在img上,从白色斑点。并且顶部比底部浅因为光,当图片被拍摄时,椭圆内部的颜色实际上是不同的。然而盒子和椭圆之间的颜色应该是一致的。我原来的想法是,或许只是在这些地区采样一些如何和建立一个配置文件,我可以利用来消除光,但我不确定如何有效或如果有一个更好的方法



编辑:



好吧,我试过罗杰的建议,结果是惊人的好。使用110内核高斯模糊查找照明和执行CLAHE上面。 (都在opencv中完成)




然而,我的同事告诉我,图像看起来不完全均匀,并指出,在光线所用的区域周围稍微明亮。他建议尝试选择性高斯模糊,其中高于某些阈值像素值的区域不模糊,而其余图像模糊。



有没有人对此有意见,也许有一个链接,教程,或这样做的例子?我发现大多数情况下对于photoshop和gimp等程序来说都是选择性模糊的。



EDIT2:



>



它只是眼睛难以告诉,但我相信我已通过使用简单的平面拟合算法实现了相对接近的均匀化(( - A * x - B * y)/ C)(x,y,z)其中z像素值。我认为这可以通过使用或许一个正弦拟合函数来改善?我不确定。但我对结果比较满意。非常感谢罗杰的伟大想法。



我相信使用一堆图片,并获得平均值将是另一个好的方法(由罗杰建议),但Unofruntely我无法实现,因为我是

解决方案

我已经做了一些工作,这个区域以前和发现大的高斯模糊核可以产生合理的近似的背景照明。我将尝试让你的示例图像工作,但在此期间,这里是一个例子,你的图像经过高斯模糊,半径为50像素,这可以帮助你决定是否值得前进。





UPDATE



只要播放此图片,您可以使用自适应直方图均衡实现合理的改进(我使用CLAHE ) - 见下面的比较 - 任何用途?





我会随着进度更新这个答案。 >

currently i am having much difficulty thinking of a good method of removing the gradient from a image i received.

The image is a picture taken by a microscope camera that has a light glare in the middle. The image has a pattern that goes throughout the image. However i am supposed to remove the light glare on the image created by the camera light.

Unfortunately due to the nature of the camera it is not possible to take a picture on black background with the light to find the gradient distribution. Nor do i have a comparison image that is without the gradient. (note- the location of the light glare will always be consistant when the picture is taken)

In easier terms its like having a photo with a flash in it but i want to get rid of the flash. The only problem is i have no way to obtaining the image without flash to compare to or even obtaining a black image with just the flash on it.

My current thought is conduct edge detection and obtain samples in specific locations away from the edges (due to color difference) and use that to gauge the distribution of gradient since those areas are supposed to have relatively identical colors. However i was wondering if there was a easier and better way to do this.

If needed i will post a example of the image later.

At the moment i have a preferrence of solving this in c++ using opencv if that makes it easier.

thanks in advance for any possible ideas for this problem. If there is another link, tutorial, or post that may solve my problem i would greatly appreciate the post.

as you can tell there is a light thats being shinned on the img as you can tell from the white spot. and the top is lighter than the bottome due to the light the color inside the oval is actually different when the picture is taken in color. However the color between the box and the oval should be consistant. My original idea was to perhaps sample only those areas some how and build a profile that i can utilize to remove the light but i am unsure how effective that would be or if there is a better way

EDIT :

Well i tried out Roger's suggestion and the results were suprisngly good. Using 110 kernel gaussian blurr to find illumination and conducting CLAHE on top of that. (both done in opencv)

However my colleage told me that the image doesn't look perfectly uniform and pointed out that around the area where the light used to be is slightly brighter. He suggested trying a selective gaussian blur where the areas above certain threshold pixel values are not blurred while the rest of the image is blurred.

Does anyone have opinions regarding this and perhaps a link, tutorial, or an example of something like this being done? Most of the things i find tend to be selective blur for programs like photoshop and gimp

EDIT2 :

it is difficult to tell with just eyes but i believe i have achieved relatively close uniformization by using a simple plane fitting algorithm.((-A * x - B * y) / C) (x,y,z) where z is the pixel value. I think that this can be improved by utilizing perhaps a sine fitting function? i am unsure. But I am relatively happy with the results. Many thanks to Roger for the great ideas.

I believe using a bunch of pictures and getting the avg would've been another good method (suggested by roger) but Unofruntely i was not able to implement this since i was not supplied with various pictures and the machine is under modification so i was unable to use it.

解决方案

I have done some work in this area previously and found that a large Gaussian blur kernel can produce a reasonable approximation to the background illumination. I will try to get something working on your example image but, in the meantime, here is an example of your image after Gaussian blur with radius 50 pixels, which may help you decide if it's worth progressing.

UPDATE

Just playing with this image, you can actually get a reasonable improvement using adaptive histogram equalisation (I used CLAHE) - see comparison below - any use?

I will update this answer with more details as I progress.

这篇关于去除没有比较图像的图像的梯度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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