Image Pyramids and Blending
Smoothing Filter
Assume the smoothing weights \(\hat w\) is \(1\times 5\). To make such weights a proper smoothing filters. \(\hat w\) is symmetric, sum to \(1\), and have equal contribution
then the convolution filter is \(W = \hat w\hat w^T\) is a \(5\times 5\) filter.
Reduce Function
Define \(Reduce: g_l\Rightarrow g_{l+1}\) where
so that \(g_{l+1} = D_L \cdot C_l\cdot g_l\) where \(g\) is vectorized image.
Laplacian Pyramid
Let \(L_i = g_i - expand(g_{i+1})\) be the difference between levels \(g_l, g_{l+1}\), since \(g_{l+1}\) has different size. We need to expand.
Expand Function
Blending
Given source images \(A,B\) and binary matte \(M\), compute Laplacian Pyramids for \(A, B\) i.e. \(AL_0, ..., AL_{N-1}, Ag_N, BL_0, ..., BL_{N-1}, Bg_N\), Gaussian pyramid for \(M\), i.e. \(Mg_0, ..., Mg_N\). Then, using matting equation, using \(M\) as alpha channel.
Finally, reconstruct Laplacian pyramid \(SL\), which is desired.