【问题标题】:How exactly does 'order' parameter in imgaug.augmenters.Affine work?imgaug.augmenters.Affine 中的“order”参数究竟是如何工作的?
【发布时间】:2018-06-19 20:51:31
【问题描述】:

我一直在使用 imgaug 为我的项目增加数据。当然,我会使用仿射变换,所以我知道我们使用order 参数来选择插值方法。不过,至少对我来说,选择插值的方法看起来很晦涩。

假设这是我的增强器(它是 Sequential() 增强器的一部分):

iaa.Affine(scale             = {"x": (+0.8, +1.0), "y": (+0.8, +1.0)},
                translate_percent = {"x": (-0.2, +0.2), "y": (-0.2, +0.2)},
                rotate            = (-5, +5),
                shear             = ( -5,  +5),
                order             = [1, 2], #interpolation
                cval              = 255, 
)

据我所知,order = [1,2] 代表双二次插值,order = [0,1] 代表线性插值。这是什么意思?如何获得其他插值,例如双三次或 Lanczos?

【问题讨论】:

    标签: python-3.x image-processing machine-learning computer-vision image-manipulation


    【解决方案1】:

    “使用源头,卢克”。要么是directly,要么来自带有help函数的文档字符串。

    order : int or iterable of int or ia.ALL or StochasticParameter, optional(default=1)
    Interpolation order to use. Same meaning as in
    skimage:
            * 0: Nearest-neighbor
            * 1: Bi-linear (default)
            * 2: Bi-quadratic (not recommended by skimage)
            * 3: Bi-cubic
            * 4: Bi-quartic
            * 5: Bi-quintic
    Method 0 and 1 are fast, 3 is a bit slower, 4 and 5 are very
    slow.
            * If a single int, then that order will be used for all images.
            * If an iterable, then for each image a random value will be sampled
              from that iterable (i.e. list of allowed order values).
            * If ia.ALL, then equivalant to list [0, 1, 3, 4, 5].
            * If StochasticParameter, then that parameter is queried per image
              to sample the order value to use.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-06-26
      • 2021-08-15
      • 2012-06-08
      • 2011-10-11
      • 2013-07-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多