Resize

Source code notebook

Set the static size of the image

using Augmentor
using ImageShow, ImageCore

img_in = testpattern(RGB, ratio=0.5)

mosaicview(
    img_in,
    augment(img_in, Resize(240, 320));
    fillvalue=colorant"white", nrow=1, npad=10
)

References

Augmentor.ResizeType
Resize <: Augmentor.ImageOperation

Description

Rescales the image to a fixed pre-specified pixel size.

This operation does not take any measures to preserve aspect ratio of the source image. Instead, the original image will simply be resized to the given dimensions. This is useful when one needs a set of images to all be of the exact same size.

Usage

Resize(; height=64, width=64)

Resize(size)

Resize(size...)

Arguments

  • size : NTuple or Vararg of Int that denote the output size in pixel for each dimension.

See also

CropSize, augment

Examples

using Augmentor
img = testpattern()

augment(img, Resize(30, 40))
source

This page was generated using DemoCards.jl and Literate.jl.