opencv the image pyramid (Gaussian pyramid, a Laplacian pyramid)

Image pyramid
1, Gaussian pyramid
2, Laplacian pyramid
Here Insert Picture Description
of Gaussian pyramid: down-sampling process (reduction)
Here Insert Picture Description
on the Gaussian pyramid: sampling up (enlarged)
Here Insert Picture Description

img=cv2.imread("AM.png")
cv_show(img,'img')
print(img.shape)
#(442, 340, 3)

Here Insert Picture Description

up=cv2.pyrUp(img)
cv_show(up,'up')
print (up.shape)
#(884, 680, 3)

Here Insert Picture Description

down=cv2.pyrDown(img)
cv_show(down,'down')
print (down.shape)
#(221, 170, 3)

Here Insert Picture Description
Laplacian pyramid
Here Insert Picture Description

down=cv2.pyrDown(img)
down_up=cv2.pyrUp(down)
l_1=img-down_up
cv_show(l_1,'l_1')

Here Insert Picture Description

Note that there are certain: the above principle by the Gaussian pyramid and down sampling may know, when we first sampled and then the next sampling; or vice versa operation, this time to get the original image and the size is the same, although but there will be some image blurring (or distortion)

Published 27 original articles · won praise 20 · views 1549

Guess you like

Origin blog.csdn.net/qq_39507748/article/details/104543717