Sensing and Controlling with Markov Process for Locally Independent Fractal Image

We used the Markov process to impose parameter perturbation on affine transformations to overcome the self-similarity limitations of the fractal attractor of the classic iterated function system (IFS) and construct a fractal image with irregular shapes and features. Then, a control method for the IFS system for fractal image generation was proposed. This method decomposes the original IFS into several independent local subsystems. Then, we defined a transition probability matrix of the Markov process for each of the different local subsystems, and carried out image shape operation of a perturbation function to increase the control of the fractal image. This method can construct colorful fractal images effectively through computer image generation.


Introduction
Fractal geometry uses its unique self-similarity to construct protean fractal images with an arbitrary high resolution, which has attracted great attention from the public. (1) Fractal image integrates art with science. It also has various technological applications, including sensor technologies. (2,3) However, fractal images have mainly been used for their artistic value in a broad range of industries, including packaging and printing, fashion and fabrics, embroidery, ceramics, architecture, and advertisements. (4)(5)(6) Nowadays, science and aesthetic impressions are generated by numerical calculation by computers. (7,8) Advanced computer graphics technology creates designs for various types of artistic patterns automatically. This has become the mainstream of modern art pattern design.
Research on fractal images for art pattern designs has shown significant progress. (9,10) However, it is not easy to control the generation of fractal art images. In order to improve the classic iterated function system (IFS) used to generate fractal art images, we applied the Markov stochastic process theory to fractal modeling using the IFS. On the basis of the multilevel decomposition of the IFS affine transformation system, the IFS is decomposed into multiple independent subsystems to obtain IFS iterated codes of different local IFSs and desired depths.
In accordance with preset control rules, shape changes of different local fractal images are controlled to realize the shape evolution of each subsystem image. This is based on a local independent image operation that carries out deformation processing on a specific local subimage without affecting other local subimages of the image. We use a Markov random sequence to adjust the affine transformation family of the IFS local subsystem and combine the parameter perturbation method. In this way, we can generate a large number of changeable fractal images by designing the shape modeling rules in an image drawing process.

Relevant Works
The IFS is a representative system that can be used as a basis to simulate the scenery of a fractal nature to describe common fractal shapes, and its theory and practice have been widely applied in many fields. (11,12) As the shape of an ordinary IFS fractal attractor is very regular, the attractor often seems to be "rigid" and does not significantly change when the IFS attractor is directly used to simulate a natural landscape. Garcla introduced a mutually recursive function system (MRFS), a popular form of the IFS, to obtain a balance between order and chaos in the IFS attractor image. (13) Its basic idea is to use the affine transformation of IFS variables during the computation process of successive iterations. As different changes are used for each recursion, attractors with different rules or irregular forms can be obtained.
Several enhanced attractor control methodologies have been proposed through the development of the IFS since the MRFS was introduced. A modified method was introduced in which the parameters of the transformation depend on the number of iterations. This method combined the IFS with a new approach to model compound objects. (14) Sherman and Hart, and Radu introduced a Markov process into the study of an IFS to strengthen the control of the fractal attractor image, which has great practical value. (15,16) An IFS with Markov characteristics has also been proposed, which overcomes the limitations of the traditional IFS methods to some extent. Various studies have proposed a more generalized iterated function system (MIFS), and many concrete applications have been reported. Sharif Ullah et al. proposed the design for manufacturing (DFM) of fractals created by a random walk, that is, the DFM of an IFS-created fractal called Barnsley's fern leaf. The IFS for creating virtual models of a fern leaf used a set of four strictly contracting affine mappings. (17) Stepien used a modular method to construct a fractal model of natural objects with spiral structures, such as takin horns and seashells. The model was composed of a base module and an IFS with a compressed set (IFSc), where the IFSc attractor comprised a gradually shrinking copy sequence. (18) Zhang put forward a method of modeling the fractal attractor of a Markov IFS based on a transition probability matrix that involved the multiple decomposition of the MIFS affine transformation. Then, he used a Markov transition probability matrix to conduct deformation processing of the local subimages of the attractor. (19) Zhang and Pan, and Flavian and Radu proposed an IFS based on the hidden Markov model. They used the hidden Markov random process to control the modeling and coloring of fractal images, and then drew them with an irregular shape and color. (20,21) Zhuang et al. proposed a texture-based IFS (TIFS) that introduced a method of texture synthesis into fractal image designs as a color rendering rule of fractal images to achieve a better rendering effect. (22)

