Now that the foundation for the Laplacian Pyramid and statistics matching has been laid, we present our algorithm for texture synthesis. In a statistical context, the goal is to compactly parameterize the TI's textural features in terms of a set of statistics, and then to impart these statistics on an uncorrelated image, thus producing an SI with a similar texture. However, as mentioned above, the TI's textural features are generally scale-variant, making the characterization of all features at once quite difficult. Ideally, the subbands of the Laplacian Pyramid each contain unique image features at different scales.
The following pseudocode paints a clearer picture of the procedure. The SI (synthImg) begins as a random image.
synthImg = makeRandomImg()
synthPyr = makeLPyr(synthImg)
trainPyr = makeLPyr(trainImg)
do( i = 1 : Niter) {
synthPyr = matchCovariance(synthPyr,trainPyr)
synthPyr = matchHistogram(synthPyr,trainPyr)
}
synthImg = reconLPyr( synthPyr)
output: synthImg
The SI begins as random numbers. We decompose both the TI and the SI into their respective Laplacian Pyramids, and iterate, performing the aforementioned covariance and histogram matching technique between corresponding subbands of each pyramid. Finally, the synthetic pyramid is reconstructed and output.