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()

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Dontla

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值