Overview of Markov iterative function system
Definition 1: The mapping family {X; ω 1 , ω 2 , ..., ω N } composed of complete metric space (X, d) and N compressed mappings ω i : X → X is called an IFS. For each mapping ω i , there is a probability p i > 0, x 0 ∈ X is obtained independently by recursion , ω 2 (x n−1 ), ..., ω N (x n−1 )}, n = 1, 2, ... . If a sufficiently large integer N max is selected, the sequence {x n , n ≥ N max } converges to the attractor of the IFS. The compressed mapping ω i usually selects the affine transformation in the following form: Scaling parameters r i and s i of the above formula are the compression scaling factors in the x and y directions, respectively, which determine the scaling down and scaling up of the fractal attractor along these two directions. Rotation parameters θ i and φ i determine the rotation angles of the fractal attractor around the x and y directions, respectively. Displacement parameters e i and f i represent the translation along the x and y directions, respectively. Definition 2: The random process {x n , n = 0, 1, 2, ...} is called the Markov chain, and it only takes a finite or countable number of values e 1 , e 2 , ... . Here, {1, 2, ...} is used to mark e 1 , e 2 , ..., which are called states of the process, and its subset is denoted as S and is called a state space of the process. For any n > 0 and states i, j, i 1 , ..., i n−1 , we have the following formula: Definition 3: The conditional probability P{x n = j | x n−1 = i} in Eq. (2) is called the transition probability of the Markov chain. If p ij = P{x n = j | x n−1 = i} (n > 0), the matrix P = (p ij ) N×N is called the transition probability matrix, which meets the following two conditions:

Definition 4:
If the compressed mapping of the entire space (X, d) is ω i : X → X , i = 1, 2, ..., N, letting P = (p ij ) N×N be the Markov transition probability matrix, which satisfies p ij ≥ 0,

Affine transformation decomposition theorem
Theorem 1: Let ω 1 , ω 2 , ..., ω N be the IFS codes of the fractal image f and 1 i ω − be the inverse of ω i . The operator " , and then The transformation formula of a subimage ω j ( f ) transformation matrix is as follows: According to Eq. (3), the generation can be decomposed into several subimages, and the decomposed subimages can be further decomposed into smaller subimages, which can be gradually decomposed to the required level. By applying the decomposition theorem of the affine transformation, the IFS is decomposed layer by layer to generate multiple independent subsystems to obtain the IFS decomposition codes of local subimages.
The factors that determine the probability distribution of an IFS are (1) the distribution function and (2) the probability variables ξ(σ, η) = a·σ + b·η + c. Different probability distribution sequences can be obtained by adjusting the values of parameters a, b, c, or selecting different forms of the function F(x).

Perturbation of affine transformation parameters
To further improve the controllability of the IFS attractor image shape change, we used a random number sequence as the control factor to perturb the parameters of the affine transformation randomly within a specific range of numerical values to realize the evolution control of the fractal local shape structure of the IFS.
The perturbation function is set as D k (p, q, r, k) = p + (q + r × rand) × g(k), where {p, q, r} are the perturbation variables; k is the iterative cyclic variable of the calculation procedure; rand is a random factor with a uniform distribution in the interval [0, 1]; function g(k) is the allocation function of k. Its purpose is to allocate the form of the perturbation function of the system. By using the perturbation function D k (•), the proportion parameters of the affine transformation of the IFS adopt multiplication perturbation, and the rotation parameters and displacement parameters use additive perturbation. That is,

