<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>the variational principle of leveling</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Bekesheva</string-name>
          <email>nastya.bekesheva@gmail.com</email>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Khaidurov</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Vladyslav</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Romanenko</string-name>
          <email>vlad.romanenko.24@gmail.com</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>European University</institution>
          ,
          <addr-line>Academician Vernadsky 16 V, 03115, Kyiv</addr-line>
          ,
          <country country="UA">Ukraine</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>General Energy Institute of NAS of Ukraine</institution>
          ,
          <addr-line>Antonovycha 172, 03150, Kyiv</addr-line>
          ,
          <country country="UA">Ukraine</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>National Technical University of Ukraine “Igor Sikorsky Kyiv Polytechnic Institute”</institution>
          ,
          <addr-line>03056, Prospect Beresteiskyi (former Peremohy) 37, Kyiv</addr-line>
          ,
          <country country="UA">Ukraine</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>This work describes and practically implements the method of leveling illumination in images of various origins. Insufficient or uneven lighting can result in loss of detail, low contrast, or incorrect color reproduction. Lighting that is too bright can result in areas where detail is lost due to excessive brightness. Also, during the formation and analysis of various medical images, the problem of insufficient illumination of the image arises, that is, the image looks dark, details are difficult to see, especially in the shadows. The practical part of the work contains a description of the mathematical model of the transition from the variational problem (in the optimization form) to the differential form. A comparative analysis of existing computational methods of mathematical physics was also conducted. The working time and the number of iterations for obtaining results that form images with uniform illumination for various images were experimentally determined.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Poisson's equation</kwd>
        <kwd>variational problem formulation</kwd>
        <kwd>computational methods</kwd>
        <kwd>elliptic second order equation</kwd>
        <kwd>equalization of illumination1</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>illumination
in images</p>
    </sec>
    <sec id="sec-2">
      <title>Anastasiia</title>
    </sec>
    <sec id="sec-3">
      <title>Roman Yarovoy3†</title>
      <sec id="sec-3-1">
        <title>1. Introduction</title>
        <p>The problem of image illumination refers to how light affects the quality and perception of an
image. If the lighting is insufficient or uneven, it can result in loss of detail, low contrast, or
incorrect color reproduction. Lighting that is too bright can result in areas where detail is lost
due to excessive brightness. Also, during the formation and analysis of various medical images,
the problem of insufficient illumination of the image arises, that is, the image looks dark, details
are difficult to see, especially in the shadows. One of the special problems is the uneven
illumination of the object under study. Such a problem complicates the correct perception of this
object.</p>
        <p>Mathematical apparatus of varying complexity is used to analyze unevenly lit images and
correct the above-mentioned lighting problems. The methods of leveling lighting in images use
a matrix filtering apparatus (based on the principles of convolution), which is known from the
course of linear algebra [1], [2]. This device is simple from the point of view of software
implementation, and the processor time required to implement the implemented approach is
relatively small. The Laplace and Fourier transform apparatus is more complicated than the
previous one, but it gives a better visual result of correcting uneven lighting in the image at the
output [1], [3]. The processor time for image processing with this mathematical apparatus is
significantly greater than the time for image processing with matrix filters. The most
wellknown mathematical apparatus for solving the problem of processing unevenly lit images is the
variational principle, which involves the transition from the optimization formulation of the
minimization of a quadratic functional of a special form to finding the solution of the Poisson
equation with the appropriate boundary conditions that correspond to the given problem. To
date, there are many methods of solving the main classes of problems of mathematical physics,
as well as optimization problems of mathematical physics, where functional constraints are
equations describing a specific process [3]–[5]. The main computational methods for finding the
numerical solution of the Poisson equation are the finite difference method and the finite
element method [2], [5], [6]. It should be noted that the finite element method has an advantage
over the finite element method for solving the problem of equalizing uneven illumination in the
case of examining an image area that has a very complex geometric shape. This paper will
describe the image analysis method based on the variational principle and the finite difference
method.</p>
      </sec>
      <sec id="sec-3-2">
        <title>2. Problem formulation</title>
        <sec id="sec-3-2-1">
          <title>2.1. Technical formulation of the problem</title>
          <p>The technical task of the work consists in conducting an analysis of unevenly lit images based
