{% extends "base.html" %} {% block title %} resize {% endblock %} {% block description %}
This function resizes the image down to or up to the specified size.
{% endblock %} {% block signature %}cv2.resize(src, dsize[, dst[, fx[, fy[,interpolation]]]]) → dst{% endblock %} {% block parameters %}
cv2.CV_8U
, cv2.CV_16U
, cv2.CV_16S
, cv2.CV_32F
or cv2.CV_64F
.dsize = Size(round(fx * src.cols), round(fy * src.rows))
.(double)dsize.width/src.cols
. Default is 0. (double)dsize.height/src.rows
. Default is 0.cv2.INTER_*
): Interpolation method. INTER_LINEAR is default. Choose from:
dsize
or both fx
and fy
must be non-zero.dst
type or size are not taken into account. Instead the size and type are derived from the src
, dsize
, fx
, and fy
.Resizing, by default, does only change the width and height of the image. The aspect ratio can be preserved or not, based on the requirement.
{% endblock %} {% block references %} {% endblock %}