我一直在使用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]
代表线性插值。这是什么意思?如何获得其他插值,例如bicubic或Lanczos?
答案 0 :(得分:2)
"使用Source,Luke"。 directly,或来自带help
函数的docstring。
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.