on the field of the given field of gradients of these images, to obtain a visually improved image.
To conduct an analysis of classical computational methods of elliptic equations of mathematical
physics of the second order, which are the basis of the variational approach of Poisson image
processing.
2.2. Mathematical formulation of the problem: transition from
the variational formulation of the problem to the differential
formulation
To correct unevenly distributed lighting in the image, you need to preserve all boundary
elements of the objects that are in the image under study. In order to distinguish one object from
another, it is necessary to have data about the gradient of the entire image, which is presented in
the form of two matrices for each channel, if the image is full-color and is presented in digital
form in the RGB palette [7]. The Poisson approach involves saving this information on the basis
of such a quadratic functional I 1 (u), which must be minimized:</p>
          <p>❑ ❑
I 1 (u )=∬ (u'x−v'x )2 ds +∬ (u'y−v'y )2 ds → min ,</p>
          <p>G G
where u – the searched image, which is the result of editing by saving, moreover
u'x=∂ u / ∂ x , u'y=∂ u / ∂ y , v – input image for which field gradients are known, presented as
matrices based on formulas v'x=∂ v / ∂ x , v'y=∂ v / ∂ y , G – the computational domain that
defines the image itself.</p>
          <p>It is obvious that in order to equalize the unevenly distributed illumination in the image, it is
necessary to minimize another functional, which has the form:</p>
          <p>❑
I 2 (u )=∬ (u−u )2 ds → min ,</p>
          <p>G
where u – average value of illumination. The functional I 2 (u ) consists in minimizing the
variance. A reduction in dispersion implies a much more uniform distribution of the brightness
of the pixels of the entire image. In this case, we have the functional of the variational
formulation of the problem of leveling uneven illumination in the image given by and:</p>
          <p>I (u )=α1 I 1 (u )+ α2 I 2 (u )=¿
❑ ❑ ❑
¿ α1(∬ (u'x−v'x )2 ds +∬ (u'y−v'y )2 ds)+α2∬ (u−u)2 ds → min ,</p>
          <p>G G G</p>
          <p>α1+ α2=1.</p>
          <p>In functionality I (u ) parameters α1 and α2 є weighting factors that determine the strength of
influence of functionals I 1 (u ) and I 2 (u ) respectively. It is obvious that the last functional I (u )
can also be written with one parameter:</p>
          <p>I (u )=α1(1⋅ I 1 (u )+
α2 ⋅ I 2 (u )) I 1 (u )+ λ⋅ I 2 (u )=¿
α1
❑ ❑ ❑
¿∬ (u'x−v'x )2 ds +∬ (u'y−v'y )2 ds + λ∬ (u−u )2 ds → min ,</p>
          <p>G G G</p>
          <p>The last equivalence transformation “~” is true given that the extremal of the initial
functional and the resulting functional are the same function. It should also be noted that
λ=α2/ α1 , α1 ≠ 0. It is obvious that α1 ≠ 0, because at α1=0 all information about the initial
image (field of image gradients) is lost. This means that at α1=0 the task loses any meaning.</p>
          <p>In order to close the mathematical formulation of the variational problem, it is also necessary
to mention the boundary conditions. Taking into account the fact that the boundary of the
image objects is not tracked at the boundary of the entire image, and also that the minimization
of variance for I 2 is better achieved with unfixed boundaries, then</p>
          <p>| = |
∂ u ∂ u
∂ x ¿ ∂ x ¿= ∂∂uy|Up= ∂∂uy|Down= ∂∂un|Г=0 ,¿
where Г – border of the investigated image.</p>
          <p>Such a variational problem can be easily reduced to the differential formulation of the same
