python opencv cv2.resize()函数

**def resize(src, dsize, dst=None, fx=None, fy=None, interpolation=None): # real signature unknown; restored from __doc__
    """
    resize(src, dsize[, dst[, fx[, fy[, interpolation]]]]) -> dst
    .   @brief Resizes an image. 调整图像大小。
    .   
    .   The function 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
    .   the `src`,`dsize`,`fx`, and `fy`. If you want to resize src so that it fits the pre-created dst,
    .   you may call the function as follows:

		函数调整大小可将图像src调整为指定大小或最大。 
		请注意,未考虑初始dst类型或大小。 
		相反,大小和类型是从src,dsize,fx和fy派生的。 
		如果要调整src的大小以使其适合预先创建的dst,则可以按以下方式调用该函数:
	
    .   @code 代码
    .   // explicitly specify 明确指定 dsize=dst.size(); fx and fy will be computed from that. fx和fy将据此计算。
    .   resize(src, dst, dst.size(), 0, 0, interpolation);
    .   @endcode 结束代码
    
    .   If you want to decimate the image by factor of 2 in each direction, you can call the function this
    .   way:
		如果要在每个方向上将图像缩小2倍,则可以通过以下方式调用该函数:
	
    .   @code
    .   // specify fx and fy and let the function compute the destination image size.
		指定fx和fy并让函数计算目标图像尺寸。
    .   resize(src, dst, Size(), 0.5, 0.5, interpolation);
    .   @endcode
    
    .   To shrink an image, it will generally look best with #INTER_AREA interpolation, whereas to
    .   enlarge an image, it will generally look best with c#INTER_CUBIC (slow) or #INTER_LINEAR
    .   (faster but still looks OK).

		要缩小图像,通常使用#INTER_AREA插值效果最佳,
		而要放大图像,通常使用c#INTER_CUBIC(速度慢)或#INTER_LINEAR(速度更快,但看起来仍然可以)最好。
    .   
    .   @param src input image. 输入图像
    
    .   @param dst output image; it has the size dsize (when it is non-zero) or the size computed from
    .   src.size(), fx, and fy; the type of dst is the same as of src.
    	输出图像; 它的大小为dsize(非零时)或通过src.size(),fx和fy计算得出的大小; dst的类型与src相同。
    	
    .   @param dsize output image size; if it equals zero, it is computed as:
    .   \f[\texttt{dsize = Size(round(fx*src.cols), round(fy*src.rows))}\f]
    .   Either dsize or both fx and fy must be non-zero.
    	输出图像尺寸; 如果它等于零,
    	则计算为:\ f [\ texttt {dsize = Size(round(fx * src.cols),round(fy * src.rows))} \ f]。
		dsize或fx和fy都必须为非零。
		
    .   @param fx scale factor along the horizontal axis; when it equals 0, it is computed as
    .   \f[\texttt{(double)dsize.width/src.cols}\f]
		沿水平轴的比例因子; 当它等于0时,将计算为\ f [\ texttt {(double)dsize.width / src.cols} \ f]

    .   @param fy scale factor along the vertical axis; when it equals 0, it is computed as
    .   \f[\texttt{(double)dsize.height/src.rows}\f]
		沿垂直轴的比例因子; 当它等于0时,将计算为\ f [\ texttt {(double)dsize.height / src.rows} \ f]

    .   @param interpolation interpolation method, see #InterpolationFlags
		插值方法,请参见#InterpolationFlags
    .   
    .   @sa  warpAffine, warpPerspective, remap
    """
    pass**

参考文章:cv2.resize()函数应用示例——python opencv 等比例调整图片分辨率大小代码 cv2.resize()

你可能感兴趣的:(Opencv)