Fractional Fourier Texture Masks
Fractional Fourier Texture Masks
Fractional Fourier Texture Masks
Abstract
Recently, the special kind of near-regular texture has drawn significant attention from researchers in the field of
texture synthesis. Near-regular textures contain global regular structures that pose significant problems to the
popular sample-based approaches, and irregular stochastic structures that can not be reproduced by simple tiling.
Existing work tries to overcome this problem by user assisted modeling of the regular structures and then relies
on regular tiling. In this paper we use the concept of fractional Fourier analysis to perform a fully automatic
separation of the global regular structure from the irregular structure. The actual synthesis is performed by gen-
erating a fractional Fourier texture mask from the extracted global regular structure which is used to guide the
synthesis of irregular texture details. Our new method allows for automatic and efficient synthesis of a wide range
of near-regular textures preserving their regular structures and faithfully reproducing their stochastic elements.
Categories and Subject Descriptors (according to ACM CCS): I.3.7 [Computer Graphics]: Three-Dimensional
Graphics and Realism – Color, shading, shadowing, and texture, I.4.7 [Image Processing and Computer Vison]:
Feature Measurement – Texture
Section 2. Afterwards, Section 3 provides background and and paste them in a regular manner such that the color
implementation details of our algorithms for separation and differences in the overlap region are minimized. A similar
synthesis of the regular texture structure. Section 4 then approach is followed by Liang et al. [LLX∗ 01] but they
shows how the resulting fractional Fourier texture masks can apply feathering to merge overlapping patches. Kwatra et
be used to guide existing sample-based texture algorithms to al. [KSE∗ 03] generalize and improve these approaches by
faithfully reproduce both local and global structure. After reducing the problem of combining the pixels to a minimal
presenting and discussing our results in Section 5 we con- cut problem and allowing for blocks of arbitrary sizes. Re-
clude and describe future directions of research in Section 6. gions of varying size are as well supported by the algorithm
of Nealen and Alexa [NA03]. Despite the fact that copying
large texture regions allows for preservation of large texture
2. Related work structures, the exact alignment of structures in the target tex-
The objective of texture synthesis is to generate images that ture often fails due to bad placement of patches.
reproduce a distribution of textural features which humans To overcome these problems, the concept of texture masks
perceive as a specific type of texture. was developed. These masks are either used to guide con-
For a limited class of textures this distribution can be sistent [LYS01] or user-controlled [Ash01] texture place-
modeled using for example Perlin Noise [Per85] or reaction- ment, or to enforce that the shape of prominent features
diffusion systems [Tur91]. These types of procedural texture e.g. from animal fur is not broken apart during texture syn-
synthesis offer the advantage of user control and extremely thesis [ZZV∗ 03]. We use a similar approach in the final syn-
compact representation. thesis step of our algorithm but we propose a unique and
automatic analysis for generating such texture masks from
To capture more general types of texture, statistical mod- near-regular textures.
eling has been adopted. Motivated by research on human
texture perception, statistics of filter response vectors have These near-regular textures have been devoted attention
been used most frequently. The actual synthesis is per- from the community because they contain regular (tileable)
formed by iteratively matching statistics of a sample tex- structures that are not captured by local distributions, and ir-
ture and the synthesized result. E.g., Heeger and Bergen regular elements that are not reproduced correctly by tiling.
[HB95] matched marginal histograms of filter response Therefore, textures dominated by regular structures still pose
vectors at different spatial scales. Follow up publications problems for sample-based texture synthesis and need spe-
[Bon97, PS00, BJEYLW01] improved upon this scheme by cial attention. A first step in this direction was made by the
enforcing more complex joint statistics of filter coefficients work of Dischler et al. [DMLC02] who tried to identify ele-
but still fail on highly structured textures. Few publications mentary patches in the texture and analyzed their spatial ar-
(e.g. [ZWM98]) propose parametric texture models based on rangement which is then reproduced in the synthesized tex-
the Markov Random Field model of texture. Texture synthe- ture. An approach bridging the gap between regular tiling
sis involves fitting the model to a sample texture and sam- and stochastic placement of texture elements was presented
pling from the resulting distribution which can be computa- by Cohen et al. [CSHD03]. They enforce boundary con-
tionally very expensive and still reproduces mainly stochas- ditions along tiles but the placement does not account for
tic textures only. global regular structures ranging across tiles.
These elaborate models are outperformed in speed, qual- A more general approach for handling regular and poten-
ity and applicability by simple non-parametric sampling as tially large structures during texture synthesis was developed
proposed in the seminal paper by Efros and Leung [EL99]. by Liu et al. [LCT04] and Liu and Tsin [LTL05]. They used
The method synthesizes a texture pixel by pixel by selec- the observation that an infinite variety of periodic patterns
tively copying pixels from a sample. Appropriate pixels are can be characterized by a finite number of symmetry groups
identified by comparing their neighborhoods whose size is to extract tileable parts of a texture that correspond to the
the only tuning parameter of the algorithm. It can be shown regular structure of the texture. Tiling these textures with
that this scheme produces consistent estimates of the dis- overlap and merging the tiles leads to very good results for
tribution of pixels given their neighborhood [Lev02]. This most regular textures. The approach was recently extended
simple but powerful idea has inspired many researchers and to handle near-regular textures [LLH04] by treating them
numerous improvements of the original algorithm have been as deformations of regular textures. One drawback of this
published over the years. Many of them focused on speed- method is that extraction of tiles requires significant user in-
ing up the search for similar neighborhoods using for exam- tervention whereas our process is fully automatic. Another
ple tree-structured vector quantization [WL00], k-coherance problem is that it requires at least two complete tiles to be in-
search [TZL∗ 02], or jump maps [ZG02]. For textures with cluded in the sample texture. Although this usually poses no
large structures compared to affordable neighborhood sizes, problem, such data may be unavailable if regular structures
copying of whole patches instead of single pixels was ad- of different scales are included in the texture (a complete tile
vocated: Efros and Freeman [EF01] select fixed size blocks would need to be as large as the least common multiple of the
original
2 frequencies
a) Original b) DFT low-p. 6 frequencies
original 20 frequencies
original original
c) DFT int. 2 frequencies d) FrDFT int. 2 frequencies
6 frequencies 6 frequencies
Figure 1: Results of applying filters to a Corduroy texture samplewith black dots added at random locations. Whereas the images
show the texture sample, the curves visualize the luminance values of the pixels of the first scanline only. While the lowpass
filter result (b) still contains irregular structures and about 20 basis functions are required for a reasonable approximation of
the 1D signal, the intensity filter (c) performs much better using just 6 frequencies. Nevertheless, the leakage error can only be
eliminated applying the FrDFT intensity filter (d).
different scales). Our approach is able to treat the different crete Fourier transformation (DFT) which represents the sig-
scales individually and therefore requires no such large tex- nal by a sum of sine and cosine functions. Given the resulting
tures. Finally, unlike our approach they neither separate reg- frequency spectrum, the question of which and how many
ular from stochastic texture elements, which improves the frequencies are relevant for the regular part of the image sig-
quality of synthesized results, nor do they compute an ex- nal arises. If too few frequencies are taken into account, most
plicit, compact model of the regular texture parts. of the structure is smoothed out. If too many frequencies are
selected, the signal itself is better reproduced but at the cost
of introducing irregular structure.
3. FrDFT-Analysis
One way to select the relevant frequencies is to apply a
In this section, we describe our approach for separating the low pass filter to the image signal. In previous approaches
regular structure, which dominates the appearance of many for texture synthesis this idea is incorporated by building
near-regular textures like knitware or woven textiles, from image pyramids and synthesizing the low-resolution levels
the irregular one. Our intuitive distinction between these two first. Unfortunately, in general these low frequencies do not
kinds of data is that structures are perceived as regular if they correspond to the regular structures directly, which is shown
occur (at least nearly) periodically while irregular structures in Figure 1b.
are distributed in a different, more complex way. Therefore,
A more appropriate selection criterion is based on two
we represent a texture by periodic basis functions to deter-
observations. First, since the regular structures in the im-
mine and extract regular structures.
age signal dominate the overall appearance of most near-
Such a representation can be derived by applying a dis- regular textures (see e.g. the Corduroy sample in Figure 1),
1 FT
f(k)=cos(2πbk
—)
m DFT
FrDFT
14 FrDFT cos(7.2·2πx)
0.5
b=2 12
0
m 10
5
-0.5 b=—
2
8
-1
6 0 5 10 15 20 25
The method we developed is based on the fact that the Applying this first modification, the run-time complex-
m
magnitude mli of a local maximum at (kxi , kyi ) is much ity is reduced to O(mx my ( mdxx + dyy )n) but still remains high.
smaller than the magnitude mg of the global maximum at Therefore, our second optimization is to restrict the regions
(kxg , kyg ) (mli ≈ mg /|π2 (kxg − kxi )(kyg − kyi )| for kxi 6= kxg in which we search for the maxima. As visible in Figure 3,
and kyi 6= kyg ). This is due to the fact that the FrDFT of a 2D the position of a FrDFT global maximum can roughly be
function with frequencies bx and by can be approximated as determined using the DFT. We are only looking for the most
follows (for a proof see Appendix A): intense frequencies and thus only the highest maxima of FT .
The DFT gives us the values of FT for kx , ky ∈ Z and there-
|FTbx ,by (kx , ky )|2 ≈ fore we only need to search the [−1, 1]2 regions around DFT
|Fbx ,by |2 · sinc2 (kx − bx ) · sinc2 (ky − by ) (4) coefficients that are larger than a threshold. By choosing a
high threshold, a large amount of time can be saved (Ta-
where sinc(x) is defined as ble 1). Applying this second modification reduces the run-
(
sin(πx) time to O(mx my ( d2x + d2y )c), where c denotes the number of
πx x 6= 0
sinc(x) = . (5) DFT values above the threshold.
1 x=0
The extracted frequency pairs are near-optimal only since
Due to this strong difference between the magnitude of interference effects caused by the summation of multiple fre-
local and global maxima, the global maxima should be well quencies shift the location of maxima slightly. To compen-
preserved even when multiple fractional frequencies are con- sate for this effect, we optimize the frequency pairs such that
tained in the sequence. In special, the most intense maximum the least-squares color difference between the original image
should still remain the global maximum, which turned out to and the one reconstructed from the frequency pairs is mini-
be a valid assumption during our tests. mized.
of a texture with tilable regular structures. A regular struc- of the respective FFTM values. The contributions from
ture is tilable, if the frequencies describing the structure are both parts are summed into a single value after scaling the
not fractional w.r.t. the texture size. In simple cases, this is FFTM-similarities by a mask weight c. Please note that
the most intense frequency pair. In the general case, the low- incorporating dMM can be interpreted as the previously
est frequency of the regular structures has to be determined. missing way to improve the standard similarity measure
Let bl be this frequency pair. Then to consider structural information as well.
nx ny
m0x = mx · and m0y = my · (7) Cluster ID match. The pixels of Min are clustered based
blx bly
on similar neighborhoods N f ull using k-means clustering.
produces tilable sizes for all (nx , ny ) ∈ N × N and nx = Whenever a pixel xout is synthesized, the cluster ID of the
ny = 1 is a single tile of the pattern as described by Liu et corresponding pixel is determined. This cluster ID defines
al. [LLH04]. a candidate set of pixels in Min and thus corresponding
The FrDFT analysis and synthesis are performed for each pixels Tin from which the pixel to be copied is selected
color channel separately. Our tests determined that trans- using the measure dT T defined above.
forming the RGB color data to YCr Cb colorspace gives best
results since it reduced deviation of the per-channel frequen- Synthesized
cies. In addition, for many textures the analysis turned out (Tout and Mout)
to become faster, because usually the Y-channel contains the Nupper
Ny
most information.
Nlower
are usually much smaller than the full texture, leading to run- the Levenberg-Marquardt optimization method gets stuck
time advances compared to the entire patch matching strat- in, undesired interference patterns as visible in the mask in
egy [KSE∗ 03]. The determined patch size needs not be very Figure 10 occur. The errors are usually small enough to al-
accurate to achieve pleasing results (e.g. the bottom right low a reproduction of the sample, thus the FrDFT intensity
texture in Figure 9 contains features of size 75 × 60 pixels filter can always be used to avoid the DFT leakage effect.
and was synthesized using a patch size of 40 × 40). Please However, for textures with difficult structures, the larger the
note that synthesis of the textures in Figure 6 and in the top FrDFT synthesized area becomes, the more disturbed the re-
left of Figure 9 was previously not possible using fully auto- sult gets (see Figure 10).
matic algorithms (see [LHW∗ 04]).
Figure 7: Examples for successful synthesis. Each column shows from top to bottom the input sample, standard ANN synthesis
without a mask, the mask created with the FrDFT synthesis, and the ANN synthesis result with mask. In many cases the FFTM
provides a very accurate approximation of the synthesized texture already.
Figure 8: Examples for successful synthesis of non-textile samples with the pixel-based approach.
Figure 10: Problematic synthesis. The FFTM (middle) contains errors if the frequencies are extracted inaccurately, which leads
to undesired interference. In such a case, texture synthesis (right) fails to reproduce the original appearance (left).
d
Appendix A: Proof of Approximation 4 The Taylor series of 1 − cos m
gives