problem by applying the Euler-Lagrange equation, which has the form:
∂ S (u , u'x , u'y) − ∂</p>
          <p>(
∂ u ∂ x
∂ S (u , u'x , u'y)
∂ u'x</p>
          <p>In this case, we will get:
¿ 0+((u'y−v'y)2)'u' +0=2(u'y−v'y) .</p>
          <p>y</p>
          <p>Let's substitute the obtained intermediate results into the Euler-Lagrange equation. We will
have:
2 λ (u−u)− ∂ (2(u'x−v'x))− ∂ (2(u'y−v'y))=¿</p>
          <p>∂ x ∂ y
¿−2( ∂ (u'x−v'x)+</p>
          <p>∂ x
After simplification, we get the equation:
∂ (u'y−v'y)− λ (u−u)).</p>
          <p>∂ y
u'x'x+u'y'y− λu=v'x'x+ v'y'y− λ u .</p>
          <p>The last equation is Poisson's equation. Taking into account the boundary conditions
(derivatives along the normal are equal to zero), it is obvious that if the solution of the equation
is some function u¿ ( x , y ), then the function will also be a solution u¿ ( x , y )+C, where C – an
arbitrary constant. That is, we will prove:</p>
          <p>(u¿+C )'x'x+(u¿+C )'y'y− λ (u¿+C )=v xx+ v yy− λ (u¿+C )
based on</p>
          <p>It is obvious that</p>
          <p>(u¿)'x'x+(u¿)'y'y− λ u¿=v xx+ v yy− λ u¿ .
(u¿+C )'x'x+(u¿+C )'y'y− λ (u¿+C )−(v xx+ v yy− λ (u¿+C ))=¿
¿ (u¿)' '
xx+(u¿)'y'y− λ u¿− λC −v xx−v yy + λ u¿+ λC =¿
(u¿)'x'x+(u¿)'y'y− λ u¿+ λ u¿−v xx−v yy=0</p>
          <p>That is, this means that to solve the problem, you can put u=0 to fix the only solution of the
problem, which will be easily pulled under the limits of the permissible pixel intensity values
(for real numbers - from 0 to 1, or for integers numbers from 0 to 255), for example, according to
the classic formula:
where</p>
          <p>λu− Δ u=− Δ f , λ&gt;0
Δ u= ∂∂2xu2 + ∂∂2yu2 , Δ f = ∂∂2xf2 + ∂∂2yf2 ,</p>
          <p>
            In (
            <xref ref-type="bibr" rid="ref1">1</xref>
            ), we assume that we have a known function f ( x , y ). This means that Δf is easily found
by classical well-known difference schemes. Boundary conditions for equation (
            <xref ref-type="bibr" rid="ref1">1</xref>
            ) are equality
of zero derivatives.
          </p>
          <p>
            Suppose we need to write the difference equation for (
            <xref ref-type="bibr" rid="ref1">1</xref>
            ) [8]–[10]. Then we will use central
difference schemes for any node ( xi , y j) , i=1 , N x+2 , j=1 , N y +2 . Steps in spatial
coordinates x and y let's put equal hx , h y . Then:
u= u−umin або u=[255⋅ u−umin ].
          </p>
          <p>umax−umin umax−umin</p>
          <p>Next, computational experiments will be conducted for the boundary value problem for the
Poisson equation, which are known in classical mathematical physics.</p>
        </sec>
      </sec>
      <sec id="sec-3-3">
        <title>3. Computational experiments</title>
        <sec id="sec-3-3-1">
          <title>3.1. A numerical method for solving the problem</title>
          <p>We have a mathematical model that contains a well-known linear equation of mathematical
physics of the 2nd order [8], [9]:</p>
          <p>|
∂2 u
∂ x2 (xi, y j)</p>
          <p>|
∂2 u
∂ y2 (xi, y j)
≈
≈
|
∂2 f
∂ x2 (xi, y j)</p>
          <p>
            |
∂2 f
∂ y2 (xi, y j)
≈
≈
,
(
            <xref ref-type="bibr" rid="ref1">1</xref>
            )
(
            <xref ref-type="bibr" rid="ref2">2</xref>
            )
(
            <xref ref-type="bibr" rid="ref3">3</xref>
            )
u ( xi−1 , y j)−2 u ( xi , y j)+u ( xi+1 , y j)
u ( xi , y j−1)−2 u ( xi , y j)+u ( xi , y j+1) .
f ( xi−1 , y j)−2 f ( xi , y j)+ f ( xi+1 , y j)
f ( xi , y j−1)−2 f ( xi , y j)+ f ( xi , y j+1) .
          </p>
          <p>(hx)2
(h y )2
(hx)2
(h y )2</p>
          <p>
            Similarly, we write the second derivatives in (
            <xref ref-type="bibr" rid="ref1">1</xref>
            ) for the known function f ( x , y ) in the
righthand side of equation (
            <xref ref-type="bibr" rid="ref1">1</xref>
            ).
          </p>
          <p>
            Let's enter the notation ui , j=u ( xi , y j) , f i , j=f ( xi , y j) , i=1 , N x+1 , j=1 , N y +1 . Then (
            <xref ref-type="bibr" rid="ref2">2</xref>
            )
