def AffineNonUniformScale(sx,sy,new_size,filter=BILINEAR):
'''
Create a scale transform with different values for the x and y directions.
@param sx: scale in the x direction.
@param sy: scale in the y direction.
@param new_size: new size for the image.
@param filter: PIL filter to use.
'''
matrix = array([[sx,0,0],[0,sy,0],[0,0,1]],'d')
return AffineTransform(matrix,new_size,filter)
评论列表
文章目录