=Paper= {{Paper |id=Vol-2274/paper-02 |storemode=property |title=Software Complex for Representation and Processing of Images with Complex Structure |pdfUrl=https://ceur-ws.org/Vol-2274/paper-02.pdf |volume=Vol-2274 |authors=Nikita A. Andriyanov }} ==Software Complex for Representation and Processing of Images with Complex Structure== https://ceur-ws.org/Vol-2274/paper-02.pdf
     Software Complex for Representation and
    Processing of Images with Complex Structure

                                 Nikita A. Andriyanov1
     1
         Ulyanovsk State Technical University, Severny Venets, 32, 432027, Russia
                              nikita-and-nov@mail.ru,
                        WWW home page: http://tk.ulstu.ru



         Abstract. In the contemporary practice of digital image processing,
         special attention is paid to the solution of particular tasks, among which
         are delineation of boundaries, detection of anomalies, and pattern recog-
         nition. Usually, this approach is associated with the development of ef-
         fective algorithms oriented to specific tasks. Now we have a sufficient
         number of applications that implements a variety of image processing
         algorithms. However, it is difficult to find software that implements a
         global approach to image processing based on the application of mathe-
         matical models. This article is devoted to the development of a software
         complex, the main functional of which is performed by using mathemat-
         ical models of images. In addition to the task of representing images, the
         program implements algorithms for filtering, segmentation, and detec-
         tion of anomalies in images. At the same time, the program is based on
         doubly stochastic autoregressive image models, which are best suited for
         describing spatially heterogeneous images. In addition, the algorithms
         implemented in the developed program can be applied to processing the
         real images. We also describe in details methods for simulating images
         containing a given number of structures and investigate segmentation
         algorithms for the proposed model of images.

         Keywords: doubly stochastic models, image processing, segmentation,
         filtering, anomalies detection, image processing software, Matlab


1    Introduction
Methods of the multispectral (up to 10 spectral ranges) and hyperspectral (up
to 300 ranges) registration of Earth surface areas have become widely used in
recent years. Obtaining and processing significant amounts of information is a
very difficult task, and it requires considerable computational costs.
    Digital image processing is currently of interest to many researchers. For
example, P. Markelj, D. Tomazevic, A. Mohamed Akil, V.R. Krasheninnikov,
etc. devote their papers to medicine image processing [1–3]. B. Krishna Mohan,
R. Harris, V.A. Soifer, V.V. Sergeev, V.V. Myasnikov, K.K. Vasiliev, etc. get the
good results in processing the satellite images [4–6]. In addition, the adaptation
of various image processing algorithms to signals of a different kind and for
solving other problems is also actual.
                                                                                               11

    There is an approach, in which image processing is based on any local or
particular algorithms, and an approach, in which the mathematical model is
used as the basis for a number of developed algorithms. It should be noted that
a number of specialized application programs are devoted to the solution of
particular problems, while there is practically no software for careful study of
the model based approach.
    Despite the diversity, the well-known mathematical models of multidimen-
sional images have a number of shortcomings. The main disadvantage is consid-
erable difficulties in describing a spatially inhomogeneous and time-dependent
real material. A.S. Shalygin and Yu. I. Palagin suggested to use the mixed mod-
els [7] to describe such images. Then J. Woods and co-authors proposed a
two-dimensional doubly stochastic Gaussian (DSG) model [8], which was intro-
duced to provide a complete model for the spatial filters that adapt to the local
structure in the image signal. In such a way, it was proposed to use combinations
of different methods for the formation of random fields (RF) for image modeling.
    A detailed investigation of the special case of doubly stochastic models based
only on autoregressive (AR) processes was carried out in recent papers [9–12].
The methods of applying models and developing specialized software for the taxi
order service are presented in paper [13]. Below, we consider a general software
for the synthesis and analysis of doubly stochastic AR RF models.


2    Doubly stochastic model and representation of images
Most of the proposed mathematical models can not adequately describe real
images due to their heterogeneity in space. Indeed, forming an image model
with constant parameters, we obtain a uniform image. However, if we assume
that the parameters of the simulated image change when each new element is
formed, then the resulting image will be non-uniform. We will consider such
models as ones with varying parameters.
    Suppose we need to estimate the changing parameters of the doubly stochas-
tic model of the RF such that it allows us to describe the characteristics of the
real image {Xi,j } with brightness RF {zi,j }, i = 1, 2, ..., M1 , j = 1, 2, ..., M2 . We
will describe it by using a model with multiple roots of characteristics equations
with multiplicity (2.2) [12]

    z̃i,j = 2ρxij z̃i−1,j + 2ρyij z̃i,j−1 − 4ρxij ρyij z̃i−1,j−1 − ρ2xij z̃i−2,j −
    −ρ2yij z̃i,j−2 + 2ρ2xij ρyij z̃i−2,j−1 + 2ρxij ρ2yij z̃i−1,j−2 − ρ2xij ρ2yij z̃i−2,j−2 +   (1)
    +bi,j ξi,j , zi,j = z̃i,j + mzij , i = 1, 2, ..., M1 , j = 1, 2, ..., M2 ,

where ρxij and ρyij are the correlation parameters, mzij is the average value of
the brightness.
    Let us determine the values of the statistical parameters of the image {zi,j }
in each pixel. To perform it, we will use the sliding window of N ∗ N -size. Thus,
we estimate the average statistical correlation coefficient for each pixel in a row
ρxij and in a column ρyij , and, also, the average statistical expectations mzij
                    2
and the variances σzij :
12



                                       Pi+N −1 Pj+N −1
     mz(i+ N −1 )(j+ N −1 ) = N12 ∗   l=i        k=j     Xlk ,
             2         2
      2                         1       i+N −1 Pj+N −1
                                                          (Xlk − mzlk )2 ,
                                      P
     σz(i+ N −1 )(j+ N −1 ) = N 2 −1 ∗ l=i        k=j
             2         2           v   Pi+N −2 Pj+N −1
                                                       (Xlk −mzlk )∗(X(l+1)k −mz(l+1)k )
                                   u
                               1−t1−( l=i       k=j
                                                                                         )2
                                   u
                                                           2
                                                  (N −1)∗(N )∗σ
                                                                z(i+ N −1 )(j+ N −1 )
                                                                       2         2
     ρxz(i+ N −1 )(j+ N −1 ) =       Pi+N −2 Pj+N −1
                                                       (Xlk −mzlk )∗(X(l+1)k −mz(l+1)k )
                                                                                                  ,
              2        2              l=i      k=j                                                    (2)
                                              (N −1)∗(N )∗σ 2
                                                            z(i+ N −1 )(j+ N −1 )
                                   v                               2         2
                                        Pi+N −1 Pj+N −2
                                                           (Xlk −mzlk )∗(Xl(k+1) −mzl(k+1) )
                                   u
                                          l=i      k=j
                                                                                             )2
                                   u
                                 1−t1−(
                                                  (N −1)∗(N )∗σ 2
                                                                z(i+ N −1 )(j+ N −1 )
                                                                       2         2
     ρyz(i+ N −1 )(j+ N −1 ) =       Pi+N −1 Pj+N −2
                                                       (Xlk −mzlk )∗(Xl(k+1) −mzl(k+1) )
                                                                                                  .
              2        2              l=i      k=j
                                              (N −1)∗(N )∗σ 2
                                                            z(i+ N −1 )(j+ N −1 )
                                                                   2         2



where z-index is introduced to describe the observed data.
    Thus, we form the RFs of the correlation parameters {ρxij } and {ρyij }, RF
                                                                               2
of mathematical expectations values {mzij }, and RF of variances values {σzij    }.
The parameters allow us to simulate images with varying correlation parameters.
    Fig. 1 shows an example of using the proposed method for simulating a real
image. Fig. 1a corresponds to a real image with a size of 440 X 440 pixels. Fig.
1b corresponds to the image generated by doubly stochastic model of the multi-
plicity (2.2). Fig. 1c corresponds to the image generated by a doubly stochastic
model of the first order. Statistical estimation of the parameters of the available
image was carried out in a sliding window with the size of 15 X 15 pixels.




            Fig. 1. Formation of an image with varying correlation properties



   A direct comparison of the proposed method of simulating the satellite images
with known algorithms using AR and wave models shows that the variance of
the error between the real and simulated images is about 20 — 60%. It depends
on the degree of heterogeneity of the image. It is less than the corresponding
variances when using the known models.
                                                                                13

   Thus, the proposed technique for formation of the doubly stochastic images
with varying parameters can be used to simulate real satellite imagery and is
used as the basis for the developed software complex.




3    GUI software package




We chose the software complex MATLAB (Matrix Laboratory) as the main tool
for implementing synthesized algorithms and models. This system is one of the
most popular and carefully developed systems for the automation of mathemat-
ical calculations. It is based on an expanded representation and application of
matrix operations. Matrix Laboratory provides the user with a powerful pro-
gramming language that is oriented towards technical and mathematical cal-
culations. It can surpass the capabilities of traditional programming languages
that have been used for many years to implement numerical methods in terms of
the simplicity of developing programs. Important advantages of the system are
its openness and extensibility. So, the use of MATLAB seems to be an effective
way of implementing algorithms for digital image processing in general and for
the images generated by doubly stochastic models, particularly.
    Furthermore, MATLAB includes the Image Processing Toolbox. It has pow-
erful tools for processing and analyzing digital images. This application is a very
convenient environment for developing and modeling various methods.
    Belew, we consider the developed software packages.
   The software package called Modeling was developed to simulate RF. The
user is given the opportunity to simulate various ARs with a wide variation of
parameters. Fig. 2 and 3 show the block diagram of the package and its workspace
window, respectively.
   The program module allows one to investigate the properties of doubly
stochastic and AR RF models.
     The software package called Formation implies that the image that will be
generated on the basis of the doubly stochastic RF model is initially downloaded
by the user to the working folder of the MATLAB system. The recommended
file extension with the image is ”.jpeg”. The module generates an image with
varying parameters based on the actual image. For comparison, the real image,
its simulation by the model, as well as the variances field of the obtained image
and the field of its correlation coefficients are given. Fig. 4 shows the workspace
window of the Formation module.
14




       Fig. 2. Block diagram of the Modeling package




     Fig. 3. Workspace window for the Modeling package
                                                                                 15




               Fig. 4. Workspace window for the Formation package



    This makes it possible to relatively easily adjust the model parameters for
real images. In this case, one can increase the proximity of the simulated image
to the real one due to the selection of the dimensions of the sliding window.
    It should be noted that an important task is in identification of the model
parameters. Indeed, the statistical characteristics of a doubly stochastic RF are
related to its parameters; therefore, to generate signals or images having a given
correlation function (CF), it is necessary to know the basic statistical parameters.
In this regard, the Identification software package is developed to determine the
parameters of a doubly stochastic signal model.
    The user should enter the model parameters, on the basis of which identi-
fication will be performed. Thus, the comparison of the entered and identified
parameters will allow one to determine the adequacy of the used identification
algorithm and to evaluate its effectiveness. In addition, one can compare the
type of the original RF and the RF with the identified parameters.
    No less important task is the filtering of images, for which a priori knowledge
of the model parameters is a rather important condition. Thus, if identification
is effective, then in some cases it is possible to use the parameters obtained in
its result to solve the filtering task. However, in the Filtering software package,
it is assumed that the model parameters are known in advance and the main
task is the noise suppression.
16

    The Filtering software package was developed to filter doubly stochastic im-
ages and RFs. The user obtains the opportunity to simulate various doubly
stochastic RFs with a wide variation of parameters. The module provides the
use of Kalman (based on a nonlinear vector filter) and Wiener filters. Fig. 5 and
6 show the block diagram of the Filtering package and the workspace window of
the program, respectively.
    Thus, when working with the Filtering module, one should specify all the
statistical parameters of the doubly stochastic model. After filtering, four images
are displayed on the screen. They are the following:
     — the original generated image;
     — the image with white noise;
     — the result of the processing by the Kalman filter;
     — the result of processing by the Wiener filter.
     Also, the filtering error variances are presented for each of the algorithms.
   To implement the image segmentation algorithm, a technique is used to form
a doubly stochastic model based on the binary base RFs. So, the formation of
the main image at different pixels occurs with different statistical parameters,
but according to one of the two specified AR RFs. In this case, the user has the
opportunity to study the efficiency of the algorithm under different conditions.
   The software implementation of the proposed algorithm is carried out using
the Segmentation package. Fig. 7 shows the block diagram of the Segmentation
module.




                    Fig. 5. Block diagram of the Filtering package
                                                     17




Fig. 6. Workspace window for the Filtering package




Fig. 7. Block diagram of the Segmentation package
18

     Fig. 8 shows the workspace window of the Segmentation package.




              Fig. 8. Workspace window for the Segmentation package



4     Script-based software package for processing doubly
      stochastic images and real images

It should be noted that in the MATLAB environment, in addition to implement-
ing programs with a user-friendly graphical interface, it is possible to develop
programs oriented to mathematical modeling, numerical methods, and calcula-
tions. Despite the fact that MATLAB itself is required to run such applications,
their main advantage is open source code, which can be updated and corrected
at any time. The similar programs are the usual scripts executed by Matrix Lab-
oratory, which can be used both for studying algorithms for processing doubly
stochastic images within the framework of laboratory work at the university and
for processing real material.
    The base aim of developing such scripts is to have an introductory part. This
section of the code allows one to set model parameters, select the uploaded image,
and set the number of processing cycles. Thus, all scripts are tools for conducting
statistical studies of algorithms for processing image realizations generated by
doubly stochastic models. So, one can also process the real images.
    The Filtration.m script is developed to investigate filtering algorithms based
on a non-linear Kalman vector filter for doubly stochastic RFs, Wiener filter for
doubly stochastic RFs, and Kalman and Wiener filters for AR RFs. Fig. 9 shows
the algorithm of the script.
                                                            19




        Fig. 9. Algorithm of the Filtration.m script




Fig. 10. Algorithm of the PGEstimationAndRestore.m script
20

    The PGEstimationAndRestore.m script is intended for joint application of
the Kalman filtering algorithms and pseudo-gradient estimation of the internal
model parameters. The pseudo-gradient search estimates are used for filtering
and for image restoring. The principle of its operation is similar to the principle
of the filtering script. Fig. 10 shows the algorithm of the script.
    Finally, to study the problem of detecting signals on the background of im-
ages generated by doubly stochastic models and real images, the RealImageDe-
tection.m script was developed. This program allows one to generate long signals
of square and round shape on the simulated or real images and to investigate the
effectiveness of detecting such signals, for the given probability of false alarm.
Fig. 11 shows the algorithm of the script operating.




              Fig. 11. Algorithm of the RealImageDetection.m script




    Thus, the developed software package in the MATLAB environment includes
not only the part with the graphical user interface, but, also, the script part,
which is represented in the form of files with the extension ”.m”. All scripts
can be changed at any time and reconfigured, as these files have open source
code, and can be edited with the Notepad.exe. Together with the graphic part,
a software was obtained, which can be used both for studying simulated images
and signals and for processing real data.
                                                                                    21

5   Conclusion

We considered the software that can be conditionally divided into two blocks:
     — GUI-applications in MATLAB, which can be used to study doubly
stochastic RF models and do not require special skills and knowledge of pro-
gramming languages from the user;
     — script-applications in MATLAB implementing the complex image pro-
cessing algorithms based on the doubly stochastic RF models and used not only
to process simulated material, but also real images; these applications require
users to have a basic knowledge of the Matrix Laboratory environment.
    The developed software package for the study of image modeling algorithms
allows simulating multidimensional RFs based on doubly stochastic models with
different correlation parameters. Also, algorithms of filtering and segmentation
of doubly stochastic RFs are included in the software package.
    In addition, it is possible to generate images that are close to real based on
a model with varying statistical parameters.


Acknowledgements. The paper was supported by the RFBR grant, project
18-31-00056 mol a.


References

 1. Markelj, P., Tomazevic, D., Likar, B., Pernus, F.: A review of 3D/2D registration
    methods for image-guided interventions. Medical Image Analysis, Vol. 16, Iss. 3,
    642–661 (2012)
 2. Mohamed Akil, Mohamed Hedi Bedoui: Special issue on real-time processing
    of medical images. Real-Time Image Processing, DOI 10.1007/s11554-017-0676-
    5 (2017)
 3. Krasheninnikov V.R., Trubnikova L.I., Albutova M.L., Yashina A.S.: Algorithm
    for detecting the marker of the disease of the focal bladder on images of blood
    serum facies. Ulyanovsk medico-biological journal. No. 4, 105–110. (2015)
 4. Harris R.: Reflections on the value of ethics in relation to Earth observation. In-
    ternational journal of remote sensing, No. 34 (4), 1207–1219 (2013)
 5. Sergeev V.V., Yuzkiv R.R.: Parametric model of the autocorrelation function of
    cosmic hyperspectral images. Computer Optics, Vol. 40, Iss. 3, 416–421 (2016)
 6. Vasiliev K.K., Dement’ev V.E.: Autoregressive models of multidimensional images.
    Science-intensive technologies, Vol. 14, Iss. 15, 12–15 (2013)
 7. Shalygin A.S., Palagin Yu.I.: Applied methods of statistical modeling, L.: Mechan-
    ical engineering, 320 (1986)
 8. Woods J.W., Dravida S., Mediavilla R.: Image Estimation Using Doubly Stochastic
    Gaussian Random Field Models. Pattern Analysis and Machine Intelligence, Vol. 9,
    Iss. 2, 245–253 (1987)
 9. Vasil’ev K.K., Dement’ev V.E., Andriyanov N.A.: Doubly stochastic models of im-
    ages. Pattern Recognition and Image Analysis (Advances in Mathematical Theory
    and Applications). Vol. 25. Iss. 1, 105–110 (2015)
22

10. Andriyanov, N.A., Vasiliev, K.K., Dementiev, V.E.: Anomalies detection on spa-
    tially inhomogeneous polyzonal images. CEUR Workshop Proceedings. Volume
    1901, 2017 International Conference Information Technology and Nanotechnology.
    Session Image Processing, Geoinformation Technology and Information Security,
    IPGTIS-ITNT 2017; Samara; Russian Federation, 10–15 (2017)
11. Vasiliev K.K., Andriyanov N.A.: Synthesis and analysis of doubly stochastic models
    of images. CEUR Workshop Proceedings, ”REIT 2017 Proceedings of 2nd Interna-
    tional Workshop on Radio Electronics and Information Technologies”, Vol. 2005,
    145–154 (2017)
12. Andriyanov N. A., Gavrilina Yu. N.: Image Models and Segmentation Algorithms
    Based on Discrete Doubly Stochastic Autoregressions with Multiple Roots of Char-
    acteristic Equations. CEUR Workshop Proceedings, ”REIT 2018 3rd International
    Workshop on Radio Electronics and Information Technologies”; Vol. 2076, 19–29
    (2018)
13. Azanov P., Danilov A, Andriyanov N.: Development of software system for analysis
    and optimization of taxi services efficiency by statistical modeling methods. CEUR
    Workshop Proceedings. Volume 1904, 2017 International Conference Information
    Technology and Nanotechnology. Session Image Processing, Geoinformation Tech-
    nology and Information Security, IPGTIS-ITNT 2017; Samara; Russian Federation,
    232–238 (2017)