and (
            <xref ref-type="bibr" rid="ref3">3</xref>
            ) will have the form:
∂2 u|
∂ x2 ( xi , y j)
∂2 f |
∂ x2 ( xi , y j)
≈ ui−1 , j−2hu2xi , j +ui+1 , j , ∂∂2yu2|( xi , y j)
≈ f i−1 , j−2hf2xi , j + f i+1 , j , ∂∂2yf2|( xi , y j)
i=2 , N x +1 , j=2 , N y +1 .
          </p>
          <p>≈ ui , j−1−2 ui , j +ui , j+1 ,</p>
          <p>
            h2y
≈ f i , j−1−2 f i , j + f i , j+1 ,
h2y
Using (
            <xref ref-type="bibr" rid="ref4">4</xref>
            ), we finally write down) the difference scheme for (
            <xref ref-type="bibr" rid="ref1">1</xref>
            ):
λ ui , j−(
          </p>
          <p>ui−1 , j−2hu2xi , j +ui+1 , j + ui , j−1−2hu2yi , j +ui , j+1 )=¿
¿−( f i−1 , j−2hf2xi , j + f i+1 , j + f i , j−1−2hf2yi , j + f i , j+1 ),</p>
          <p>i=2 , N x +1 , j=2 , N y +1 .</p>
          <p>
            Let's transform equation (
            <xref ref-type="bibr" rid="ref5">5</xref>
            ), collecting all the coefficients near the points
( xi , y j ) , ( xi−1 , y j ) , ( xi+1 , y j ) , ( xi , y j−1) and ( xi , y j+1), and we will see the 5-point difference
scheme for equation (
            <xref ref-type="bibr" rid="ref1">1</xref>
            ) in the new notation.
          </p>
          <p>ui−1 , j−2 ui , j +ui+1 , j + ui , j−1−2 ui , j +ui , j+1 − λ ui , j=¿</p>
          <p>h2x h2y
¿ f i−1 , j−2 f i , j + f i+1 , j + f i , j−1−2 f i , j + f i , j+1 , i=2 , N x +1 , j=2 , N y +1 .</p>
          <p>h2x h2y
h12x ui−1 , j + h12x ui+1 , j + h12y ui , j−1+ h12y ui , j+1−( h22x + h22y + λ)ui , j=¿
¿ f i−1 , j−2 f i , j + f i+1 , j + f i , j−1−2 f i , j + f i , j+1 , i=2 , N x +1 , j=2 , N y +1 .</p>
          <p>
            h2x h2y
We will introduce new notations in the difference equation (
            <xref ref-type="bibr" rid="ref6">6</xref>
            ):






coefficient near ui−1 , j: A X i , j=1 / h2x;
coefficient near ui+1 , j: C X i , j=1 / h2x;
coefficient near ui , j−1: A Y i , j=1 / h2y;
coefficient near ui , j+1: C Y i , j=1 / h2y;
coefficient near ui , j: Bi , j=2 / h2x +2 / h2y + λ;
coefficient of the right side of the equation Di , j:
          </p>
          <p>Di , j= f i−1 , j−2 f i , j + f i+1 , j + f i , j−1−2 f i , j + f i , j+1 .</p>
          <p>
            h2x h2y
(
            <xref ref-type="bibr" rid="ref4">4</xref>
            )
(
            <xref ref-type="bibr" rid="ref5">5</xref>
            )
(
            <xref ref-type="bibr" rid="ref6">6</xref>
            )
In this case, (
            <xref ref-type="bibr" rid="ref6">6</xref>
            ) will turn into the following differential equation:
          </p>
          <p>
            A X i , j ui−1, j+C X i , j ui+1, j+ A Y i , j ui , j−1+C X i , j ui , j+1−Bi , j ui , j= Di , j ,
i=2 , N x +1 , j=2 , N y +1 .
(
            <xref ref-type="bibr" rid="ref7">7</xref>
            )
          </p>
          <p>
            Equation (
            <xref ref-type="bibr" rid="ref7">7</xref>
            ) contains the unknown function u (ui , j) at each point of the calculation area
