简体   繁体   English

哪种反卷积算法最适合从文本中删除运动模糊?

[英]Which deconvolution algorithm is best suited for removing motion blur from text?

I'm using OpenCV to process pictures taken with a mobile phone. 我正在使用OpenCV来处理用手机拍摄的照片。 The pictures contain text, and they have small amounts of motion blur, which I need to remove. 图片包含文字,它们有少量的运动模糊,我需要删除。

What would be the most viable algorithm to use? 什么是最可行的算法? I have tested so far Lucy-Richardson and Weiner deconvolution, but they did not yield satisfactory results. 到目前为止,我已经测试了Lucy-Richardson和Weiner deconvolution,但他们没有产生令人满意的结果。

Agree with @TheJuice, your problem lies in the PSF estimation. 同意@TheJuice,你的问题在于PSF估计。 Usually to be able to do this from a single frame, several assumptions need to be made about the factors leading to the blur (motion of object, type of motion of the sensor, etc.). 通常为了能够从单个帧执行此操作,需要对导致模糊的因素(对象的运动,传感器的运动类型等)进行若干假设。

You can find some pointers, especially on the monodimensional case, here . 你可以找到一些三分球,尤其是在单维的情况下, 在这里 They use a filtering method that leaves mostly correlation from the blur, discarding spatial correlation of original image, and use this to deduce motion direction and thence the PSF. 他们使用一种过滤方法,主要与模糊相关,丢弃原始图像的空间相关性,并使用它来推断运动方向和PSF。 For small blurs you might be able to consider the motion as constant; 对于小模糊,你可能会认为运动是恒定的; otherwise you will have to use a more complex accelerated motion model. 否则你将不得不使用更复杂的加速运动模型。

Unfortunately, mobile phone blur is often a compound of CCD integration and non-linear motion (translation perpendicular to line of sight, yaw from wrist motion, and rotation around the wrist), so Yitzhaky and Kopeika's method will probably only yield acceptable results in a minority of cases. 不幸的是,手机模糊通常是CCD集成和非线性运动的复合(垂直于视线的平移,手腕运动的偏航和手腕周围的旋转),因此Yitzhaky和Kopeika的方法可能只会产生可接受的结果。少数案件。 I know there are methods to deal with that ("depth awareness" and other) but I have never had occasion of dealing with them. 我知道有办法处理(“深度意识”和其他)但我从来没有机会处理它们。

You can preview the results using photo recovery software such as Focus Magic; 您可以使用Focus Magic等照片恢复软件预览结果; while they do not employ YK estimator (motion description is left to you), the remaining workflow is necessarily very similar. 虽然他们不使用YK估算器(动作描述留给你),但剩下的工作流程必然非常相似。 If your pictures are amenable to Focus Magic recovery, then probably YK method will work. 如果您的照片适合Focus Magic恢复,则可能 YK方法可行。 If they are not (or not enough, or not enough of them to be worthwhile), then there's no point even trying to implement it. 如果它们不是(或者不够,或者它们不够值得),那么即使尝试实现它也没有意义。

Motion blur is a difficult problem to overcome. 运动模糊是一个难以克服的问题。 The best results are gained when 当得到最好的结果

  1. The speed of the camera relative to the scene is known 相机相对于场景的速度是已知的
  2. You have many pictures of the blurred object which you can correlate. 您有很多可以关联的模糊对象的图片。

You do have one major advantage in that you are looking at text (which normally constitutes high contrast features). 您确实有一个主要优势,即您正在查看文本(通常构成高对比度功能)。 If you only apply deconvolution to high contrast (I know that the theory is often to exclude high contrast) areas of your image you should get results which may enable you to better recognise characters. 如果您只对高对比度(我知道理论通常排除高对比度)区域应用去卷积,您应该得到的结果可以让您更好地识别字符。 Also a combination of sharpening/blurring filters pre/post processing may help. 此外,前/后处理的锐化/模糊滤镜的组合可能有所帮助。

I remember being impressed with this paper previously. 我记得以前对这篇论文印象深刻。 Perhaps an adaption on their implementation would be worth a go. 或许对其实施进行调整是值得的。

I think the estimation of your point-spread function is likely to be more important than the algorithm used. 我认为你的点扩散函数的估计可能比使用的算法更重要。 It depends on the kind of motion blur you're trying to remove, linear motion is likely to be the easiest but is unlikely to be the kind you're trying to remove: i imagine it's non-linear caused by hand movement during the exposure. 这取决于你想要移除的运动模糊的类型,线性运动可能是最简单的,但不太可能是你想要删除的那种:我想它是由暴露期间的手移动引起的非线性。

You cannot eliminate motion blur. 你无法消除运动模糊。 The information is lost forever. 信息永远丢失。 What you are dealing with is a CCD that is recording multiple real objects to a single pixel, smearing them together. 你正在处理的是一个CCD,它将多个真实物体记录到一个像素上,将它们涂抹在一起。 In other words if the pixel reads 56, you cannot magically determine that the actual reading should have been 37 at time 1, and 62 at time 2, and 43 at time 3. 换句话说,如果像素读数为56,则无法神奇地确定实际读数在时间1应为37,在时间2时为62,在时间3时为43。

Another way to look at this: imagine you have 5 pictures. 另一种看待这个的方法:想象你有5张照片。 You then use photoshop to blend the pictures together, averaging the value of each pixel. 然后,您可以使用photoshop将图片混合在一起,平均每个像素的值。 Can you now somehow from the blended picture tell what the original 5 pictures were? 你现在可以从混合图片中以某种方式告诉原始的5张图片是什么吗? No, you cannot, because you do not have the information to do that. 不,你不能,因为你没有这方面的信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM