评估图像相对于压缩的质量? [英] Assessing the quality of an image with respect to compression?

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

问题描述

我有用于计算机视觉任务的图像。任务对图像质量敏感。我想删除低于某个阈值的所有图像,但我不确定是否有任何方法/启发式自动检测通过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压缩图片显示的功能:屏蔽模糊

  • 无参考图像质量评估指标通常会查找这两个

  • 阻塞相当容易拾取,因为它只出现在宏块边界。宏块是固定大小 - 8x8或16x16,取决于图像的编码方式。

  • 模糊处理有点困难。这是因为图像中的较高频率已经被衰减(去除)。您可以将图像分成块,每个块进行DCT(离散余弦变换),并查看DCT结果的高频分量。如果高频分量缺少大多数块,那么您可能正在查看模糊图像。

  • 另一种模糊检测方法是测量图像边缘的平均宽度。对图像执行Sobel边缘检测,然后测量边缘每侧的局部最小值/最大值之间的距离。 Google的Marziliano的无参考感知模糊度量 - 这是一个着名的方法。

  • Since you mention JPEG, there are two major degradation features that manifest themselves in JPEG-compressed images: blocking and blurring
  • No-reference image quality assessment metrics typically look for those two features
  • Blocking is fairly easy to pick up, as it appears only on macroblock boundaries. Macroblocks are a fixed size -- 8x8 or 16x16 depending on what the image was encoded with
  • Blurring is a bit more difficult. It occurs because higher frequencies in the image have been attenuated (removed). You can break up the image into blocks, DCT (Discrete Cosine Transform) each block and look at the high-frequency components of the DCT result. If the high-frequency components are lacking for a majority of blocks, then you are probably looking at a blurry image
  • Another approach to blur detection is to measure the average width of edges of the image. Perform Sobel edge detection on the image and then measure the distance between local minima/maxima on each side of the edge. Google for "A no-reference perceptual blur metric" by Marziliano -- it's a famous approach. "No Reference Block Based Blur Detection" by Debing is a more recent paper

无论您使用什么指标,请考虑您将如何使用处理假阳性/阴性。与简单的阈值处理相反,我将使用指标结果对图像进行排序,然后剪切列表的末尾,看起来它只包含模糊的图像。

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学术搜索是这里真正的朋友。我希望我能给你一个具体的解决方案,但我还没有 - 如果我这样做,我会是一个非常成功的硕士生。

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.

UPDATE:

只是想到了另一个想法:对于每个图像,使用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的convert实用程序。

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:


  • 尝试其他形式的降级,例如高斯模糊

  • 而不是仅仅比较文件大小,请尝试使用完整的引用度量标准,例如SSIM - 有一个OpenCV实现免费提供

  • 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.

让我知道你是怎么走的。

Let me know how you go.

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

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