( xi , y j) , i=2 , N x +1 , j=2 , N y +1.
          </p>
          <p>
            For (
            <xref ref-type="bibr" rid="ref7">7</xref>
            ), you can apply any known computational method of linear algebra, or use multi-grid
methods, which will significantly speed up the calculations, given that the number of unknowns
in the calculation area is large (pixels of the image). Also, it should be noted that taking into
account that λ &gt;0, then the difference equation (
            <xref ref-type="bibr" rid="ref7">7</xref>
            ) has a diagonal advantage, which consists in
the fact that in each row the module of each diagonal element of the SLAR is not less than the
sum of the modules of the other elements of the row [8]–[10].
          </p>
          <p>Now, to close the issue of the model, consider the consideration of the zero derivative at all
boundaries of the calculation area [10].</p>
          <p>Let our calculation area be in a rectangle [ xa ; xb ] × [ ya ; yb ] . To begin with, consider the zero
derivative on the left boundary:
∂ u| =0.</p>
          <p>
            ∂ x (xa; y)
Based on this, we need to adjust equation (
            <xref ref-type="bibr" rid="ref7">7</xref>
            ) on the left boundary:
Given that
          </p>
          <p>A X 2, j u1, j+C X 2, j u3 , j+ A Y 2, j u2, j−1+C X 2, j u2, j+1−¿</p>
          <p>−B2, j u2, j= D2, j , j=2 , N y +1 .</p>
          <p>|
∂ u
∂ x (xa; y)
≈ u2, j−u1, j =0 , u1, j=u2, j , j=2 , N y +1 .</p>
          <p>
            hx
Substitute the obtained boundary condition (
            <xref ref-type="bibr" rid="ref9">9</xref>
            ) on the left into (
            <xref ref-type="bibr" rid="ref8">8</xref>
            ):
Finally, let's transform (
            <xref ref-type="bibr" rid="ref10">10</xref>
            ) into the form:
          </p>
          <p>A X 2, j u2, j+C X 2, j u3 , j+ A Y 2, j u2, j−1+¿
+C X 2, j u2, j+1−B2, j u2, j= D2, j , j=2 , N y +1 .</p>
          <p>C X 2, j u3 , j+ A Y 2, j u2, j−1+C X 2, j u2, j+1−¿
−( B2, j− A X 2, j) u2, j= D2, j , j=2 , N y +1 .</p>
          <p>In equation (11), it should be noted that the coefficients are adjusted:</p>
          <p>B2, j=B2, j− A X 2, j , A X 2, j=0 , j=2 , N y +1 .</p>
          <p>
            Now we need to correct equation (
            <xref ref-type="bibr" rid="ref7">7</xref>
            ) on the right boundary:
(
            <xref ref-type="bibr" rid="ref8">8</xref>
            )
(
            <xref ref-type="bibr" rid="ref9">9</xref>
            )
(
            <xref ref-type="bibr" rid="ref10">10</xref>
            )
(11)
∂∂ux|(xb; y)
≈ uNx+2, j−uNx+1, j =0,uNx+1, j=uNx+2, j , j=2, N y+1.
          </p>
          <p>hx</p>
          <p>XNx+1, juNx, j+C XNx+1, juNx+1, j+ A Y Nx+1, juNx+1, j−1+¿
+C XNx+1, juNx+1, j+1−BNx+1, juNx+1, j=DNx+1, j , j=2, N y+1.</p>
          <p>Substitute into (12) the obtained boundary condition (13) on the right:
Substitute into (16) the obtained boundary condition (17) on the right:
(12)
(13)
(14)
(15)
(16)
(17)
(18)
(19)
Finally, let's transform (14) into the form:</p>
          <p>XNx+1, juNx, j+ A Y Nx+1, juNx+1, j−1+C XNx+1, juNx+1, j+1−¿
−(BNx+1, j−C XNx+1, j)uNx+1, j=DNx+1, j , j=2, N y+1.</p>
          <p>In equation (15), it should be noted that the coefficients are adjusted:</p>
          <p>BNx+1, j=BNx+1, j−C XNx+1, j ,C XNx+1, j=0 , j=2, N y+1.</p>
          <p>
            We adjust equation (
            <xref ref-type="bibr" rid="ref7">7</xref>
            ) at the lower limit:
          </p>
          <p>A Xi,2ui−1,2+C Xi,2ui+1,2+ A Y i,2ui,1+C Xi,2ui,3−¿
