Resizes an image.
resize resizes the image
src down to
or up to the specified size.Note that the initial
dst type or
size are not taken into account. Instead, the size and type are derived from
If you want to resize
src so that it fits the pre-created
dst, you may call the function as follows:
// C++ code:
// explicitly specify dsize=dst.size(); fx and fy will be computed from that.
resize(src, dst, dst.size(), 0, 0, interpolation);
If you want to decimate the image by factor of 2 in each direction, you can
call the function this way:
// specify fx and fy and let the function compute the destination image size.
resize(src, dst, Size(), 0.5, 0.5, interpolation);
To shrink an image, it will generally look best with CV_INTER_AREA
interpolation, whereas to enlarge an image, it will generally look best with
CV_INTER_CUBIC (slow) or CV_INTER_LINEAR (faster but still looks OK).