下采样没有平滑

Vad*_*rov 6 opencv

是否有内置的方法可以在没有事先高斯平滑(由pyrDown C++函数执行)的情况下对OpenCV 2.3.1中的图像进行下采样.

谢谢.

fir*_*ant 6

也许你正在寻找resize().

# Python code:
import cv2
large_img = cv2.imread('our_large_image.jpg')
small_to_large_image_size_ratio = 0.2
small_img = cv2.resize(l_img, 
                       (0,0), # set fx and fy, not the final size
                       fx=small_to_large_image_size_ratio, 
                       fy=small_to_large_image_size_ratio, 
                       interpolation=cv2.INTER_NEAREST)
Run Code Online (Sandbox Code Playgroud)