−Bi,2ui,2=Di,2,i=2, N x+1.</p>
          <p>≈ ui,2−ui,1=0,ui,1=ui,2,i=2, N x+1.</p>
          <p>∂∂uy|(x; ya) hy
A Xi,2ui−1,2+C Xi,2ui+1,2+ A Y i,2ui,2+C Xi,2ui,3−¿</p>
          <p>−Bi,2ui,2=Di,2,i=2, N x+1.</p>
          <p>A Xi,2ui−1,2+C Xi,2ui+1,2+C Xi,2ui,3−¿
−(Bi,2−A Y i,2)ui,2=Di,2,i=2, N x+1.</p>
          <p>Finally, let's transform (18) into the form:
In equation (19), it should be noted that the coefficients are adjusted:</p>
          <p>Bi,2=Bi,2−A Y i,2, A Y i,2=0,i=2, N x+1.</p>
          <p>
            We adjust equation (
            <xref ref-type="bibr" rid="ref7">7</xref>
            ) at the lower limit:
          </p>
          <p>A X i , N y+1 ui−1, N y+1+C X i , N y+1 ui+1, N y+1+ A Y i , N y+1 ui , N y+C X i , N y+1 ui , N y+2−¿</p>
          <p>−Bi , N y+1 ui , N y+1= Di , N y+1 , i=2 , N x +1 .
Substitute into (20) the obtained boundary condition (21) on the right:
Finally, let's transform (22) into the form:</p>
          <p>A X i , N y+1 ui−1, N y+1+C X i , N y+1 ui+1, N y+1+ A Y i , N y+1 ui , N y+¿
+C Y i , N y+1 ui , N y+1−Bi , N y+1 ui , N y+1= Di , N y+1 , i=2 , N x +1 .</p>
          <p>A X i , N y+1 ui−1, N y+1+C X i , N y+1 ui+1, N y+1+ A Y i , N y+1 ui , N y−¿</p>
          <p>−( Bi , N y+1−C Y i , N y+1) ui , N y+1= Di , N y+1 , i=2 , N x +1 .</p>
          <p>In equation (23), it should be noted that the coefficients are adjusted:</p>
          <p>Bi , N y+1=Bi , N y+1−C Y i , N y+1 , C Y i , N y+1=0 , i=2 , N x +1 .</p>
          <p>For a rectangular area, the values at the corners of this area also raise questions. Here, too,
everything is simple. As an option, you can make "stubs" as the arithmetic mean of two known
nearest neighboring limit values:
u1,1= u1,2+2 u2,1 , uN x+2, N y+2= uN x+1, N y+2+2 uN x+2, N y+1 ,
u1, N y+2=
u1, N y+1+u2, N y+2 , uN x+2,1= uN x+1,1+uN x+2,2 .</p>
          <p>2 2</p>
          <p>It should be noted that the boundary nodes of the region (24) do not take part in the
calculation procedures, since the 5-point difference scheme does not pass through these nodes.</p>
        </sec>
        <sec id="sec-3-3-2">
          <title>3.2. Testing the numerical method on various images</title>
          <p>The resulting algorithm was tested on 30 different images. The timing results for the first six
images are shown in Tables 1–4. It should be noted that the block sweep algorithm performed
better than all others for solving the discrete analog for the set task of equalizing the uneven
distribution of pixel intensity in the image. The algorithm of the Scipy library of the Python
programming language also performed well [11]–[13]. It should also be noted that
computational methods of linear algebra more effectively solve systems of linear algebraic
equations when the matrices of this system have a diagonal advantage [14], [15]. The greater the
difference between the modulus of the diagonal element and the sum of the modules of the other
elements of the row (and for each row), the faster the iterative method or algorithm converges.
(20)
(21)
(22)
(23)
(24)
1
2
3
4
5
6
1
2
3
4
5
6
216
450
216
249
192
341
216
450
216
249
192
341
197
297
218
186
256
404
197
297
218
186
256
404</p>
          <p>Next, we test the same algorithm based on the already known approximate algorithm of
longitudinal-transverse running (the results are shown in Table 3).</p>
          <p>We will do the same for the analytical block sweep algorithm, which makes it possible to
obtain an exact solution to the problem, taking into account the fact that the discrete analogue of
the Poisson equation has a clear sparse and block structure. (results are shown in Table 4).
Table 4
Time characteristics of finding a solution to the problem using the matrix run method for six
different images</p>
          <p>Image VPeirxteiclsal HoPriixzeolnstal PTioxtealls</p>
          <p>The visual results of the program are shown below.</p>
          <p>As can be seen from Figure 1, all images have a better pixel intensity distribution as a result
of applying the algorithm.</p>
        </sec>
      </sec>
      <sec id="sec-3-4">
        <title>4. Conclusions</title>
        <p>The practical result of this work is a comparative analysis of unevenly lit images based on the
field of the given field of gradients of these images, to obtain a visually improved image.</p>
        <p>In the work, mathematical dependencies are obtained for constructing an approximate
solution to the set problem of equalizing the uneven distribution of pixel intensity. An analysis
of classical computational methods of second-order elliptic equations of mathematical physics,
which are the basis of the variational approach of Poisson image processing, was carried out.
Seidel's method performed the worst in terms of time, the block run method using the built-in
Python library Scipy gave the best result in terms of time.</p>
        <p>In order to obtain better time indicators for a specific accuracy, it is best to use multi-grid
approximate methods, which make it possible to significantly reduce the number of iterations,
which means to reduce the time to execute the program.</p>
        <p>It should also be noted that the speed of iterative methods and algorithms will be higher if
calculations are performed in the normal system (from 0 to 1) and not in the classic system (from
0 to 255).
[11] Azimzadeh P., Forsyth P.A. (2016) Weakly Chained Matrices, Policy Iteration, and Impulse</p>
        <p>
          Control. SIAM J. No. 54 (
          <xref ref-type="bibr" rid="ref3">3</xref>
          ), 1341–1364.
[12] Chen Y., Wan J., Lin J. (2018) Monotone mixed finite difference scheme for Monge–Ampère
equation. J. Sci. Comput. 76, 1839–1867.
[13] Chen Y., Wan J. (2017) Multigrid methods for convergent mixed finite difference scheme for
        </p>
        <p>
          Monge-Ampère equation. Comput. Visual. Sci., 1–15.
[14] Chen Y., Wan J. (2018) Numerical method for image registration model based on optimal
mass transport. Inverse Problems Imaging 12(
          <xref ref-type="bibr" rid="ref2">2</xref>
          ), 401–432.
