在压缩方面评估图像的质量? [英] Assessing the quality of an image with respect to compression?

查看:16
本文介绍了在压缩方面评估图像的质量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有用于计算机视觉任务的图像.该任务对图像质量很敏感.我想删除低于某个阈值的所有图像,但我不确定是否有任何方法/启发式方法可以自动检测通过 JPEG 严重压缩的图像.有人有想法吗?

I have images that I am using for a computer vision task. The task is sensitive to image quality. I'd like to remove all images that are below a certain threshold, but I am unsure if there is any method/heuristic to automatically detect images that are heavily compressed via JPEG. Anyone have an idea?

推荐答案

图像质量评估是一个快速发展的研究领域.由于您没有提到能够访问原始(未压缩)图像,因此您对无参考图像质量评估感兴趣.这实际上是一个相当困难的问题,但这里有一些要点可以帮助您入门:

Image Quality Assessment is a rapidly developing research field. As you don't mention being able to access the original (uncompressed) images, you are interested in no reference image quality assessment. This is actually a pretty hard problem, but here are some points to get you started:

  • 既然您提到了 JPEG,JPEG 压缩图像中有两个主要的退化特征:blockingblurring
  • 无参考图像质量评估指标通常会寻找这两个特征
  • 阻塞相当容易理解,因为它只出现在宏块边界上.宏块的大小是固定的 - 8x8 或 16x16,具体取决于图像的编码方式
  • 模糊有点困难.这是因为图像中的较高频率已被衰减(移除).您可以将图像分成块,DCT(离散余弦变换)每个块并查看 DCT 结果的高频分量.如果大多数块缺少高频分量,那么您可能看到的是模糊图像
  • 另一种模糊检测方法是测量图像边缘的平均宽度.对图像进行 Sobel 边缘检测,然后测量边缘每一侧的局部最小值/最大值之间的距离.谷歌搜索 Marziliano 的A no-reference perceptual blur metric"——这是一种著名的方法.Debing 的No Reference Block Based Blur Detection"是一篇更新的论文

无论您使用什么指标,都要考虑如何处理误报/误报.与简单的阈值处理相反,我会使用度量结果对图像进行排序,然后剪掉看起来只包含模糊图像的列表末尾.

Regardless of what metric you use, think about how you will deal with false positives/negatives. As opposed to simple thresholding, I'd use the metric result to sort the images and then snip the end of the list that looks like it contains only blurry images.

如果您的图像集包含相当相似的内容(例如,仅面部),您的任务将会简单得多.这是因为图像质量评估指标不幸的是,通常会受到图像内容的影响.

Your task will be a lot simpler if your image set contains fairly similar content (e.g. faces only). This is because the image quality assessment metrics can often be influenced by image content, unfortunately.

Google Scholar 是您真正的朋友.我希望我能给你一个具体的解决方案,但我还没有——如果我这样做了,我会成为一名非常成功的硕士生.

Google Scholar is truly your friend here. I wish I could give you a concrete solution, but I don't have one yet -- if I did, I'd be a very successful Masters student.

更新:

刚刚想到另一个想法:对于每张图片,用 JPEG 重新压缩图像,并检查重新压缩前后文件大小的变化.如果重新压缩后的文件大小比以前小很多,那么很可能图像没有被严重压缩,因为它有一些重要的细节被重新压缩删除了.否则(重新压缩后差异很小或文件大小更大)可能图像被严重压缩.

Just thought of another idea: for each image, re-compress the image with JPEG and examine the change in file size before and after re-compression. If the file size after re-compression is significantly smaller than before, then it's likely the image is not heavily compressed, because it had some significant detail that was removed by re-compression. Otherwise (very little difference or file size after re-compression is greater) it is likely that the image was heavily compressed.

在重新压缩期间使用质量设置可以让您确定高度压缩的确切含义.

The use of the quality setting during re-compression will allow you to determine what exactly heavily compressed means.

如果您使用的是 Linux,使用 bash 和 imageMagick 的转换实用程序来实现这应该不会太难.

If you're on Linux, this shouldn't be too hard to implement using bash and imageMagick's convert utility.

您可以尝试这种方法的其他变体:

You can try other variations of this approach:

  • 尝试其他形式的降级,例如高斯模糊,而不是 JPEG 压缩
  • 不要仅仅比较文件大小,而是尝试一个完整的参考指标,例如 SSIM --有一个 OpenCV 实现免费提供.其他实现(例如 Matlab、C#)也存在,所以请四处看看.
  • Instead of JPEG compression, try another form of degradation, such as Gaussian blurring
  • Instead of merely comparing file-sizes, try a full reference metric such as SSIM -- there's an OpenCV implementation freely available. Other implementations (e.g. Matlab, C#) also exist, so look around.

告诉我你的情况.

这篇关于在压缩方面评估图像的质量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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