如何选择图像插值方法? (Emgu / OpenCV的) [英] How do I choose an image interpolation method? (Emgu/OpenCV)

查看:198
本文介绍了如何选择图像插值方法? (Emgu / OpenCV的)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Emgu(OpenCV的.net包装器)提供的图像大小调整功能可以使用四种插值方法中的任何一种

The image resizing function provided by Emgu (a .net wrapper for OpenCV) can use any one of four interpolation methods:


  1. CV_INTER_NN(默认)

  2. CV_INTER_LINEAR

  3. CV_INTER_CUBIC

  4. CV_INTER_AREA

  1. CV_INTER_NN (default)
  2. CV_INTER_LINEAR
  3. CV_INTER_CUBIC
  4. CV_INTER_AREA

我粗略地理解线性插值,但只能猜测立方或区域的作用。我怀疑NN代表最近的邻居,但我可能是错的。

I roughly understand linear interpolation, but can only guess what cubic or area do. I suspect NN stands for nearest neighbour, but I could be wrong.

我正在调整图像大小的原因是减少像素数量(它们将被迭代在某些时候)同时保持他们的代表性。我之所以提到这一点,是因为在我看来插值是这个目的的核心 - 因此获得正确的类型应该非常重要。

The reason I'm resizing an image is to reduce the amount of pixels (they will be iterated over at some point) whilst keeping them representative. I mention this because it seems to me that interpolation is central to this purpose - getting the right type ought therefore be quite important.

我的问题是,那是什么专业人士和每种插值方法的缺点?它们有什么不同,我应该使用哪一个?

My question then, is what are the pros and cons of each interpolation method? How do they differ and which one should I use?

推荐答案

最近的邻居会尽快,但你会失去实质性的调整大小时的信息。

Nearest neighbor will be as fast as possible, but you will lose substantial information when resizing.

线性插值速度较慢,但​​不会导致信息丢失除非缩小图像(你是)。

Linear interpolation is less fast, but will not result in information loss unless you're shrinking the image (which you are).

立方插值(可能实际上是Bicubic)使用包含多个相邻像素的许多可能公式之一。这对于缩小图像要好得多,但是如果没有信息丢失,你仍然可以做多少收缩。根据算法,您可以将图像缩小50%或75%。这种方法的主要原因是速度慢得多。

Cubic interpolation (probably actually "Bicubic") uses one of many possible formulas that incorporate multiple neighbor pixels. This is much better for shrinking images, but you are still limited as to how much shrinking you can do without information loss. Depending on the algorithm, you can probably reduce your images by 50% or 75%. The primary con of this approach is that it is much slower.

不确定区域是什么 - 它实际上可能是Bicubic。很可能,此设置将提供最佳结果(在信息丢失/外观方面),但代价是最长的处理时间。

Not sure what "area" is - it may actually be "Bicubic". In all likelihood, this setting will give your best result (in terms of information loss / appearance), but at the cost of the longest processing time.

更新:此链接提供了更多详细信息(包括列表中未包含的第五种类型):

Update: this link gives more details (including a fifth type not included in your list):

http://docs.opencv.org/modules/imgproc/doc/geometric_transformations.html?highlight=resize#resize

这篇关于如何选择图像插值方法? (Emgu / OpenCV的)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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