[15] Chow S.N., Li W., Zhou H. (2019) A discrete Schrödinger equation via optimal transport on
graphs. Journal of Functional Analysis 276, 2440–2469.
        </p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Ganesh</surname>
            <given-names>R.</given-names>
          </string-name>
          <string-name>
            <surname>Naik</surname>
            ,
            <given-names>Wellington P.</given-names>
          </string-name>
          (
          <year>2024</year>
          )
          <article-title>Biomedical Signal Processing. A Modern Approach</article-title>
          .
          <source>ISBN 10: 103206191X, ISBN 13: 9781032061917</source>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Xue-Cheng</surname>
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Suhua</surname>
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Haiguang</surname>
            <given-names>L.</given-names>
          </string-name>
          (
          <year>2018</year>
          )
          <article-title>Mathematical Methods in Image Processing</article-title>
          and Inverse Problems: IPIP 2018, Beijing, China,
          <source>April 21-24 (Springer Proceedings in Mathematics &amp; Statistics</source>
          ,
          <volume>360</volume>
          ) 1st ed.
          <year>2021</year>
          . DOI: https://doi.org/ 10.1007/
          <fpage>978</fpage>
          -981-16-2701-9.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>Zhou</surname>
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Qin</surname>
            <given-names>R.</given-names>
          </string-name>
          , Liu
          <string-name>
            <given-names>Z.</given-names>
            ,
            <surname>Qian</surname>
          </string-name>
          <string-name>
            <given-names>Y.</given-names>
            ,
            <surname>Ju</surname>
          </string-name>
          <string-name>
            <surname>X.</surname>
          </string-name>
          (
          <year>2022</year>
          )
          <article-title>Optimizing Performance of Image Processing Algorithms on GPUs</article-title>
          .
          <source>Proceeding of 2021 International Conference on Wireless Communications, Networking and Applications. WCNA 2021. Lecture Notes in Electrical Engineering</source>
          . Springer, Singapore. DOI: https://doi.org/10.1007/
          <fpage>978</fpage>
          -981-19-2456-9_
          <fpage>95</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>Mitsunori</surname>
            <given-names>G.</given-names>
          </string-name>
          (
          <year>2019</year>
          )
          <article-title>Image Processing Using ImageJ</article-title>
          .
          <source>Japanese Journal of Radiological Technology 75, no. 7</source>
          . DOI: http://dx.doi.org/10.6009/jjrt.2019
          <source>_jsrt_75.7</source>
          .688.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>Sivakumar</surname>
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Saminathan</surname>
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ranjana</surname>
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mohan</surname>
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pareek</surname>
            <given-names>P.</given-names>
          </string-name>
          (
          <year>2023</year>
          )
          <article-title>Malware Detection Using the Machine Learning Based Modified Partial Swarm Optimization Approach</article-title>
          ,
          <source>International Conference on Applied Intelligence and Sustainable Computing (ICAISC)</source>
          , Dharwad, India,
          <year>2023</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>5</lpage>
          . DOD:
          <volume>10</volume>
          .1109/ICAISC58445.
          <year>2023</year>
          .
          <volume>10199796</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Lande</surname>
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Maheswari</surname>
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kamali</surname>
            <given-names>S. M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dineshkumar</surname>
            <given-names>R.</given-names>
          </string-name>
          (
          <year>2023</year>
          )
          <article-title>Hybrid Optimization Based Long Short-Term Memory for Android Malware Detection</article-title>
          .
          <source>International Conference on Evolutionary Algorithms and Soft Computing Techniques (EASCT)</source>
          , Bengaluru, India,
          <year>2023</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>5</lpage>
          . DOD:
          <volume>10</volume>
          .1109/EASCT59475.
          <year>2023</year>
          .
          <volume>10393408</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <surname>Kotian</surname>
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sonkusare</surname>
            <given-names>R.</given-names>
          </string-name>
          (
          <year>2021</year>
          )
          <article-title>Detection of Malware in Cloud Environment using Deep Neural Network</article-title>
          , 6th International Conference for Convergence in Technology, Maharashtra, India,
          <year>2021</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>5</lpage>
          . DOI:
          <volume>10</volume>
          .1109/I2CT51068.
          <year>2021</year>
          .
          <volume>9417901</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>Khaidurov</surname>
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zaporozhets</surname>
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tsiupii</surname>
            <given-names>T.</given-names>
          </string-name>
          (
          <year>2022</year>
          )
          <article-title>Creation of High-Speed Methods for Solving Mathematical Models of Inverse Problems of Heat Power Engineering</article-title>
          . Springer,
          <article-title>Systems Decision and Control in Energy III</article-title>
          , vol.
          <volume>399</volume>
          ,
          <fpage>41</fpage>
          -
          <lpage>74</lpage>
          . DOI: https://doi.org/10.1007/978-3-
          <fpage>030</fpage>
          -87675-
          <lpage>3</lpage>
          . ISSN:
          <fpage>2198</fpage>
          -
          <lpage>4182</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <surname>Khaidurov</surname>
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yailymov</surname>
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shelestov</surname>
            <given-names>A.</given-names>
          </string-name>
          (
          <year>2023</year>
          )
          <article-title>Mathematical Model for Determining the Geometric Location of the Environmental Pollutant Based on Sensor Data</article-title>
          .
          <source>Proceedings of the IEEE International Conference on Intelligent Data Acquisition and Advanced Computing Systems: Technology and Applications</source>
          , IDAACS, pp.
          <fpage>703</fpage>
          -
          <lpage>707</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <surname>Khaidurov</surname>
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tsiupii</surname>
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zhovnovach</surname>
            <given-names>T.</given-names>
          </string-name>
          (
          <year>2021</year>
          )
          <article-title>Modelling of ultrasonic testing and diagnostics of materials by application of inverse problems</article-title>
          .
          <source>CEUR Workshop Proceedings</source>
          ,
          <year>2021</year>
          , 3039, Pp.
          <fpage>1</fpage>
          -
          <lpage>5</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>