junxnone / aiwiki

AI Wiki
https://junxnone.github.io/aiwiki
18 stars 2 forks source link

Media Image Resize #347

Open junxnone opened 5 years ago

junxnone commented 5 years ago

Reference

Brief

Algo Description
Nearest Neighbor - 最近邻 使用 scale 坐标最近的值作为插值
  • 损失 空间对称性 - Alignment
  • Bilinear - 双线性
  • 计算量比最近邻大
  • 没有灰度不连续的缺点
  • 具有低通滤波性质,使高频分量受损,图像轮廓可能会有一点模糊,看起来更光滑
  • Bicubic 双三次
    Area 区域关系
    Lanczos

    Tips

    OpenCV

    dst = cv.resize( src, dsize[, dst[, fx[, fy[, interpolation]]]] )

    Flags Comment
    cv.INTER_NEAREST nearest neighbor interpolation 最近邻插值
    cv.INTER_LINEAR bilinear interpolation 双线性插值
    cv.INTER_CUBIC bicubic interpolation
    cv.INTER_AREA resampling using pixel area relation. It may be a preferred method for image decimation, as it gives moire'-free results. But when the image is zoomed, it is similar to the INTER_NEAREST method.
    cv.INTER_LANCZOS4 Lanczos interpolation over 8x8 neighborhood
    cv.INTER_LINEAR_EXACT Bit exact bilinear interpolation
    cv.INTER_MAX mask for interpolation codes
    cv.WARP_FILL_OUTLIERS flag, fills all of the destination image pixels. If some of them correspond to outliers in the source image, they are set to zero
    cv.WARP_INVERSE_MAP flag, inverse transformationFor example, linearPolar or logPolar transforms:
    image = cv2.imread('xxx')
    image_resize = cv2.resize(image, (w, h))
    junxnone commented 5 years ago

    455