## 3 Design of Improved Multi-Structural Morphology Filtering Approach
### Weighted Morphological Filtering  
Weighted morphology or mathematical morphology consists of a set of morphological algebraic operations that simplify image data, maintain the basic shape properties of images, and remove extraneous structures for analysis and recognition purposes [40]. Morphological filtering uses nonlinear algebra tools to correct the signal by using the local characteristics of the signal; it can effectively filter out the noise in grayscale images [41]. According to the basic mathematical morphological operations, various transformation operators can be derived, such as the combination of expansion and corrosion, and morphological opening and closing operations can be derived. These morphological operations can be applied to analyze and process image-processing algorithms related to shape and structure, including image segmentation [42], feature extraction, edge detection, image filtering, etc. Let \(Y=f(x,y)\) represent the input image and \(g(x,y)\) represent the structural elements; then, corrosion and expansion can be defined as follows:  
\[(f\Theta g)(x,y)=min\{f(x-i,y-i)-g(-i,-j)\} \tag{14}\]  
\[(f\oplus g)(x,y)=max\{f(x-i,y-j)+g(-i,-j)\} \tag{15}\]  
Based on the principle of operation of corrosion and expansion, morphological opening and closing operations can be defined separately as follows:  
\[f\circ g=(f\Theta g)\oplus g \tag{16}\]  
\[f\cdot g=(f\oplus g)\Theta g \tag{17}\]  
The top-hat operation is also a classical spatial filtering algorithm derived from the basic operation of mathematical morphology, which is often used as a high-pass filtering operator for image preprocessing [43]. The operation has the effect of polishing the outer boundary of the image. It removes small protrusions of the contour and compares the original image with the morphological image to obtain the top-hat image, defined as follows:  
\[Top-hat(f)=f(x,\ y)-f\circ g(x,\ y) \tag{18}\]  
Since morphological filtering is related to the size of the structure, the size of the structure determines the effect of high-pass filtering [44]. When selecting a structure according to the structural characteristics of the target in the image, the smaller the size of the structure selected, the smaller the size of the target that can be preserved, and the better the low-frequency background filtering effect in the image. The minimum target size can be approximated using the structure, as follows:  
\[max\Big{(}S_{object}\Big{)}\leq\frac{1}{2}max(S_{structure}) \tag{19}\]  
where \(max\Big{(}S_{object}\Big{)}\) and \(max(S_{structure})\) represent the maximum 2D size of the smallest target in the image plane and the maximum 2D size of the structure used for morphological filtering, respectively. The background suppression algorithm uses the morphological operation results to estimate the background components and then subtracts them from the original image to obtain the target image without the background components [45]. However, when there are multiple targets in the image and the target size difference is large, the traditional morphological filtering of a single structural element will filter out the small targets at the same time as the low-frequency background. This process is shown in Figure 7.  
In order to avoid the shortcomings caused by the morphological filtering of a single structural element, this study considers the difference in the geometric characteristics of the target and the background; then, it adopts the weighted open operations of multiple structural elements [46]. Consider the input image \(Y\) represented in the following equation:  
\[Y=a*y\circ B_{1}(m_{1},\ n_{1})+(1-a)*Y\circ B_{2}(m_{2},\ n_{2}) \tag{20}\]  
where \(a\) is the weight coefficient, while \(B_{1}(m_{1},n_{1})\) and \(B_{2}(m_{2},n_{2})\) are the opening operations of different structures. The value of \(a\) can be adjusted according to the ratio of the information entropy of the filtered image to the information entropy of the original image. The selection of structural elements is the key to morphological filtering.