Proposed algorithm
The IFS is a classical system of fractals. In the iterative process, the transfer method of an iterative calculation between various parts of an image is associated with a certain probability. The method uses the processing mode of "oneness" for various parts composing the image, so it lacks local controllability. To implement a corresponding control mode at different parts of the image and construct the fractal image with a changeable shape and features, we proposed a method that separates various parts of the image for independent operation. The method can process only a particular local subimage without affecting the other local subimages. First of all, we used the decomposition theorem of the affine transformation to decompose the IFS into several mutually independent subsystems. Then, the images of each subsystem were constructed by applying the generation method of different rules. Finally, we collaged the local subimages generated by each subsystem to form the whole image.
When using the IFS to construct a fractal image, we applied the Markov double random process to control the form evolution of the local fractal image of the IFS, in addition to using the parameters of the affine transformation controlled by the defined perturbation function. Among the two processes, one Markov process participated in the calculation of the affine transformation family, while the other Markov process determined the presentation state of pixels obtained by the IFS iteration calculation. These two random processes are achieved by using two corresponding transition probability matrices.
It is assumed that P = (p ij ) N×N , 1 ≤ i, j ≤ N represents the transition probability matrix that controls the selection state of the affine transformation family {ω 1 , ω 2 , ..., ω N } in the IFS and Q = (q jk ) N×M , 1 ≤ j ≤ N, 1 ≤ k ≤ M denotes the transition probability matrix. The condition {O m : m = 1, 2, ..., M} of the corresponding iterative pixel when the transformation is selected as ω j , and P, Q satisfies The presentation condition of the iteration point of each affine transformation is defined as one of the following five cases. O 1 Represents "growth": The iterative calculation is performed and coordinate points are drawn. Its probability value is denoted by q j1 . O 2 Represents "death": The points generated last time do not participate in the iterative calculation this time. Its probability value is denoted by q j2 . O 3 Represents "pause": It only participates in the iterative calculation and does not draw the coordinate points. Its probability value is denoted by q j3 . O 4 Represents "repeat": The iteration calculation is carried out and the coordinate points are drawn, then the previous step is returned to. Its probability value is denoted by q j4 . O 5 Represents "branch": The iterative calculation is carried out without drawing the coordinate points, and other graphs are drawn instead of drawing points. Its probability value is denoted by q j5 .
The local control algorithm is described as follows: Step 1: We set an IFS {X; ω 1 , ω 2 , ..., ω N } and its associated probability vector (p 1 , p 2 , ..., p N ) Step 2: We select some affine transformations from the affine transformation family {ω 1 , ω 2 , ..., ω N }, decompose them step by step to the set orders (set as n) according to transformation formula Eq. (3), and then obtain the IFS decomposition code Step 3: For the first n − 1 levels of the affine transformation sequence obtained by decomposition, Step 5: Using the method in Sect. 3.4, we determine the perturbation function D k (p, μ, ν, k) = p + (μ + ν × rand) × g(k) and multiply or add the affine transformation family of the Step 6: We select affine transformation Step 7: The local subimage of each part of the iteration output system is produced.

Basic experimental setting
We chose the Poisson distribution or the Gaussian distribution for the probability distribution function F(x) in the experiment.
Poisson probability distribution formula: Gaussian probability density function: The parameter space formed by the two distributions combined with the value of the probability variable ξ(σ, η) = a · σ + b · η + c is as follows: In the perturbation function D k ( p, q, r, k) = p + (q + r × rand) × g(k), variables {( , , , ) | , , , , 0} p q r k p q r R k N k ∈ ∈ > and random factors rand ∈ [0, 1] are random numbers with a uniform distribution.
The transformation of IFS affine transformation parameters (a, b, c, d) and (r, s, θ, φ) is as follows: The fern and tree fractals are taken as test examples of the algorithm in the experiment. The initial IFS codes of these three fractal images are listed in Table 1, and schematic diagrams of the generators of these three fractal images are shown in Fig. 1.

