Created
January 3, 2015 03:10
-
-
Save sherbondy/92e0fd4468f035c4140c to your computer and use it in GitHub Desktop.
Reconstruct Laplacian Pyramid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# reconstruct an image (approximate, for the time being), from its pyramidal decomposition | |
function reconstruct(L) | |
im = last(L) | |
for n = (length(L)-1):-1:1 | |
# upscale | |
im2 = zeros(2*size(im)[1], 2*size(im)[2]) | |
im2[1:2:end,1:2:end, :] = im | |
# gaussian interpolation | |
kernel = [1/18, 1/2, 16/18, 1/2, 1/18]; | |
im2 = imfilter(imfilter(im2, kernel, "reflect"), kernel', "reflect") | |
im = im2 | |
im += L[n] | |
end | |
return im | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment