# Image Texture Analysis and Edge Detection Algorithm Based on Anisotropic Diffusion Equation

Authors: Xiaoqin Li
Journal: Advances in Mathematical Physics
 (2021)

---

## Abstract

This paper uses partial differential equation image processing techniques to establish image texture analysis models based on nonlinear anisotropic diffusion equations for image denoising, image segmentation, and image decomposition. This paper proposes a class of denoising models based on the hybrid anisotropic diffusion equation from the characteristics of different noise types. The model exhibits anisotropic diffusion near the image boundary, which can protect the boundary well, and isotropic diffusion inside the image; so, it can remove the noise effectively. We use the immovable point theory to prove the uniqueness of the model solution and further discuss other properties such as asymptotics of the solution. We propose a class of image texture analysis algorithms based on anisotropic diffusion equations and discrete gray level sets. First, a class of nonconvex generalized functions is proposed to remove the noise from the original image to obtain a smooth image while sharpening the edges. Then, an energy generalization function based on the gray level set is proposed, and the existence of the global minimum of this energy generalization function is discussed. Finally, an equivalent form of this energy generalization is given in the discrete case, and an image texture analysis algorithm is designed based on the equivalent form. The algorithm is improved by initial position optimization, dynamic adjustment of parameters, and adaptive selection of thresholds so that the ants can search along the real edges. Experiments show that the improved algorithm for image edge detection can obtain more complete edges and better detection results. The energy generalization function is calculated directly on the discrete gray level set instead of solving the corresponding partial differential equation, which can avoid the selection of the initial level set and the reinitialization of the level set, thus greatly improving the segmentation efficiency. The new algorithm has a high improvement in segmentation efficiency and can efficiently handle large size complex images.


---

## Body

## 1. Introduction

In the process of processing digital images, the images obtained in practice are subject to many contaminants and image noise, due to the current state of technology. The noise makes the image blurred and thus loses some extremely important information, which makes the actual analysis difficult. Therefore, only effective preprocessing of noisy images can more accurately obtain the information we need from the images. Nonlinear diffusion filtering is often utilized in the post-processing of fluctuating data to visualize quality-related features in computer-aided quality control, as well as for texture enhancement [1]. Nonlinear diffusion is very useful for improvement, secondary sampling, line detection in blind image recovery, scale space-based segmentation algorithms, texture segmentation, telemetry data segmentation, and for target tracking in infrared images [2]. With the widespread development of image processing technology, people hope to give a clear mathematical explanation for image processing and then pay more attention to the mathematical nature of image processing. Mathematicians try to remodel existing image processing problems with strict mathematical theories, classify existing image processing algorithms, and improve image processing models at the level of mathematical theory. Among these mathematical theories, partial differential equations with mature systems have become a natural choice [3].The anisotropic diffusion equation is introduced into texture analysis to extract more discriminative image features. However, the anisotropic diffusion equation is an algorithm that requires a triple generalized cascade for image processing, and more generalized functions are required to extract features for a more accurate representation of image features. The 0-dimensional real features obtained from the anisotropic diffusion equation after the triple generalized cascade operation lose more image information, which also limits its application prospects [4]. In addition, in the process of image feature extraction, the features of a single algorithm are slightly inferior in characterizing the diversity of image information, the anisotropic diffusion equation is no exception, and the combination of more generalized functions to extract the triple features of an image is not effective in terms of computational efficiency. Because of the above problems, this project starts from the basis of an anisotropic diffusion equation, conducts an indepth study of it, combines its advantages and disadvantages, and proposes a new image feature extraction algorithm based on multiresolution anisotropic diffusion equation and multi-feature fusion for texture analysis [5]. In the framework of partial differential equations, it is easy to introduce and integrate methods from other fields to achieve model improvement and innovation. The theory of partial differential equation algorithm is mature, and it is easy to carry out the numerical realization of the model. Based on the many advantages of partial differential equations for image processing, this paper uses anisotropic diffusion equations (sets) to establish a series of image denoising, image segmentation, and image decomposition models [6].In image processing, the partial differential equation method has the following significant theoretical and computational features compared with other methods. Partial differential equations have a deep background and foundation in mathematical theory, which allows models to be adapted and stable algorithms to be obtained. Partial differential equations can integrate the established classical methods into a new framework system and reinterpret them in that system. In the framework of partial differential equations, it is easy to introduce and integrate methods from other fields to achieve model improvements and innovations. The theory of partial differential equation algorithms is mature and easy to carry out the numerical implementation of the model. In the first chapter, we start from the research background and significance of image literality analysis and edge detection and analyze the research difficulties and the research content of this topic. In the second chapter, we analyze the current research and provide the relevant theoretical research basis for this paper. In the third chapter, the study of image texture analysis and edge detection based on an anisotropic diffusion equation is presented. In this paper, the energy generalization is calculated directly on the discrete gray level set instead of solving the partial differential equation, thus avoiding the selection of the initial level set and the re-initialization of the level set, which can greatly improve the segmentation efficiency. The detailed steps and principles of the ant colony algorithm in edge detection are introduced, and the algorithm is improved and optimized for its problems and verified in natural images. Chapter four analyzes the image texture analysis and the image edge detection algorithm and proves that the research method in this paper has better performance and effectiveness. Chapter five summarizes and reviews the research contents of this paper, explains the areas that still need improvement in the research process, and points out the direction for future research work.


## 2. Related Work

From segmentation methods, image segmentation is mainly divided into edge-based detection methods and region-based segmentation methods. Since this method can achieve completely unsupervised segmentation, it is widely used in the field of image segmentation. Compared with traditional image segmentation methods, the active contour model can accurately achieve segmentation accuracy and can also be more easily expressed in terms of energy generalization and ensure the clarity of the image shape, intensity distribution, and other attributes [7]. Jubairahmed et al. first proposed the famous snake model, which is a segmentation model based on boundary detection, and the idea is to obtain the final segmentation curve by solving for the minimum of the geometric measure [8]. The main idea is to transform the boundary problem into a zero-level set of higher one-dimensional functions, which finally reduces to solving partial differential equations. Under the framework of the level set method, the image segmentation model based on partial differential equations has been developed greatly [9]. Based on the work of Mafi et al., a series of image segmentation models based on the set of reaction dilation equations were proposed. One equation in the set of equations is used to obtain the structural part of the image, the other equation is used to obtain the structural part of the image, the other equation is used to obtain the texture part of the image, and the two equations are coupled by the source term [10]. The solution of one equation will affect the source term of the other equation, and finally, obtain uniform and smooth image structure information and oscillating texture information [11].Sun et al. examine several numerical schemes to create discrete nonlinear diffusion scale-spaces, for dimensional vector models, proving that the explicit scheme is appropriate. They show that the diffusion overshoot process is suitable, as well as satisfying the mean gray invariance and extremum principles, making the sequence smooth and convergent to a constant steady-state [12]. He et al. establish relevant one-dimensional semiimplicit and Crank-Nicolson computational formats and compare their results. In addition, four authors also examine the m-dimensional diffusion, for which they also make use of the related one-dimensional semi-implicit and Crank-Nicolson computational formats, under which conditions the matrix to be computed is not tridiagonal and is a general matrix, and therefore computationally highland. Therefore, the authors suggest using splitting, alternating direction implicit, local one-dimensional, or adaptive operator splitting computational formats [13]. Bai et al. explain how to use anisotropic diffusion models for color images so that the image is defined on a multidimensional surface. Good results were obtained with boundary enhancement and enhancement of coherent diffusion model, using it with grayscale images, proposing a multidimensional color model [14]. To deal with the vector image approach, the simplest one is to treat each channel of the multichannel data separately and independently by diffusion filtering [15]. This approach causes undesired effects as if the boundaries of each channel are formed at different locations on the image. To avoid this effect, an integrated diffusion process must be used so that it summarizes the data of all channels [16].The existing research on the system of reaction-diffusion equations is getting deeper and deeper, especially the theoretical research on the minimum variational flow has been greatly developed in the last decade, and the study of the system of reaction-diffusion equations using these methods will be an important topic [17]. We will develop a series of image decomposition models based on the system of reaction-diffusion equations and guide the selection of model parameters and the design of algorithms by studying the suitability of their solutions [18]. A zero-crossing detector is used to separate edge regions from nonedge regions, and then an adaptive weight function is used to select the edge detection method, which can be adaptively adjusted to use different methods according to the information in the region range, and a full variational model is used to detect regions containing double edges and the presence of false edges. Meanwhile, this method is also helpful in removing image noise [19, 20]. By splitting the edge regions and nonedge regions, the smoothing operation can be reduced in the part containing edges to retain more edge detail information; in the nonedge part, the smoothing operation is used to remove noise.


## 3. Research on Image Texture Analysis and Edge Detection Based on the Anisotropic Diffusion Equation

### 3.1. Image Texture Feature Model

The texture image features extracted by this image texture representation method contain the following three components: segmentation structure pattern features, fine-grained local binary pattern features, and neighborhood difference pattern features. The split structure pattern feature contains the complete contour structure of the image texture and is used to represent the overall contour information of the image texture. The subdivided local binary pattern feature is a subdivision of the traditional complete local binary pattern so that the nonuniform patterns in the traditional complete local binary pattern method are fully utilized for obtaining the local information of the image texture. Using the difference information between the neighbor pixels of the segmented structural pattern and the subdivided local binary pattern, we obtain the neighborhood difference pattern feature. Among them, the neighborhood difference pattern features acquire both the local texture information of the image texture and the overall contour information of the image texture. These three partial features are normalized to form the structural difference histogram representation features used to describe the texture image [21, 22]. It can be seen that this image texture representation effectively combines both local and macrotexture information of image textures. The structural differential histogram representation features can obtain good classification performance for different imaging conditions, such as illumination changes, image rotation, and deflation. Moreover, the feature extraction method is computationally fast, and the dimensionality of the features is relatively small, which can achieve fast texture image classification while ensuring the classification performance.The anisotropy equation can be expressed as a problem consisting of a diffusive partial differential equation plus an initial condition and a mean Neumann boundary condition, as shown in Equation (1), where n denotes the outward normal.
(1)dv⟶=dDK∀vφ⟶∀v⟶+ϖv⟶−f⟶,v⟶x,1=f⟶x,dv⟶dm⟶=0.The multiscale construction tensor is a matrix derived from the gradient of a function. It summarizes the main directions of the gradient in the specified domain of points with powers that are coherent with these directions [23]. The diffusion process with the steering of the structure tensor instead of the regularized gradient steering allows us to adapt it to more refined goals, such as the enhancement of coherent flow-like structural elements. I must reconsider the vector-valued construction descriptors ∀vφ⟶ in relation to the matrix basis. The matrix K∀vφ⟶ arises from the tensor product as shown in Equation (2), where ⊗ is the tensor product with a standard orthogonal basis constructed from the eigenvectors v1⟶,v2⟶, such that v1⟶⊕∀vφ⟶ and v2⟶⊙∀vφ⟶. The associated eigenvalues are ∀vφ⟶2, and 0 denotes the directional contrast of the eigenvectors.
(2)K∀vφ⟶≜∀vφ⟶⊗∀v⟶.If we consider a color image, for example, a three-dimensional red, green, and blue image, the arithmetic value is taken to construct a three-dimensional construction tensor, as shown in Equation (3).
(3)Πv⟶=∑i=13Kvi3.To make the directional information complete, it is necessary toK∀vφ⟶ follow the convolution of the heat kernel by the component Hφ. Therefore, the construction tensor is obtained, as shown in Equation (4).
(4)Kφ∀vφ⟶=Hφ∗K∀vφ⟶.For a central pixel in a local neighborhood, the relationship between its neighboring pixels is an important clue for a complete representation of these local neighborhoods. In this section, we will obtain the rotation-invariant neighbor difference pattern features of a texture image and its segmentation structure. For a central pixel in a local neighborhood of texture image I, its rotation-invariant NDP can be expressed as Equation (5). Here, C is the number of neighbor pixels of the central pixel, fm,nmodi,C is the ith neighbor pixel, and fm,nmodi−1,C is the (i−1)-th neighbor pixel.
(5)NDPm,n=limC⟶∞∑i=0C−1hfm,nmodi,C−fm,nmodi−1,C.The NDP feature histogram is built from the constructed NDP to represent the difference information between neighboring pixels in the local area of the texture imageI. The square window of the NDP feature histogram can be calculated by a mathematical expression, as expressed in Equation (6).
(6)gi=limM,N⟶∞∑m=1M∑n=1NfNDPm,n,i,i⊆1,C.To extract SDHR features, a given texture image is first transformed into a structurally encoded map; then, three types of patterns are computed for constructing SSP, RLBP, and NDP features, respectively; finally, we use SDHR to represent the connection of these three parts of pattern histogram features [24]. To have a clear and complete understanding of our proposed method, the complete flowchart of constructing SDHR features is given in Figure 1. From the computation process of SDHR features, we can easily see that our proposed texture feature representation not only contains microtexture information, but also the overall contour information of the image texture is included.Figure 1
Flow chart of texture classification method.Let the difference between the values on the two points (m0, n0) and (m1, n1) of the image be Equation (7).
(7)∀v⟶=v⟶m0,n0⊙v⟶m1,n1.When the Euclidean distance of (m0, n0) from (m1, n1) is near zero, the arc length is equivalent to Equation (8).
(8)dv⟶=∑i=13dvidm∫dm+dvidn∫dn.Consider a curvec in a manifold such that it is parametrized by the arc length. If c0=p and its first-order derivative are contained in the tangent plane, then a0,vc=ΓX,X, the second fundamental form of which has the following expression ΓX,X=Kμ∗sinμ, Kμ is the curvature of the curve cφ which is cut from the manifold by the plane containing X such that the angle between this plane, and the normal plane is equivalent to μ. Thus, due to the proven positivity, we can define the parametrization of Equation (9).
(9)fv⟶=∫dv⟶=∑i=13dvidm∫dm+dvidn∫dn.The features extracted from the spatial, wavelet, and spectral domains are reasonable. Specifically, the pixel values in the color space are extracted from the spatial domain to represent the color information of the image. Since the wavelet transform captures the directional and multiresolution information of the image, the directional and multiresolution features are extracted from the wavelet domain. In addition, spectral features are also extracted from the spectral domain. Finally, the features of the above three domains are converted into an NS feature matrix using NS transform. This paper proposes an efficient image denoising model based on nonlinear diffusion equation. Aiming at the shortcomings of the traditional model that the forward and backward diffusion occurs and the step effect is generated, a new type of diffusion coefficient is first constructed, and its theoretical properties are analyzed. Then, a new diffusion equation model was constructed based on the new diffusion coefficient. This model combines median curvature diffusion and Gaussian heat equation diffusion, and forward and backward diffusion will occur, but the backward diffusion is controllable, so that the restored image will not produce new features.


### 3.2. Image Edge Detection Algorithm

Edges play an important role in image analysis as the most basic feature of an image. Discontinuities in local features, abrupt changes in grayscale or structural information may manifest as edges on an image. At the same time, edges are transitions that connect regions, and usually, this feature can be used to segment an image. All edges have both direction and amplitude characteristics, with a flatter grayscale change following the edge, while the one perpendicular to the edge, generally referred to as the normal direction, and usually has an abrupt grayscale change. This change in magnitude with direction can be measured by a differential operator, mathematically derived as a first- or second-order derivative.The first-order derivative considers the edge as the location where the pixel undergoes a sharp change, and this change is generally described by the gradient of the grayscale distribution, with the maximum value obtained from the first-order derivative corresponding to the edge location. Finding the gradient amplitude is the most commonly used differentiation method, given a continuous image f (m, n) whose directional derivative obtains a local maximum in the direction normal to the edge. The second-order derivative can be obtained using the Laplace operator [25]. The calculated derivatives over the zero point correspond to the edge positions in the image. For regions with uniform gray changes, the first-order derivative will not find the boundary, and the second-order derivative can not only identify the type of gray abrupt changes but also provide useful boundary information. Although in principle the higher order of the derivative means the better image segmentation, the derivative information beyond the second-order lacks application value. At present, the second-order derivative is rarely used for edge detection because it is very sensitive to noise, and if the noise is not successfully removed, small noise particles will be amplified into fine lines; so, a part of the noise must be removed by smoothing filtering before edge detection.The second-order differential operator can locate the edge position accurately but ignores the grayscale difference of the surrounding pixels. In particular, isolated noise points near the edges that are not filtered out, the response to these points can cause high bright spots or thin lines close to the edges, thus affecting the boundary recognition. This is where low-pass filtering becomes necessary. Therefore, it is necessary to combine the windowed adaptive median filtering algorithm proposed in this paper with the Laplace operator to form a new template. The results of the operations under the Laplacian differential operator are isotropic, and the form of the template illustrates its unique rotational invariance, for a two-dimensional image, defined here as in Equation (10).
(10)∏fm,n=fm+1,n+1+fm+1,n+fm,n+1−fm−1,n−1+fm−1,n+fm,n−1+fm,n.The pull operator is expressed as a discrete form, as in Equation (11). The gray level of 255 is represented as completely white, and the gray level of 0 is represented as completely black, a gradual process from black to white. If two adjacent gray levels are very close, it is not easy for the human eye to distinguish clearly. This explains why the larger the gray level span, the clearer the image resolution, and the more comfortable it is to look at. Of course, a larger pixel gray level of an image does not all mean the better its contrast, and a certain number of pixels across these gray levels are required.
(11)∏f=∫df2dm2+∫df2dn2.The role of detection processing after image enhancement is to enhance the contrast between pixel gray levels. Because the image becomes blurred by averaging and integration operations, details can be highlighted using image inverse operations. The Laplacian based on differential operation enhances the image region where the abrupt gray change occurs while the effect of smoothing the gray change in the region is diminished. Therefore, the original image is processed using the Laplacian operator to generate an image that reflects the grayscale abrupt change, and the image sharpening effect is obtained by overlaying this image with the original image. This image sharpening method, because it is obtained by superimposing the original image with the result of the operator processing, can fully retain the background information of the image and the gray value in different image areas and enhance the contrast and small detail information of the gray mutation area, but the disadvantage is that it is easy to produce a double response to the edge of some areas.The direction of all edges is quantified by delineating a range of directions, again using the horizontal edge as an example, and defining the direction of the edge by the direction of the normal. As shown in Figure2(a), if the coordinates of the edge normal direction range from -24.5° to +24.5, or from -158.5° to +158.5°, then all edges within this range are horizontal edges. Figure 2(b) is used to represent the angle ranges corresponding to the four directions.Figure 2
The angle of direction of edge normal.
(a)(b)There are two basic operators in digital morphology which are expansion and erosion. The principle is to obtain information about the image morphology and structure in a set image region using structured units of a specific shape, followed by detection and recognition of image details. For example, the structured elementB corrodes the digital image and is represented by Equation (12), where Ga is the translation of vector a to N. Setting structural element N as a disk when the center of the image is on P, erosion can be considered as the trajectory of the center point of element N when structural element B moves in image M.
(12)M÷N=s⊆P,Ga⊆M.The expansion operation of structured elementB for image A can be expressed by equation (13), setting the center of structured element N at the origin, and the expansion operation can be understood as the whole image area covered by the structured element N scrolling over the image. This operation is the one that causes the expansion of the image target area and the narrowing of the holes present in the image to be connected.
(13)M×N=ℝn⊆N∗Mn.Using a combination of these two methods, the image is first inflated with structural elements, followed by an erosion process, so that any noise that is not removed cleanly is eliminated to the maximum. This combination of operations, also known as the closed operation, is capable of smoothing the true contours of the image so that small faults are fused and small voids are eliminated. This operation is represented by Equation (14).
(14)T1=M⊙N∗N,T2=M∗N⊙N.Using the structure element corrosion map, and then calculating the Boolean difference between the image after corrosion and the original image, assuming thatG is the image edge information, Equation (15) can be obtained. Edge detection can be performed on the inner boundary of the image to obtain the inner boundary information of the image.
(15)G=M−M⊗N.We chose the structural elements based on the size and dimensions of the image itself, which should be as small as possible, and approximate the shape of the noise distribution, considering the image measurement used. Since the added pretzel noise is represented as black and white noise, the structural elements are chosen as small dots for the experiment. This composite approach of morphological filtering operator combines two operations. In the paper, both erosion and open operations are combined to form a peak noise filter, and then by combining expansion and closure operations, a low-pass noise filter is obtained. The combination of two filters can get the effect of suppressing the noise of both peaks and troughs in the image. Combined with the morphological operation to strengthen the edges, the line sense of the detected target is stronger after edge recognition. After the image edges are initially extracted with the improved operator, the multistructure morphological filtering is performed to achieve further boundary enhancement of the image and retain more perfect contour edge information.To address the problems that traditional image edge contour extraction algorithms often have discontinuous edges and broken edge segments when extracting edges, the algorithm in this paper incorporates the fuzzy triangular affiliation function into the ant colony algorithm and combines it with the edge detection Canny algorithm. Firstly, the Canny algorithm is used to detect the edges of the target image, then the ant colony algorithm fused with FTM is used to detect the broken edges twice, and finally, the ideal continuous edge contour is extracted. The edges are extracted from the original image using the canny operator, setting the gray value of the edge points in the edge image to 255 and the gray value of the nonedge part to 0. The number of connections between each nonedge pixel point and edge pixel point in the figure is calculated as shown in Equation (16).
(16)gxi=fxi∑i=1255xi,H=limn⟶∞∑i=1n1−gxi∗1−gxi+1∗1−gxi+2.By setting the ant stop search condition, it can effectively reduce the invalid search of ants on edge points and nonedge regions, saving the search time and improving the efficiency of the algorithm. After allK ants placed are iterated, by setting the pheromone concentration threshold, the pixel points larger than the threshold are selected and marked as edge points, thus completing the secondary detection of the area between the edge endpoints in the edge image and obtaining better continuity and clearer edge information.


## 3.1. Image Texture Feature Model

The texture image features extracted by this image texture representation method contain the following three components: segmentation structure pattern features, fine-grained local binary pattern features, and neighborhood difference pattern features. The split structure pattern feature contains the complete contour structure of the image texture and is used to represent the overall contour information of the image texture. The subdivided local binary pattern feature is a subdivision of the traditional complete local binary pattern so that the nonuniform patterns in the traditional complete local binary pattern method are fully utilized for obtaining the local information of the image texture. Using the difference information between the neighbor pixels of the segmented structural pattern and the subdivided local binary pattern, we obtain the neighborhood difference pattern feature. Among them, the neighborhood difference pattern features acquire both the local texture information of the image texture and the overall contour information of the image texture. These three partial features are normalized to form the structural difference histogram representation features used to describe the texture image [21, 22]. It can be seen that this image texture representation effectively combines both local and macrotexture information of image textures. The structural differential histogram representation features can obtain good classification performance for different imaging conditions, such as illumination changes, image rotation, and deflation. Moreover, the feature extraction method is computationally fast, and the dimensionality of the features is relatively small, which can achieve fast texture image classification while ensuring the classification performance.The anisotropy equation can be expressed as a problem consisting of a diffusive partial differential equation plus an initial condition and a mean Neumann boundary condition, as shown in Equation (1), where n denotes the outward normal.
(1)dv⟶=dDK∀vφ⟶∀v⟶+ϖv⟶−f⟶,v⟶x,1=f⟶x,dv⟶dm⟶=0.The multiscale construction tensor is a matrix derived from the gradient of a function. It summarizes the main directions of the gradient in the specified domain of points with powers that are coherent with these directions [23]. The diffusion process with the steering of the structure tensor instead of the regularized gradient steering allows us to adapt it to more refined goals, such as the enhancement of coherent flow-like structural elements. I must reconsider the vector-valued construction descriptors ∀vφ⟶ in relation to the matrix basis. The matrix K∀vφ⟶ arises from the tensor product as shown in Equation (2), where ⊗ is the tensor product with a standard orthogonal basis constructed from the eigenvectors v1⟶,v2⟶, such that v1⟶⊕∀vφ⟶ and v2⟶⊙∀vφ⟶. The associated eigenvalues are ∀vφ⟶2, and 0 denotes the directional contrast of the eigenvectors.
(2)K∀vφ⟶≜∀vφ⟶⊗∀v⟶.If we consider a color image, for example, a three-dimensional red, green, and blue image, the arithmetic value is taken to construct a three-dimensional construction tensor, as shown in Equation (3).
(3)Πv⟶=∑i=13Kvi3.To make the directional information complete, it is necessary toK∀vφ⟶ follow the convolution of the heat kernel by the component Hφ. Therefore, the construction tensor is obtained, as shown in Equation (4).
(4)Kφ∀vφ⟶=Hφ∗K∀vφ⟶.For a central pixel in a local neighborhood, the relationship between its neighboring pixels is an important clue for a complete representation of these local neighborhoods. In this section, we will obtain the rotation-invariant neighbor difference pattern features of a texture image and its segmentation structure. For a central pixel in a local neighborhood of texture image I, its rotation-invariant NDP can be expressed as Equation (5). Here, C is the number of neighbor pixels of the central pixel, fm,nmodi,C is the ith neighbor pixel, and fm,nmodi−1,C is the (i−1)-th neighbor pixel.
(5)NDPm,n=limC⟶∞∑i=0C−1hfm,nmodi,C−fm,nmodi−1,C.The NDP feature histogram is built from the constructed NDP to represent the difference information between neighboring pixels in the local area of the texture imageI. The square window of the NDP feature histogram can be calculated by a mathematical expression, as expressed in Equation (6).
(6)gi=limM,N⟶∞∑m=1M∑n=1NfNDPm,n,i,i⊆1,C.To extract SDHR features, a given texture image is first transformed into a structurally encoded map; then, three types of patterns are computed for constructing SSP, RLBP, and NDP features, respectively; finally, we use SDHR to represent the connection of these three parts of pattern histogram features [24]. To have a clear and complete understanding of our proposed method, the complete flowchart of constructing SDHR features is given in Figure 1. From the computation process of SDHR features, we can easily see that our proposed texture feature representation not only contains microtexture information, but also the overall contour information of the image texture is included.Figure 1
Flow chart of texture classification method.Let the difference between the values on the two points (m0, n0) and (m1, n1) of the image be Equation (7).
(7)∀v⟶=v⟶m0,n0⊙v⟶m1,n1.When the Euclidean distance of (m0, n0) from (m1, n1) is near zero, the arc length is equivalent to Equation (8).
(8)dv⟶=∑i=13dvidm∫dm+dvidn∫dn.Consider a curvec in a manifold such that it is parametrized by the arc length. If c0=p and its first-order derivative are contained in the tangent plane, then a0,vc=ΓX,X, the second fundamental form of which has the following expression ΓX,X=Kμ∗sinμ, Kμ is the curvature of the curve cφ which is cut from the manifold by the plane containing X such that the angle between this plane, and the normal plane is equivalent to μ. Thus, due to the proven positivity, we can define the parametrization of Equation (9).
(9)fv⟶=∫dv⟶=∑i=13dvidm∫dm+dvidn∫dn.The features extracted from the spatial, wavelet, and spectral domains are reasonable. Specifically, the pixel values in the color space are extracted from the spatial domain to represent the color information of the image. Since the wavelet transform captures the directional and multiresolution information of the image, the directional and multiresolution features are extracted from the wavelet domain. In addition, spectral features are also extracted from the spectral domain. Finally, the features of the above three domains are converted into an NS feature matrix using NS transform. This paper proposes an efficient image denoising model based on nonlinear diffusion equation. Aiming at the shortcomings of the traditional model that the forward and backward diffusion occurs and the step effect is generated, a new type of diffusion coefficient is first constructed, and its theoretical properties are analyzed. Then, a new diffusion equation model was constructed based on the new diffusion coefficient. This model combines median curvature diffusion and Gaussian heat equation diffusion, and forward and backward diffusion will occur, but the backward diffusion is controllable, so that the restored image will not produce new features.


## 3.2. Image Edge Detection Algorithm

Edges play an important role in image analysis as the most basic feature of an image. Discontinuities in local features, abrupt changes in grayscale or structural information may manifest as edges on an image. At the same time, edges are transitions that connect regions, and usually, this feature can be used to segment an image. All edges have both direction and amplitude characteristics, with a flatter grayscale change following the edge, while the one perpendicular to the edge, generally referred to as the normal direction, and usually has an abrupt grayscale change. This change in magnitude with direction can be measured by a differential operator, mathematically derived as a first- or second-order derivative.The first-order derivative considers the edge as the location where the pixel undergoes a sharp change, and this change is generally described by the gradient of the grayscale distribution, with the maximum value obtained from the first-order derivative corresponding to the edge location. Finding the gradient amplitude is the most commonly used differentiation method, given a continuous image f (m, n) whose directional derivative obtains a local maximum in the direction normal to the edge. The second-order derivative can be obtained using the Laplace operator [25]. The calculated derivatives over the zero point correspond to the edge positions in the image. For regions with uniform gray changes, the first-order derivative will not find the boundary, and the second-order derivative can not only identify the type of gray abrupt changes but also provide useful boundary information. Although in principle the higher order of the derivative means the better image segmentation, the derivative information beyond the second-order lacks application value. At present, the second-order derivative is rarely used for edge detection because it is very sensitive to noise, and if the noise is not successfully removed, small noise particles will be amplified into fine lines; so, a part of the noise must be removed by smoothing filtering before edge detection.The second-order differential operator can locate the edge position accurately but ignores the grayscale difference of the surrounding pixels. In particular, isolated noise points near the edges that are not filtered out, the response to these points can cause high bright spots or thin lines close to the edges, thus affecting the boundary recognition. This is where low-pass filtering becomes necessary. Therefore, it is necessary to combine the windowed adaptive median filtering algorithm proposed in this paper with the Laplace operator to form a new template. The results of the operations under the Laplacian differential operator are isotropic, and the form of the template illustrates its unique rotational invariance, for a two-dimensional image, defined here as in Equation (10).
(10)∏fm,n=fm+1,n+1+fm+1,n+fm,n+1−fm−1,n−1+fm−1,n+fm,n−1+fm,n.The pull operator is expressed as a discrete form, as in Equation (11). The gray level of 255 is represented as completely white, and the gray level of 0 is represented as completely black, a gradual process from black to white. If two adjacent gray levels are very close, it is not easy for the human eye to distinguish clearly. This explains why the larger the gray level span, the clearer the image resolution, and the more comfortable it is to look at. Of course, a larger pixel gray level of an image does not all mean the better its contrast, and a certain number of pixels across these gray levels are required.
(11)∏f=∫df2dm2+∫df2dn2.The role of detection processing after image enhancement is to enhance the contrast between pixel gray levels. Because the image becomes blurred by averaging and integration operations, details can be highlighted using image inverse operations. The Laplacian based on differential operation enhances the image region where the abrupt gray change occurs while the effect of smoothing the gray change in the region is diminished. Therefore, the original image is processed using the Laplacian operator to generate an image that reflects the grayscale abrupt change, and the image sharpening effect is obtained by overlaying this image with the original image. This image sharpening method, because it is obtained by superimposing the original image with the result of the operator processing, can fully retain the background information of the image and the gray value in different image areas and enhance the contrast and small detail information of the gray mutation area, but the disadvantage is that it is easy to produce a double response to the edge of some areas.The direction of all edges is quantified by delineating a range of directions, again using the horizontal edge as an example, and defining the direction of the edge by the direction of the normal. As shown in Figure2(a), if the coordinates of the edge normal direction range from -24.5° to +24.5, or from -158.5° to +158.5°, then all edges within this range are horizontal edges. Figure 2(b) is used to represent the angle ranges corresponding to the four directions.Figure 2
The angle of direction of edge normal.
(a)(b)There are two basic operators in digital morphology which are expansion and erosion. The principle is to obtain information about the image morphology and structure in a set image region using structured units of a specific shape, followed by detection and recognition of image details. For example, the structured elementB corrodes the digital image and is represented by Equation (12), where Ga is the translation of vector a to N. Setting structural element N as a disk when the center of the image is on P, erosion can be considered as the trajectory of the center point of element N when structural element B moves in image M.
(12)M÷N=s⊆P,Ga⊆M.The expansion operation of structured elementB for image A can be expressed by equation (13), setting the center of structured element N at the origin, and the expansion operation can be understood as the whole image area covered by the structured element N scrolling over the image. This operation is the one that causes the expansion of the image target area and the narrowing of the holes present in the image to be connected.
(13)M×N=ℝn⊆N∗Mn.Using a combination of these two methods, the image is first inflated with structural elements, followed by an erosion process, so that any noise that is not removed cleanly is eliminated to the maximum. This combination of operations, also known as the closed operation, is capable of smoothing the true contours of the image so that small faults are fused and small voids are eliminated. This operation is represented by Equation (14).
(14)T1=M⊙N∗N,T2=M∗N⊙N.Using the structure element corrosion map, and then calculating the Boolean difference between the image after corrosion and the original image, assuming thatG is the image edge information, Equation (15) can be obtained. Edge detection can be performed on the inner boundary of the image to obtain the inner boundary information of the image.
(15)G=M−M⊗N.We chose the structural elements based on the size and dimensions of the image itself, which should be as small as possible, and approximate the shape of the noise distribution, considering the image measurement used. Since the added pretzel noise is represented as black and white noise, the structural elements are chosen as small dots for the experiment. This composite approach of morphological filtering operator combines two operations. In the paper, both erosion and open operations are combined to form a peak noise filter, and then by combining expansion and closure operations, a low-pass noise filter is obtained. The combination of two filters can get the effect of suppressing the noise of both peaks and troughs in the image. Combined with the morphological operation to strengthen the edges, the line sense of the detected target is stronger after edge recognition. After the image edges are initially extracted with the improved operator, the multistructure morphological filtering is performed to achieve further boundary enhancement of the image and retain more perfect contour edge information.To address the problems that traditional image edge contour extraction algorithms often have discontinuous edges and broken edge segments when extracting edges, the algorithm in this paper incorporates the fuzzy triangular affiliation function into the ant colony algorithm and combines it with the edge detection Canny algorithm. Firstly, the Canny algorithm is used to detect the edges of the target image, then the ant colony algorithm fused with FTM is used to detect the broken edges twice, and finally, the ideal continuous edge contour is extracted. The edges are extracted from the original image using the canny operator, setting the gray value of the edge points in the edge image to 255 and the gray value of the nonedge part to 0. The number of connections between each nonedge pixel point and edge pixel point in the figure is calculated as shown in Equation (16).
(16)gxi=fxi∑i=1255xi,H=limn⟶∞∑i=1n1−gxi∗1−gxi+1∗1−gxi+2.By setting the ant stop search condition, it can effectively reduce the invalid search of ants on edge points and nonedge regions, saving the search time and improving the efficiency of the algorithm. After allK ants placed are iterated, by setting the pheromone concentration threshold, the pixel points larger than the threshold are selected and marked as edge points, thus completing the secondary detection of the area between the edge endpoints in the edge image and obtaining better continuity and clearer edge information.


## 4. Analysis of Results

### 4.1. Image Texture Analysis

To test the recognition ability of the features extracted by our method, we conducted test experiments on set 1, set 2, set 3, set 4, set 5, and set 6. Meanwhile, we used LRS-MD, PMC-BC, CLBP, MLEP, Cov-LBPD, and scLBP to compare with our anisotropic diffusion equation features. The ACAR of the results of the experiment is shown in Figure3. From Figure 3, it can be seen that our method slightly outperforms the other comparison methods when the images are not rotated, and the standard deviation of our method is lower than that of the other comparison methods. In addition, we also give the ACARS of the SDMV feature and the FV feature of the texture image, where these two features are represented by the anisotropic diffusion equation-SDMV and the anisotropic diffusion equation-FV. The ACARS of these two independent features illustrates that the combination of both can achieve better classification results.Figure 3
Comparison results of recognition experiments.To further test the performance of our proposed anisotropic diffusion equation feature in processing rotated images, we conducted test experiments on set 1, set 2, set 3, set 4, set 5, and set 6, respectively. The ACARS of the experimental results of our method and the comparison method is shown in Figure4. It is clear from Figure 4 that the ACAR of our method outperforms the six comparison methods. Our method obtains the best experimental results on set 1, set 2, set 3, set 4, set 5, and set 6. Moreover, the standard deviation of our method is smaller than the other six comparison methods, except that the standard deviation of the CLBP method is lower than our method on set 4 and set 5. The results of image texture classification experiments demonstrate that the rotation-invariant property has been included in our extracted anisotropic diffusion equation image texture features, and such a combination of features improves the recognition ability based on transform domain features.Figure 4
Performance experimental comparison results.Combining the results in Figures3 and 4, we can see that our method yields good classification results with and without image rotation. This further proves that rotation invariance is included in our extracted features.To further extensively test the performance of our extracted image texture features for rotated image classification, we further conduct test experiments for rotation invariance on two more complex image texture datasets, TIPS2 and OUTEX. The experimental results of our method and the comparison method are shown in Figure5. As can be seen from Figure 5, our method slightly outperforms the other comparison methods on both challenging texture sets. Thus, the results of these experiments further demonstrate the robustness of our texture feature construction method in processing rotated images. The results of the whole image texture classification comparison experiments on the TIPS2 and OUTEX databases show that our method can handle rotated images well and can obtain satisfactory classification performance.Figure 5
Results of rotational invariance tests.Based on the introduction of the anisotropic diffusion equation image texture feature representation method, it can be seen that this feature representation method effectively combines the advantages of the rotational invariance of the null domain method and the advantages of the transform domain method that can perform directional multiscale analysis, and it can be said that this method is an effective combination of the null domain method and the transform domain method. At the same time, the advantages of the two methods complement each other, thus improving the classification performance of the constructed features. The value of this texture feature construction method is that it introduces the idea of rotation invariance into the transform domain-based method. However, the dimensionality of the features constructed by this method is high, and therefore, feature dimensionality reduction is required.


### 4.2. Edge Detection Analysis

The quantitative analysis of the experiments in this section still utilizes the mean square error MSE and peak signal-to-noise ratio PSNR as evaluation metrics. Since noise as blood vessels around the tissue is the main factor affecting the detection results in the mass images, the superiority of the algorithm can be judged by the amount of noise content in the results. The results are shown in Figure6. From Figure 6, it can be seen that the mean square error of the method in this paper is smaller compared to the other two algorithms, indicating that the noise content is less in the detection results of the method in this paper, and the corresponding value of the peak signal-to-noise ratio is larger. Combining the results of both subjective judgments and quantitative analyses illustrates the effectiveness of the algorithm in this paper. Using the edge detection method is one of the main methods for image segmentation, and the lumps can be filled next to complete the segmentation.Figure 6
Quantitative analysis results of the three algorithms.As can be seen in Figure7, compared with the lump segmentation results obtained by the other two methods, the lump region extracted using the algorithm proposed in this paper has significantly better results and higher segmentation accuracy after a comprehensive analysis of the three indicators. The algorithm uses the Canny edge breakpoint as the initial position of the ant, changes the traditional ant colony algorithm to directly use the gradient information as the heuristic information, but uses the fuzzy triangular affiliation function to calculate the fuzzy affiliation degree of the pixel points in the image as the heuristic information of the ant colony, and sets the search stopping condition, which makes the continuity of the image edge better and the lumps obtained after filling more complete. From the extraction results of relevant comparison experiments, it can be seen that compared with other algorithms, the extracted image edge contour information and the filled obtained lump segmentation image by the method in this paper are clearer, more complete, and more accurate than the adaptive Canny algorithm and the comparison algorithm methods. The accuracy of the algorithm in this paper is more than 92%, which is 0.3% higher than other algorithms. The recall rate and F1 value reached 68.9% and 78.9%, respectively, which were about 10% higher than other algorithms.Figure 7
Analysis of segmentation results of three algorithms.The experimental results were statistically analyzed using the methods in this paper. Figure8 shows the statistical results of the edge images (T is the threshold considered appropriate) in which A denotes the number of edge points, B denotes the number of quad-connected pixels, and C denotes the number of pixels put into eight connections. The results of the numerical analysis were compared by calculating the ratios C/A and C/B. For any edge image, the ratio of C/A to C/B is smaller when its edge lines are better connected. In other words, the smaller the value of A, the stronger the continuity of the binary edge image obtained by the algorithm, and the smaller the value of B, the better the one-sided response of the algorithm. According to the statistical data, the improvement of the algorithm in this paper is obvious, the continuity is strong, and the unilateral response is better.Figure 8
Statistical results of edge images.Based on the traditional median filtering, the image is subdivided into edge detail points, isolated noise points, and flat areas based on the human eye’s visual perception of different areas of the image, using the correlation between the pixels around the noise points to extract determination rules and filtering the image separately for different parts of the noise characteristics combined with visual requirements. This approach avoids the bias in the detection of signal points on the one hand and improves the efficiency of the algorithm detection compared with the algorithm of global processing on the other hand. The proposed smoothing noise is applied to Laplace sharpening as a basis to form a new edge detection algorithm, the algorithm is applied to a wide range of segmentation datasets, and the detection results show good performance in both visual observation and evaluation of objective metrics.


## 4.1. Image Texture Analysis

To test the recognition ability of the features extracted by our method, we conducted test experiments on set 1, set 2, set 3, set 4, set 5, and set 6. Meanwhile, we used LRS-MD, PMC-BC, CLBP, MLEP, Cov-LBPD, and scLBP to compare with our anisotropic diffusion equation features. The ACAR of the results of the experiment is shown in Figure3. From Figure 3, it can be seen that our method slightly outperforms the other comparison methods when the images are not rotated, and the standard deviation of our method is lower than that of the other comparison methods. In addition, we also give the ACARS of the SDMV feature and the FV feature of the texture image, where these two features are represented by the anisotropic diffusion equation-SDMV and the anisotropic diffusion equation-FV. The ACARS of these two independent features illustrates that the combination of both can achieve better classification results.Figure 3
Comparison results of recognition experiments.To further test the performance of our proposed anisotropic diffusion equation feature in processing rotated images, we conducted test experiments on set 1, set 2, set 3, set 4, set 5, and set 6, respectively. The ACARS of the experimental results of our method and the comparison method is shown in Figure4. It is clear from Figure 4 that the ACAR of our method outperforms the six comparison methods. Our method obtains the best experimental results on set 1, set 2, set 3, set 4, set 5, and set 6. Moreover, the standard deviation of our method is smaller than the other six comparison methods, except that the standard deviation of the CLBP method is lower than our method on set 4 and set 5. The results of image texture classification experiments demonstrate that the rotation-invariant property has been included in our extracted anisotropic diffusion equation image texture features, and such a combination of features improves the recognition ability based on transform domain features.Figure 4
Performance experimental comparison results.Combining the results in Figures3 and 4, we can see that our method yields good classification results with and without image rotation. This further proves that rotation invariance is included in our extracted features.To further extensively test the performance of our extracted image texture features for rotated image classification, we further conduct test experiments for rotation invariance on two more complex image texture datasets, TIPS2 and OUTEX. The experimental results of our method and the comparison method are shown in Figure5. As can be seen from Figure 5, our method slightly outperforms the other comparison methods on both challenging texture sets. Thus, the results of these experiments further demonstrate the robustness of our texture feature construction method in processing rotated images. The results of the whole image texture classification comparison experiments on the TIPS2 and OUTEX databases show that our method can handle rotated images well and can obtain satisfactory classification performance.Figure 5
Results of rotational invariance tests.Based on the introduction of the anisotropic diffusion equation image texture feature representation method, it can be seen that this feature representation method effectively combines the advantages of the rotational invariance of the null domain method and the advantages of the transform domain method that can perform directional multiscale analysis, and it can be said that this method is an effective combination of the null domain method and the transform domain method. At the same time, the advantages of the two methods complement each other, thus improving the classification performance of the constructed features. The value of this texture feature construction method is that it introduces the idea of rotation invariance into the transform domain-based method. However, the dimensionality of the features constructed by this method is high, and therefore, feature dimensionality reduction is required.


## 4.2. Edge Detection Analysis

The quantitative analysis of the experiments in this section still utilizes the mean square error MSE and peak signal-to-noise ratio PSNR as evaluation metrics. Since noise as blood vessels around the tissue is the main factor affecting the detection results in the mass images, the superiority of the algorithm can be judged by the amount of noise content in the results. The results are shown in Figure6. From Figure 6, it can be seen that the mean square error of the method in this paper is smaller compared to the other two algorithms, indicating that the noise content is less in the detection results of the method in this paper, and the corresponding value of the peak signal-to-noise ratio is larger. Combining the results of both subjective judgments and quantitative analyses illustrates the effectiveness of the algorithm in this paper. Using the edge detection method is one of the main methods for image segmentation, and the lumps can be filled next to complete the segmentation.Figure 6
Quantitative analysis results of the three algorithms.As can be seen in Figure7, compared with the lump segmentation results obtained by the other two methods, the lump region extracted using the algorithm proposed in this paper has significantly better results and higher segmentation accuracy after a comprehensive analysis of the three indicators. The algorithm uses the Canny edge breakpoint as the initial position of the ant, changes the traditional ant colony algorithm to directly use the gradient information as the heuristic information, but uses the fuzzy triangular affiliation function to calculate the fuzzy affiliation degree of the pixel points in the image as the heuristic information of the ant colony, and sets the search stopping condition, which makes the continuity of the image edge better and the lumps obtained after filling more complete. From the extraction results of relevant comparison experiments, it can be seen that compared with other algorithms, the extracted image edge contour information and the filled obtained lump segmentation image by the method in this paper are clearer, more complete, and more accurate than the adaptive Canny algorithm and the comparison algorithm methods. The accuracy of the algorithm in this paper is more than 92%, which is 0.3% higher than other algorithms. The recall rate and F1 value reached 68.9% and 78.9%, respectively, which were about 10% higher than other algorithms.Figure 7
Analysis of segmentation results of three algorithms.The experimental results were statistically analyzed using the methods in this paper. Figure8 shows the statistical results of the edge images (T is the threshold considered appropriate) in which A denotes the number of edge points, B denotes the number of quad-connected pixels, and C denotes the number of pixels put into eight connections. The results of the numerical analysis were compared by calculating the ratios C/A and C/B. For any edge image, the ratio of C/A to C/B is smaller when its edge lines are better connected. In other words, the smaller the value of A, the stronger the continuity of the binary edge image obtained by the algorithm, and the smaller the value of B, the better the one-sided response of the algorithm. According to the statistical data, the improvement of the algorithm in this paper is obvious, the continuity is strong, and the unilateral response is better.Figure 8
Statistical results of edge images.Based on the traditional median filtering, the image is subdivided into edge detail points, isolated noise points, and flat areas based on the human eye’s visual perception of different areas of the image, using the correlation between the pixels around the noise points to extract determination rules and filtering the image separately for different parts of the noise characteristics combined with visual requirements. This approach avoids the bias in the detection of signal points on the one hand and improves the efficiency of the algorithm detection compared with the algorithm of global processing on the other hand. The proposed smoothing noise is applied to Laplace sharpening as a basis to form a new edge detection algorithm, the algorithm is applied to a wide range of segmentation datasets, and the detection results show good performance in both visual observation and evaluation of objective metrics.


## 5. Conclusion

In this paper, a class of hybrid diffusion equation models based on thermal equation diffusion and median curvature diffusion is proposed by combining the characteristics of different noises and the features of noisy images. The equation behaves as anisotropic diffusion at the near boundary of the image; thus, the equation is close to the median curvature diffusion equation, which can protect the boundary well, while it behaves as isotropic diffusion in the smooth region of the image; thus, the equation is close to the heat conduction equation, which can denoise effectively. To define the diffusion tensor, the image is viewed as a three-dimensional Riemann manifold, a view that, although it requires a fresh look at various aspects of the concept, the geometric properties of the tensor and the final computational results obtained concretely show that using anisotropic diffusion works much better than other classical methods. Defining the anisotropic diffusion tensor in terms of the above concepts satisfies all the necessary preconditions and next provides its eigenvalues and eigenvector calculations to construct the basis for numerical experiments. The next term proves the existence of a unique solution to the diffusion problem, which results in a generalization of the one-dimensional similarity problem. In addition, using partial differential analysis, the smoothness and continuous dependence of the solution on the additive noise image property are proved. The filtering convergence to the solution property is also shown not only experimentally but also theoretically. The last item proves that the weak comparison principle holds. The theory of this item is more complicated, and it is the basis for protecting the convergence of the solution and also the uniqueness of the weak solution, but the reader interested in the application does not need to look at it carefully. For the phenomenon that the ant colony in the algorithm is affected by pheromone and heuristic information at different stages to different degrees, the two sensitive factors are dynamically adjusted. For the ant colony in the search is susceptible to the influence of the local optimal solution, the maximum and minimum pheromone values are set to suppress the continuous accumulation of pheromone of noisy pixel points; in selecting the threshold value to determine the edge point according to the amount of pheromone of pixel points, the maximum variance method between classes is used to calculate the thresholds. By applying the improved algorithm to natural images and combining subjective judgment with quantitative analysis, the effectiveness of the improved method in this paper can be proved.



---

*Source: 9910882-2021-10-04.xml*