Mathematical Problems in Engineering

Volume 2012, Article ID 305384, 12 pages

http://dx.doi.org/10.1155/2012/305384

## A New Texture Synthesis Algorithm Based on Wavelet Packet Tree

^{1}Department of Computer Science and Information Engineering, National United University, Miaoli 36003, Taiwan^{2}Department of Electronics Engineering, Chung Hua University, Hsinchu City 30012, Taiwan^{3}Department of Mathematics, University of Salerno, Via Ponte Don Melillo, 84084 Fisciano, Italy

Received 14 February 2012; Accepted 15 March 2012

Academic Editor: Ming Li

Copyright © 2012 Hsi Chin Hsin et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

This paper presents an efficient texture synthesis based on wavelet packet tree (TSWPT). It has the advantage of using a multiresolution representation with a greater diversity of bases functions for the nonlinear time series applications such as fractal images. The input image is decomposed into wavelet packet coefficients, which are rearranged and organized to form hierarchical trees called wavelet packet trees. A 2-step matching, that is, coarse matching based on low-frequency wavelet packet coefficients followed by fine matching based on middle-high-frequency wavelet packet coefficients, is proposed for texture synthesis. Experimental results show that the TSWPT algorithm is preferable, especially in terms of computation time.

#### 1. Introduction

Texture modeling can be effectively applied to a wide variety of natural surfaces such as plants, furs, skins, minerals, terrains, and fractal materials [1, 2] and is an important issue in cyber-physical systems [3–7]. Numerous techniques have been proposed for texture processing; one may refer to [8] for a complete survey.

Given an example texture, the goal of texture synthesis is to produce a visually similar image of any size. One may easily tile small textures to synthesize a larger image; however, there are some blocking effects near the tile edges [9]. Although some smoothing methods were proposed to reduce the blocking effects at the cost of computation time, it seems to be limited in improvements, especially for structured textures [10]. Efros and Leung proposed a neighborhood matching method [11], in which each pixel of the synthesis image was obtained by searching the most similar one in the source image based on the user-defined neighboring pixels. Wei and Levoy took account of the order in which pixels were synthesized and proposed an order-independent search-based texture synthesis algorithm [12]. Instead of synthesizing one pixel at a time, a patch of pixels can be taken as a whole and synthesized by matching the overlap regions between neighboring patches [13–15]. To improve the synthesis speed, the multi-resolution approach has been widely used for texture analysis and synthesis [16, 17]; Fang and Lien developed a rapid image synthesis system by adopting a multi-resolution approach, which consisted of an analysis process and a synthesis process. It consumed most of the computation time in the analysis process; yet the speed of synthesis was very fast [16]. In [17], De Bonet proposed a scheme of generating the synthesis image by sampling the filtered outputs of a texture in the framework of Laplacian pyramid [18]. Burt adopted the Gaussian pyramid [19] to represent both the input texture and the synthesis image at multiple resolutions and synthesized the texture images from lower to higher resolutions [20].

Wavelet transform provides an efficient multi-resolution representation [21], in which the higher frequency components of an image are projected onto the shorter basis functions with higher spatial resolutions and the lower frequency components are projected onto the larger basis functions with higher spectral resolutions. Such a compact representation matches the characteristics of human visual system [22]. Wavelet theory has been successfully applied to many applications such as parameter estimation in fractal signals and images [23–29]. Yu et al. randomly sampled blocks of wavelet coefficients from the input texture to substitute that of the synthesis image [30]. Cui et al. adopted a 2-level wavelet transform and generated the synthesis image by minimizing the sum of squared distances between neighboring blocks of wavelet coefficients [31].

For images with textures, lots of wavelet coefficients are likely to be significant in the middle-high frequency subbands, which surely demand further decompositions for a more compact representation [32]. Note that wavelet transform only decomposes the low-frequency component of an image at each resolution. However, both the low-frequency and high-frequency components can be decomposed using wavelet packet transform, which provides more bases functions than wavelet transform [33]. In [34], we proposed an efficient scheme to organize the wavelet packet coefficients of an image into hierarchical trees called wavelet packet (WP) trees for image compression. In this paper, an efficient WP tree-based algorithm is proposed for the texture synthesis applications.

The remainder of this paper proceeds as follows. In Section 2, wavelet transform and wavelet packet transform are briefly reviewed. Section 3 describes the proposed scheme to synthesize a texture image based on the WP trees of an example texture. Experimental results are presented in Section 4. Conclusion can be found in Section 5.

#### 2. Review of Wavelet Transform and Wavelet Packet Transform

Wavelet-transform- (WT-) based multiresolution analysis/synthesis has drawn a lot of attention to the signal/image/video applications. The extension of WT known as wavelet packet transform (WPT) provides a much larger family of bases functions with a more compact representation. In this section, a brief review of WT and WPT is given. For a more complete survey, we refer readers to [21].

##### 2.1. Wavelet Transform

WT has a variety of desirable properties, for example, joint space-spatial frequency localization, self-similarity across subbands of the same orientation, and energy clustering within each subband. For a discrete signal at resolution , , the wavelet transform is defined as where is a (mother) wavelet, is the corresponding scaling function, is the approximation signal at the next coarser resolution , is the detail information between resolutions and , and are low-pass filter and high-pass filter, respectively, and is an inner product operator. can be exactly reconstructed from and by using the following inverse wavelet transform (IWT): where and .

For the image applications, 2D WT can be obtained by using a tensor product of two 1D WTs, horizontally followed by vertically or vice versa. Specifically, let be an image at the finest resolution 0, where and are indices for the vertical and horizontal orientations, respectively. The 2D WT of is as follows: where is the approximation image at the next coarser resolution 1, , , and are the detail images in the vertical, horizontal, and diagonal orientations, respectively. Figure 1 shows a 2-level 2D WT, where subbands , , ; , and are delimited by solid lines. Similarly, 2D IWT can be obtained by using the tensor product of two 1D IWTs.

##### 2.2. Wavelet Packet Transform

2D WT is only to decompose the lowest-frequency subband of an image in an iterative manner. More specifically, only the scaling coefficients are decomposed from higher to lower resolutions. However, for the texture applications, wavelet coefficients in the middle- and high-frequency subbands are likely to be significant, which needs to be taken into account to improve the multiresolution representation.

As one can see, both the low-frequency scaling coefficients and high-frequency wavelet coefficients of a signal, at any resolution, can be decomposed, which leads to wavelet packet transform (WPT), and a much larger family of bases functions can be produced [33]. Moreover, 2D WPT can be obtained by using a tensor product of two 1D WPTs. Figure 1 shows a 2-level 2D WPT, where all the wavelet subbands , , and , at resolution 1, are further decomposed into wavelet packet subbands delimited by dashed lines.

#### 3. Wavelet-Packet-Tree-Based Texture Synthesis

Wavelet packet transform provides more bases functions, which leads to a more compact representation in comparison with wavelet transform. For the image-coding applications, we had proposed an efficient scheme to organize the wavelet packet (WP) coefficients of an image into hierarchical trees called WP trees [32]. In this section, we explore the key features of WP trees and propose a WP-tree-based algorithm for texture synthesis.

##### 3.1. Wavelet Packet Tree

The WP coefficients of a sequence of wavelet coefficients , at resolution , are computed by which can be efficiently rearranged and concatenated by After the rearrangement and concatenation above, the dyadic relationship of wavelet coefficients across subbands is still valid and can be used to construct the dyadic WP trees of a signal. Similarly, the (2D) WP trees of an image can be obtained by rearranging the WP coefficients horizontally followed by vertically or vice versa. Figure 1 shows a 2-level WP tree with arrows connecting the related WP coefficients.

The key idea behind the construction of WP trees is based on the spatial relationships of WP coefficients. It has the same structure, that is, quad-tree structure, as the conventional wavelet trees. Furthermore, the number of high-energy wavelet coefficients can be significantly reduced through the use of wavelet packet transform. Take the rice image shown in Figure 5 as an example. The cumulative energy distribution (CED) of wavelet coefficients or WP coefficients is given by where , is the sorted magnitudes of wavelet coefficients or WP coefficients in descending order, in is the number of coefficients, and is the total number of coefficients. Figure 2 shows the CED curves of wavelet coefficients and WP coefficients, where the horizontal and vertical axes are the number of coefficients and percentage of energy, respectively. It is noted that the energy clustering of WP coefficients is more compact than wavelet coefficients. As a result, the WP-based representation is preferable to the wavelet-based representation for texture images.

##### 3.2. Proposed Algorithm

As noted, the low-frequency WP coefficients retain the global information of an image, and the high-frequency WP coefficients contain the local detail. It is desirable to coarsely synthesize an image based on the low-frequency WP coefficients and then tune the intermediate synthesis result based on the high-frequency WP coefficients. Motivated by the fact above, we propose an efficient WP-tree-based texture synthesis algorithm using a two-step process: a coarse searching followed by a fine tuning. Figure 2 depicts a flowchart of the proposed algorithm. It is presented in steps as follows.

*Step 1 (initialization). *Decompose the source image by wavelet packet transform, rearrange the high-frequency WP coefficients, and construct the WP trees. Randomly select a WP tree from the source image, which is replicated in the upper left corner of the synthesis image.

*Step 2 (coarse matching). *For every WP tree to be synthesized, starting from the upper left corner to the lower right corner of the synthesis image, search the candidate WP trees from the source image by using a coarse matching with a tolerance as follows:
where is the set of candidate WP trees obtained from the source image for matching the synthesis WP tree , with the tolerance , is a given threshold, is the distance between and based on the low-frequency nodes (LFNs) of WP trees, and and are neighbors of and , respectively. Causal neighborhoods were used in our experiments.

*Step 3 (fine matching). *After the coarse matching in Step 2, the following fine matching is used to find the best WP tree based on the high-frequency nodes (HFNs) of the candidate WP trees.
where in (3.5).

*Step 4. *Repeat Step 2 followed by Step 3 until all the WP trees to be synthesized are obtained from the WP trees of the source image.

*Step 5. *Finally, the synthesis image is obtained by taking the inverse wavelet packet transform of the synthesis WP trees.

To reduce the synthesis time, one can easily modify Steps 2 and 3 by using patches of WP trees instead of single WP trees. Moreover, it is noted that lots of high-frequency WP coefficients are not significant, and only a small portion of middle-frequency WP coefficients are sufficient for the fine matching in Step 3. Thus, the proposed texture synthesis based on wavelet packet tree (TSWPT) algorithm is simple and computationally efficient. Flowchart of the TSWPT algorithm is shown in Figure 3.

#### 4. Experimental Results

In the first experiment, the size of source images is , which are shown in the 1st column of Figure 4; the size of synthesis images is . The TSWPT algorithm is applied to patches of WP trees in order to reduce computation time. The size of patches is , and the width of overlapped regions between neighboring patches is 3. The root nodes of WP trees, that is, WP coefficients in the lowest frequency subband, are used in the coarse matching step to retain the global appearance of the input source image. Since the essential components of textures are mainly distributed in the middle-frequency subbands, the highest-frequency WP coefficients, that is, the leaf nodes of WP trees, can be ignored in the fine matching step. The biorthogonal 9/7 wavelet is used. The threshold value, , is set to 0.1.

Two widely used algorithms, Efros’ algorithm [13] and Cui’s algorithm [31], were used for comparisons with the TSWPT algorithm. The synthesis results are shown in the 2nd, 3rd, and 4th columns of Figure 4, respectively. Visual inspection shows that TSWPT is comparable to Cui’s algorithm and is preferable to Efros’ algorithm. All the algorithms were implemented by Matlab without optimization in source codes. Table 1 shows the computation times running on PC with CPU of 1.7 GHz. It is noted that TSWPT is superior to both Efros’ and Cui’s algorithms.

In the second experiment, the sizes of source image and synthesis image are and , respectively. All the settings are the same as the first experiment. The source image and synthesis results using Efros’ algorithm and TSWPT are shown in Figure 5. It is shown that there are some blocking effects in the synthesis image using Efros’ algorithm. However, blocking effects are likely to be eliminated by using the TSWPT algorithm due largely to the filtering operations of inverse wavelet packet transform in Step 5. Figure 6 shows the computation times at various enlargement rates of image size. As one can see, the TSWPT algorithm outperforms both Efros’ and Cui’s algorithms.

#### 5. Conclusion

The multi-resolution approach is suitable for texture synthesis in terms of computation time. Wavelet packet transform provides more bases functions than wavelet transform and therefore produces a more compact representation. We adopt wavelet packet transform to analyze the input texture and organize wavelet packet coefficients to form hierarchical trees called wavelet packet trees. The low-frequency nodes of wavelet packet trees contain the global characteristics of an image; the high-frequency nodes contain the local details. Thus, we propose texture synthesis based on wavelet packet tree (TSWPT). It has the advantage of saving computation time dramatically, and moreover, no training process is needed. Given a texture, experimental results show that the computation time for synthesizing an image is only a fraction of a second.

#### Acknowledgment

The National Science Council of Taiwan, under Grants NSC100-2628-E-239-002-MY2, supported this work.

#### References

- M. Li, “Fractal time series–a tutorial review,”
*Mathematical Problems in Engineering*, vol. 2010, Article ID 157264, 26 pages, 2010. View at Publisher · View at Google Scholar · View at Zentralblatt MATH - C. Cattani, G. Pierro, and G. Altieri, “Entropy and multifractality for the myeloma multiple TET 2 gene,”
*Mathematical Problems in Engineering*, vol. 2012, Article ID 193761, 14 pages, 2012. View at Publisher · View at Google Scholar - M. Li and W. Zhao, “Visiting power laws in cyber-physical networking systems,”
*Mathematical Problems in Engineering*, vol. 2012, Article ID 302786, 13 pages, 2012. View at Publisher · View at Google Scholar - A. Hausner, “Simulating decorative mosaics,” in
*Computer Graphics Annual Conference (SIGGRAPH '01)*, pp. 573–580, August 2001. View at Scopus - F. Neyret, “Modeling, animating, and rendering complex scenes using volumetric textures,”
*IEEE Transactions on Visualization and Computer Graphics*, vol. 4, no. 1, pp. 55–70, 1998. View at Google Scholar · View at Scopus - X. Tong, J. Zhang, L. Liu, X. Wang, B. Guo, and H. Y. Shum, “Synthesis of bidirectional texture functions on arbitrary surfaces,”
*ACM Transactions on Graphics*, vol. 21, no. 3, pp. 665–672, 2002. View at Google Scholar · View at Scopus - E. Risser, C. Han, R. Dahyot, and E. Grinspun, “Synthesizing structured image hybrids,”
*ACM Transactions on Graphics*, vol. 29, no. 4, article no. 85, 2010. View at Publisher · View at Google Scholar · View at Scopus - N. Pietroni, P. Cignoni, M. Otaduy, and R. Scopigno, “Solid-texture synthesis: a survey,”
*IEEE Computer Graphics and Applications*, vol. 30, no. 4, pp. 74–89, 2010. View at Publisher · View at Google Scholar · View at Scopus - Y. Xu, B. Guo, and H. Y. Shum, “Chaos mosaic: fast and memory efficient texture synthesis,” MSR-TR-2000-32, Microsoft Research, 2000.
- J. Portilla and E. P. Simoncelli, “Parametric texture model based on joint statistics of complex wavelet coefficients,”
*International Journal of Computer Vision*, vol. 40, no. 1, pp. 49–71, 2000. View at Publisher · View at Google Scholar · View at Scopus - A. A. Efros and T. K. Leung, “Texture synthesis by non-parametric sampling,” in
*7th IEEE International Conference on Computer Vision (ICCV '99)*, pp. 1033–1038, September 1999. View at Scopus - L. Y. Wei and M. Levoy, “Order independent texture synthesis,” Stanford Computer Science TR-2002-01, 2002.
- A. A. Efros and W. T. Freeman, “Image quilting for texture synthesis and transfer,” in
*Computer Graphics Annual Conference (SIGGRAPH '01)*, pp. 341–346, August 2001. View at Scopus - L. Liang, C. Liu, Y. Xu, B. Guo, and H. Y. Shum, “Real-time texture synthesis using patch-based sampling,”
*ACM Transactions on Graphics*, vol. 20, no. 3, pp. 127–150, 2001. View at Google Scholar - V. Kwatra, A. Schödl, I. Essa, G. Turk, and A. Bobick, “Graphcut textures: image and video synthesis using graph cuts,”
*ACM Transactions on Graphics*, vol. 22, no. 3, pp. 277–286, 2003. View at Publisher · View at Google Scholar · View at Scopus - C.-W. Fang and J.-J. J. Lien, “Rapid image completion system using multiresolution patch-based directional and nondirectional approaches,”
*IEEE Transactions on Image Processing*, vol. 18, no. 12, pp. 2769–2779, 2009. View at Publisher · View at Google Scholar - J. S. De Bonet, “Multiresolution sampling procedure for analysis and synthesis of texture images,” in
*Conference on Computer Graphics (SIGGRAPH '97)*, pp. 361–368, August 1997. View at Scopus - P. J. Burt and E. H. Adelson, “The laplacian pyramid as a compact image code,”
*IEEE Transactions on Communications*, vol. 31, no. 4, pp. 532–540, 1983. View at Google Scholar · View at Scopus - P. J. Burt, “Fast algorithms for estimating local image properties.,”
*Computer Vision, Graphics, & Image Processing*, vol. 21, no. 3, pp. 368–382, 1983. View at Google Scholar · View at Scopus - L. Y. Wei and M. Levoy, “Fast texture synthesis using tree-structured vector quantization,” in
*Computer Graphics Annual Conference (SIGGRAPH '00)*, pp. 479–488, July 2000. View at Scopus - G. Strang and T. Nguyen,
*Wavelets and Filter Banks*, Wellesley-Cambridge Press, Wellesley, Mass, USA, 1996. - C. K. Su, H. C. Hsin, and S. F. Lin, “Wavelet tree classification and hybrid coding for image compression,”
*IEE Proceedings—Vision, Image, and Signal Processing*, vol. 152, no. 6, pp. 752–756, 2005. View at Google Scholar - C. Cattani and J. Rushchitsky,
*Wavelet and Wave Analysis as Applied to Materials with Micro or Nanostructure*, vol. 74 of*Series on Advances in Mathematics for Applied Sciences*, World Scientific, Hackensack, NJ, USA, 2007. - Z. W. Liao, S. X. Hu, M. Li, and W. Chen, “Noise estimation for single-slice sinogram of low-dose X-ray computed tomography using homogenous patch,”
*Mathematical Problems in Engineering*, vol. 2012, Article ID 696212, 16 pages, 2012. View at Publisher · View at Google Scholar - M. Li, C. Cattani, and S. Y. Chen, “Viewing sea level by a one-dimensional random function with long memory,”
*Mathematical Problems in Engineering*, vol. 2011, Article ID 654284, 13 pages, 2011. View at Publisher · View at Google Scholar · View at Scopus - J. W. Yanga, M. Li, Z. Chen, and Y. Chen, “Cutting affine invariant moments,”
*Mathematical Problems in Engineering*. In press. - B. Chen and W.-S. Chen, “Noisy image segmentation based on wavelet transform and active contour model,”
*Applicable Analysis*, vol. 90, no. 8, pp. 1243–1255, 2011. View at Publisher · View at Google Scholar - B. Chen, P. C. Yuen, J. H. Lai, and W. S. Chen, “Image segmentation and selective smoothing based on variational framework,”
*Journal of Signal Processing Systems*, vol. 54, no. 1–3, pp. 145–158, 2009. View at Publisher · View at Google Scholar · View at Scopus - B. Chen, Y. Li, and J. L. Cai, “Noisy image segmentation based on nonlinear diffusion equation model,”
*Applied Mathematical Modeling*, vol. 36, no. 3, pp. 1197–1208, 2012. View at Google Scholar - Y. Yu, J. Luo, and C. W. Chen, “Multiresolution block sampling-based method for texture synthesis,” in
*16th International Conference on Pattern Recognition (ICPR '02)*, pp. 239–242, 2002. - H. F. Cui, X. Zheng, and T. Ruan, “An efficient texture synthesis algorithm based on WT,” in
*7th International Conference on Machine Learning and Cybernetics (ICMLC '08)*, pp. 3472–3477, July 2008. View at Publisher · View at Google Scholar · View at Scopus - T. Y. Sung and H. C. Hsin, “An efficient rearrangement of wavelet packet coefficients for embedded image coding based on SPIHT algorithm,”
*IEICE Transactions on Fundamentals of Electronics, Communications and Computer Sciences*, vol. E90-A, no. 9, pp. 2014–2020, 2007. View at Publisher · View at Google Scholar · View at Scopus - N. M. Rajpoot, R. G. Wilson, F. G. Meyer, and R. R. Coifman, “Adaptive wavelet packet basis selection for zerotree image coding,”
*IEEE Transactions on Image Processing*, vol. 12, no. 12, pp. 1460–1472, 2003. View at Publisher · View at Google Scholar - H. C. Hsin and T. Y. Sung, “Adaptive selection and rearrangement of wavelet packets for quad-tree image coding,”
*IEICE Transactions on Fundamentals of Electronics, Communications and Computer Sciences*, vol. E91-A, no. 9, pp. 2655–2662, 2008. View at Publisher · View at Google Scholar · View at Scopus