mmcv.image.imresize¶
- mmcv.image.imresize(img: numpy.ndarray, size: Tuple[int, int], return_scale: bool = False, interpolation: str = 'bilinear', out: Optional[numpy.ndarray] = None, backend: Optional[str] = None) → Union[Tuple[numpy.ndarray, float, float], numpy.ndarray][source]¶
Resize image to a given size.
- Parameters
img (ndarray) – The input image.
return_scale (bool) – Whether to return w_scale and h_scale.
interpolation (str) – Interpolation method, accepted values are “nearest”, “bilinear”, “bicubic”, “area”, “lanczos” for ‘cv2’ backend, “nearest”, “bilinear” for ‘pillow’ backend.
out (ndarray) – The output destination.
backend (str | None) – The image resize backend type. Options are cv2, pillow, None. If backend is None, the global imread_backend specified by
mmcv.use_backend()
will be used. Default: None.
- Returns
(resized_img, w_scale, h_scale) or resized_img.
- Return type
tuple | ndarray