|
|
@ -117,7 +117,7 @@ for i in range(5,0,-1): |
|
|
|
LS = [] |
|
|
|
LS = [] |
|
|
|
for la,lb in zip(lpA,lpB): |
|
|
|
for la,lb in zip(lpA,lpB): |
|
|
|
rows,cols,dpt = la.shape |
|
|
|
rows,cols,dpt = la.shape |
|
|
|
ls = np.hstack((la[:,0:cols/2], lb[:,cols/2:])) |
|
|
|
ls = np.hstack((la[:,0:cols//2], lb[:,cols//2:])) |
|
|
|
LS.append(ls) |
|
|
|
LS.append(ls) |
|
|
|
|
|
|
|
|
|
|
|
# now reconstruct |
|
|
|
# now reconstruct |
|
|
@ -127,7 +127,7 @@ for i in range(1,6): |
|
|
|
ls_ = cv.add(ls_, LS[i]) |
|
|
|
ls_ = cv.add(ls_, LS[i]) |
|
|
|
|
|
|
|
|
|
|
|
# image with direct connecting each half |
|
|
|
# image with direct connecting each half |
|
|
|
real = np.hstack((A[:,:cols/2],B[:,cols/2:])) |
|
|
|
real = np.hstack((A[:,:cols//2],B[:,cols//2:])) |
|
|
|
|
|
|
|
|
|
|
|
cv.imwrite('Pyramid_blending2.jpg',ls_) |
|
|
|
cv.imwrite('Pyramid_blending2.jpg',ls_) |
|
|
|
cv.imwrite('Direct_blending.jpg',real) |
|
|
|
cv.imwrite('Direct_blending.jpg',real) |
|
|
|