Skip to content

Instantly share code, notes, and snippets.

@sherbondy
Created January 3, 2015 03:10
Show Gist options
  • Save sherbondy/3c533708697e2ad19092 to your computer and use it in GitHub Desktop.
Save sherbondy/3c533708697e2ad19092 to your computer and use it in GitHub Desktop.
Laplacian Pyramid
# generates a laplacian pyramid decomposition of an image A, with nlevels + 1 residual level
function lappyramid(A, nlevels)
residual = A
pyramid = ()
for n = 1:nlevels
(N, Ns) = impyramid(residual, sizes="both")
L = residual - N
residual = Ns
pyramid = tuple(pyramid..., L)
end
return tuple(pyramid..., residual)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment