Presentation is loading. Please wait.

Presentation is loading. Please wait.

Fast Image Replacement Using Multi-Resolution Approach Chih-Wei Fang and Jenn-Jier James Lien Robotics Lab Department of Computer Science and Information.

Similar presentations


Presentation on theme: "Fast Image Replacement Using Multi-Resolution Approach Chih-Wei Fang and Jenn-Jier James Lien Robotics Lab Department of Computer Science and Information."— Presentation transcript:

1 Fast Image Replacement Using Multi-Resolution Approach Chih-Wei Fang and Jenn-Jier James Lien Robotics Lab Department of Computer Science and Information Engineering National Cheng Kung University

2 Robotics Lab. Motivation Photographs sometimes include unwanted objects. Lose data when the network transmits media (ex. video)

3 System: Two modules Texture Analysis (or Training) Module Texture Synthesis Module

4 Texture Analysis Module Input image for training (Size: W x H) Is Periodic Yes No Non-periodic pattern side-by-side Periodic pattern side-by-side Processing for Γ-shaped pattern Principal Component Analysis (PCA) : Weight vector (W 1… W N ) for each Γ-shaped pattern Vector Quantization (VQ) : Speeding up to search the best patches. Mp > Mn M = Mp or Mn Processing for periodic pattern There are Mp patches. Processing for non- periodic pattern There are Mn patches. …………

5 1. Sampling Processing for non-periodic pattern  A pixel-by-pixel shifting method is used to divide the input texture into M patches. M = (W–Wp+1)× (H–Hp+1)  W is the width of the input image (or texture)  H is the height of the input image  Wp is the width of the patch.  Hp is the height of the patch.

6 Processing for periodic pattern  The pattern is divided into M patches, where M=W×H. Periodic patterns have continuous veins between two equivalent patterns when positioned side by side. When the patch reaches the boundary of the input image, in order to form a complete patch, additional pixels are supplied from the opposite border.

7 Processing for the Γ-shaped pattern  Taking the whole pieces of the patch as training data may lead to an overestimation of the underlying structure of the patch and will certainly increase the length of the training time.  In addition, searching the matching patches by considering their whole contents generally produce unsatisfactory results since the whole contents tend to be quite different from the initial random values and it may cause the rim effect to become distinct. ω pixels

8 Each patch has K elements. During training, PCA is used to transform the original K×M matrix to an N×K matrix, where M>>K>N. And there are N eigenvectors. This can reduce most of the time complexity operations, and hence dramatically increases the performance. Recombining the appearance of the features while maintaining the coherence of the characteristic content 2. Principal Component Analysis (PCA) PCA

9 After the PCA process and a sort based on the eigenvalues with corresponding eigenvectors:  The first several eigenvectors control the global geometrical structure.  The middle eigenvectors control the local features.  The last few eigenvectors are controlled by some noises. These noises cause the photograph to appear truer, but have no influence on the geometric structure. Therefore a good matching structure need only compare the first several eigenvectors.

10 3. Vector Quantization (VQ) Searching for the best matching pattern from the eigenspace Ψ during the synthesis process is a computationally expensive task. In order to speed up the synthesis process, the training data is initially projected onto the eigenspace Ψ in order to retrieve the weight vectors. The data is then separated into C clusters by means of VQ. Using this approach, the computational time can be reduced from O(M) to O( ).

11 3. Similarity measure (based on SSD): Using the weight vector to find the closest cluster and then find the best matching patch from this cluster in the input image. Then this matching patch is called to fill the region of the search window. Texture Synthesis Module 1. Initialization: Each pixel is assigned a random value in the WoxHo-pixel output image area. Shifting this search window over this image in the scan-line order from the top-left order to the bottom-right order. …… … 2. Γ-shaped pattern projectiong: Each WpxHp-pixel search window (or patch) is taken the Γ-shaped pattern and then projected onto the eigenspace Ψ to obtain one N-dimensional weight vector. …… … 4. Result: Find the best patches to fill in the WoxHo-pixel output image.

12 Texture Synthesis Module : Demo

13 Image Replacement Down-sampling with Texture Analysis Up-sampling with Texture Synthesis I0I0 I1I1 I2I2 I3I3 I4I4 β4β4 β3β3 β2β2 β1β1 β0β0 C0C0 C3C3 C4C4 C2C2 C1C1

14 1. Preprocessing Using Multi-resolution Approach The input image I 0 and the inverse matte β 0 to do l times down-sampling ↓, then to get each level of input image I i and inverse matte β i, i=0~l B i denotes the background region and the foreground region F i is then utilized to search the background B i

15 2. Training Process Based on Background Region If the same Γ-shaped pattern of the search window (or patch) is applied, the fragment between two different textures will be mapped by only one texture rather than being mapped by the mixing of two different textures. Hence, the search window is modified. ω K pixels …

16 3. Completion Process The reconstructed image C i  First, the system reconstructs the level i (i=l) image I i  The replaced part is reconstructed (or synthesized), called I i ’  Only the reconstructed part of I i ’ is preserved at position F i  The other parts are replaced by the original background B i The system applies the up-sampling ↑ technique  from the reconstructed image C i at level i and proceeds to only replace the level i-1 image I i-1 at position F i-1

17 Image Replacement : Demo

18 Experimental Results Table 1: Average training time in Section 3 for input images of various sizes. Units of time: milliseconds (ms). Size of input image (pixels) 64x6496x96128x128 PCA250437875 Projecting to eigenspace3597031656 VQ203391953 Total time (ms)81215313484 Table 2: Average synthesizing time in Section 4 for output images of various sizes. Size of output image (pixels) 200x200300x300400x400600x600 Synthesis time (ms)113759140

19 Table 3: The replacement information of each level in Figure 9 and Figure 12 for multi-resolution approach. “~0” means close to 0 ms. LevelWidth (pixels)Height (pixels) Number of whole patches Synthesis time (ms) 039236411403463 11961822427216 296914024~0 34946110~0 425230~0

20 Table 4: The time in Figure 9 and Figure 12 for various processes. The total time of the training and synthesis processes include the processes of the multi-resolution approach, PCA, projection (the patches are projected onto eigenspace Ψ to obtain the weight vectors), VQ, and synthesis. MethodTime (ms) Data typeGray valueRGB space Training process Multi-resolution3231 PCA8917719 Projecting to eigenspace18284906 VQ421375 Synthesis process Synthesis78108 Total time325013139

21 Conclusions We developed a system including two modules  the texture analysis and synthesis modules. This system is able to be applied to the two different purposes: the synthesis of a large image, and the replacement of local removed region. According to the training non-periodic or periodic pattern  we use different sampling methods to obtain different amount of patches in order to reduce the emergences of the seams of the output synthesized image. Reduce most of the time complexity operations  the analysis module can reduce dimensions of the training data and cluster these data, so the synthesis module can synthesize a large output image very fast and keep geometrical structures and veins continuous.

22 Conclusions Without needing to assign initial random values  The same process can also be used to replace the removed regions. Here, the multi-resolution approach is applied to the image replacement without needing to assign initial random values or approximate values. Multi-resolution go through the image replacement process  The down-sampling step is used for the analysis process as compiling the training data, and the up-sampling step is used for the reconstructing process as assigning initial values. Handle the large removed region  So this approach enables the system to handle the large removed region and obtain more realistic image (or textures) quickly.

23 Experimental Results Texture Synthesis (1)

24 Experimental Results Texture Synthesis (2)

25 Experimental Results Texture Synthesis (3)

26 Experimental Results Texture Synthesis (4)

27 Experimental Results Texture Synthesis (5)

28 Experimental Results Image Replacement (1)

29 Experimental Results Image Replacement (2)


Download ppt "Fast Image Replacement Using Multi-Resolution Approach Chih-Wei Fang and Jenn-Jier James Lien Robotics Lab Department of Computer Science and Information."

Similar presentations


Ads by Google