Algorithm implementation results
In the following algorithm implementation process, the Gaussian distribution function is adopted to define the transition probability matrix P( p ij ) with its parameter values  (a, b, c, μ, σ) = (2, 1, 8, 6, 2), while the Poisson distribution function is adopted to define the transition probability matrix Q(q jk ) with its parameter values (a, b, c, λ) = (2, 3, 6, 7). However, the perturbation of each local affine transformation parameter adopts different combinations. Figure 2 shows the evolution of the fern fractal. Figure 2(a) is the original image, whose generator is shown in Fig. 1(a). Figure 2(b) is the result obtained by the local subimage ω 2 ( f ) by using multiplication perturbation of the scale parameter and additive perturbation of the rotation angle. With increasing compression processing carried out by the ratio parameter, the local feature changes to a thin line. Figure 2(c) is the image formed by carrying out the perturbation of the subimages ω 2 ( f ), ω 3 ( f ), and ω 4 ( f ). In the perturbation process, if the rotation angle remains unchanged and multiplication perturbation is carried out on the scale parameters, then the random factor rand is used in the perturbation function. Figures 2(d)-2(f) are the images generated by carrying out different perturbations of the subimages ω 2 ( f ), ω 3 ( f ), and ω 4 ( f ), Table 1 IFS initial codes of fern fractal and tree fractals.  Figure 3 shows the evolution of fractal image tree 1. Figure 3(a) is the original image, whose generator is shown in Fig. 1(b). Figures 3(b) and 3(c) show the results obtained by local subimage ω 3 ( f ) by using multiplication perturbation of the scale parameter and additive perturbation of the rotation angle. Meanwhile, the random factor rand is used in the multiplication perturbation, while only additive perturbation of the rotation angle is carried out for local subimage ω 4 ( f ). Figures 3(d) and 3(e) are the results of applying multiplication perturbation of the scale parameter and additive perturbation of the rotation angle to local subimage ω 5 ( f ), and the remaining parts are unchanged. Figure 3(f) is obtained when the parameters of the affine transformation of the local subimage are kept unchanged. In addition, the transition probability matrix Q(q jk ) is used to control the presentation condition of affine transformation point ω i (x), namely, among five conditions: "growth," "death," "pause," "repeat", and "branch." The "branch" effect is to replace the drawing dots with red circles to represent the fruits on the tree and simulate a tree laden with fruits. Figure 4 shows the evolution of fractal image tree 2. Figure 4(a) is the original image, and its generator is shown in Fig. 1(c). Figure 4(b) is the result obtained by local subimages ω 4 ( f ) and ω 5 ( f ) by multiplication perturbation of the scale parameter and additive perturbation of Therefore, it can be seen that the compression degree of the subimage is more significant than ω 4 ( f ) from the experimental results. For Fig. 4(d), local subimages ω 4 ( f ) and ω 5 ( f ) use the transition probability matrix P(p ij ) to control the deformation, while local subimages ω 3 ( f ) and ω 6 ( f ) adopt the "branch" treatment, as shown in Fig. 3(d), which also simulates a tree laden with fruits.  Compared with the standard fractal iteration systems referred to previously, the new method in this research can modify the local shapes of fractal images more easily. It can not only maintain the basic characteristics of the same image but also develop them into new shapes. In addition, this method can give different colors to local images, enabling local color rendering.

Conclusions
Although the IFS has become an essential method in the computer generation of fractal images, the difficulty in the coding of the IFS affine transformation still remains. An effective way to overcome this difficulty is to add other processes to the existing IFS to control and produce fractal images with more desirable forms. We introduced the Markov random process into the fractal structure of the IFS to decompose the affine transformation of the IFS and to obtain the IFS decomposition code of a local subimage. By defining the transition probability matrix and the perturbation function for the evolution control of the local subimage's shape modeling, various images with irregular local forms are generated from the basic geometric structures of the original image. The proposed system further increases the ability to construct IFS fractal images. The new ideas in this research are as follows: (1) The Markov double random process is used to control the morphology of a fractal image.
(3) Localized interference does not affect the overall shape.
Even with the improved results shown in this research, the new method lacks the effective regulation of fractal image color changes as the random number sequence cycle is not long enough. We discussed the fractal structure of a single IFS, but the ability of a single IFS to construct complex images is still limited. Therefore, it must be discussed in future research whether a multimodal IFS can be merged to construct a multibranch system and generate a fractal image with a more complex structure.