图像增强 - 从写入中清除给定的图像 [英] image enhancement - cleaning given image from writing

查看:145
本文介绍了图像增强 - 从写入中清除给定的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我需要清理这张图片删除写作干净我并使其变亮。


作为我在图像处理课程中作业的一部分我可以使用matlab函数ginput,来查找图像中的特定点(当然在剧本中你应该硬编码你需要的坐标)。



你可以使用conv2,fft2,ifft2,fftshift等。



您也可以使用中位数,平均值,最大值,最小值,排序等。



我的基本想法是使用白色和黑色值从图片中间将它们插入黑白条带的其他部分。但是给出了非常合成的外观。



你能指点一下该怎么办?中值滤波器不会给出好的结果。

解决方案

执行此类操作的一般技术称为,应该很容易实现。我没有使用它,但你可以验证你可以获得哪些结果。



编辑:我错过了你也想要照亮图像。



通过应用伽马因子< b>来提高图像的简单方法,而不使更亮的区域更亮。 1.更具体的图像,你可以先应用一个相对较大的低通滤波器,否定它,将原始图像乘以它,然后应用伽马因子。在第二种情况下,最终图像可能比第一种图像更暗,因此您将它乘以一个简单的标量值。以下是这两种情况的结果(左边一只是伽玛0.6):





如果你真的想要提亮图像,那么你可以应用双边滤镜并将其二值化:




i need to clean this picture delete the writing "clean me" and make it bright.

as a part of my homework in image processing course i may use matlab functions ginput, to find specific points in the image (of course in the script you should hard code the coordinates you need).

You may use conv2, fft2, ifft2, fftshift etc.

You may also use median, mean, max, min, sort, etc.

my basic idea was to use the white and black values from the middle of the picture and insert them into the other parts of the black and white strips. however gives a very synthetic look to the picture.

can you please give me a direction what to do ? a median filter will not give good results.

解决方案

The general technique to do such thing is called Inpainting. But in order to do it, you need a mask of the regions that you want to in paint. So, let us suppose that we managed to get a good mask and inpainted the original image considering a morphological dilation of this mask:

To get that mask, we don't need anything much fancy. Start with a binarization of the difference between the original image and the result of a median filtering of it:

You can remove isolated pixels; join the pixels representing the stars of your flag by a combination of dilation in horizontal followed by another dilation with a small square; remove this just created largest component; and then perform a geodesic dilation with the result so far against the initial mask. This gives the good mask above.

Now to inpaint there are many algorithms, but one of the simplest ones I've found is described at Fast Digital Image Inpainting, which should be easy enough to implement. I didn't use it, but you could and verify which results you can obtain.

EDIT: I missed that you also wanted to brighten the image.

An easy way to brighten an image, without making the brighter areas even brighter, is by applying a gamma factor < 1. Being more specific to your image, you could first apply a relatively large lowpass filter, negate it, multiply the original image by it, and then apply the gamma factor. In this second case, the final image will likely be darker than the first one, so you multiply it by a simple scalar value. Here are the results for these two cases (left one is simply a gamma 0.6):

If you really want to brighten the image, then you can apply a bilateral filter and binarize it:

这篇关于图像增强 - 从写入中清除给定的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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