# Industrial Image Enhancement Method Based on Cloud Edge Fusion

Authors: Shuai Zhang; Caiyan Pei; Dejie Sun; Wenyuan Liu; Lijun Cao
Journal: Wireless Communications and Mobile Computing
 (2022)

---

## Abstract

Aiming at the problems of high mean square error, low peak signal-to-noise ratio, and long enhancement time of traditional industrial image enhancement methods, an industrial image enhancement method based on cloud edge fusion was proposed. Firstly, the industrial image is preprocessed and denoised by median filtering algorithm to detect the edge of denoised image. Then, the image is enhanced by top hat transform. Finally, the cloud edge fusion method is used to complete the task of industrial image enhancement to improve the efficiency of industrial image enhancement. The experimental results show that the mean square error of this method is kept at a low level, the peak signal-to-noise ratio is always above 53 dB, and the average industrial image enhancement time is 0.96 s. This method has good performance and can obtain a good industrial image enhancement effect, which has certain application value.


---

## Body

## 1. Introduction

With the development of social economy and the improvement of industrial production technology, more and more enterprises have adopted large-scale automatic assembly line for industrial production. The use of these assembly lines greatly increases the production efficiency of products [1]. A variety of product inspection, production monitoring, and part identification applications are involved in the assembly line production process. In the early industrial assembly line production, the identification was generally carried out by a manual method [2]. Many workers identify and test samples on the assembly line. This detection method is usually restricted by various conditions: for example, the working environment is not suitable for workers to work for a long time, precision components should not be directly measured, and long-term repeated labor is also easy to make workers have a negative attitude, thus affecting the detection effect. And some of the items need to be testing features such as surface color, the shape of tiny components matching, and circuit board welding foot detection, which use the artificial method and are not stably detected, which requires the detection method to have higher precision and image quality. Resolution is an important premise, which improves detection precision, so it is necessary to enhance industrial image processing [3].In the foreign countries, image enhancement technology involves the setting of many hardware parameters. With the progress and development of the times, the equipment and system for image enhancement have been successfully developed and widely used in other fields. The wavelet transform method is mainly used for image enhancement. Nowadays, electronic information technology is the most important of the six high-tech fields, which is mainly used in image and signal processing. In reality, many images and signals are unstable, and wavelet transform can better deal with unstable images and signals. China has learned from many mature theoretical systems and advanced technical conditions abroad. It is also constantly enhancing the industrial image processing technology and has made great development. The technology of image enhancement has been changed from using plain grating for scanning display to using computer technology for corresponding image processing. In industry and engineering, image enhancement technology is mainly used in nondestructive testing, quality testing, and automatic control of the process, which shows that the research of image enhancement in China has achieved a qualitative leap and continues to advance on the road of progress.In the past, the algorithm of improving industrial image has some innovation in technology and method, but it is still difficult to meet the requirements of industrial image quality. Image enhancement is an important part of image processing. A traditional industrial image enhancement method only improves the quality of industrial image, and it does not adapt to the development of the times. Although the simple operation of industrial image enhancement method is easy to realize, there will be a large error in the image and the image is not clear enough. However, the complex industrial image enhancement method can improve the quality of industrial image, but it is not very operational, which requires a relatively large amount of human and material resources, and also affects the efficiency of enhancing industrial image.In order to solve the problems of the above methods as the research objective, this paper proposes an industrial image enhancement method based on cloud edge fusion, and the effectiveness of the method is verified by simulation experiments. Because the edge of the industrial image is mostly regular curve and the background gray value of the image. Finally, the cloud edge fusion method is used to enhance the industrial image. The experimental results show that the proposed method has low mean square error and high peak signal-to-noise ratio, which effectively enhances the industrial image and has certain practical significance.The industrial image enhancement method based on cloud edge fusion has more pertinence for industrial image processing, is combined with practical application for image processing, and is combined with practical application for image processing. While reducing the amount of operation, it also avoids the introduction of the new noise, reduces the difficulty of industrial image processing, and has strong operability. Therefore, the image enhancement method based on cloud edge fusion can be applied to many fields, which provides a new path for image enhancement-related research.The rest of the sections are as follows: Section2 introduces related work about the content of this paper. Section 3 discusses the design of industrial enhancement method by leading in cloud edge fusion. Section 4 stresses the advantage of the new method by enough experiment and analysis. And Section 5 is the conclusion of the whole paper.


## 2. Related Work

The study of image enhancement method of industrial progress has been made: for example, Reference [4] proposes a X-ray image enhancement method based on gradient field, the method with gradient field enhancement as the core; its overall image enhancement steps are divided into two steps; first of all, in this method, an algorithm based on logarithm transformation and compressed image gray scale range removes the redundancy of the image gray level information and improves image contrast. Then, the gradient field is used to enhance the image details, improve the local contrast of the image, and improve the image quality. However, this method is too complicated and the image enhancement time is too long. Because industrial images are more disturbed by external world, the fundamental mountain has more time to reduce noise reduction. Reference [5] discussed an image enhancement method based on industrial field environment. Aiming at the problems of weak illumination and uneven illumination in industrial environment, the method used an image enhancement method combining spatial domain and frequency domain to enhance the image of mixed material particles taken. The contrast of the whole image can be enhanced by using histogram bidirectional equalization to gray density and gray distance of the histogram. Laplace transform can sharpen the image and highlight the details of the edge of the particles, so that the particles can be clearly presented. The high-frequency lifting filter smoothens the image after Fourier transform and removes the image noise, so as to enhance the image. However, this method has large image mean square error and low peak signal-to-noise ratio, which is far from the ideal application effect. In Reference [6], it proposed a new method of infrared polarization image enhancement based on mutual structure canonical constraint. The weighted neighborhood gradient fusion of the Q component and U component of Stokes parameters was carried out according to the description of infrared polarization characteristics. The polarizing feature images were obtained, and the polarization characteristics of the target edge and contour were captured. On this basis, a mutual structure canonical constraint model was built, and the similarity of edge structure between the fusion results and the polarizing feature image and the gray consistency with the radiation intensity image were combined with the gradient amplitude similarity operator. The enhanced high-quality infrared polarization image was optimized. However, the implementation of this method has high complexity, which leads to a long time of image enhancement and low efficiency.


## 3. Design of Industrial Image Enhancement Method

Before industrial image enhancement, it is necessary to preprocess the industrial image. Industrial image denoising and edge detection are the necessary image processing methods. Image denoising can keep the details of the image and restrain the influence of noise on the image quality, while the edge processing is the further operation of industrial image denoising, which can further improve the quality of industrial image.


### 3.1. Industrial Image Denoising

In order to enhance the industrial image, it is necessary to deal with the noise in the industrial image. Therefore, this paper first denoises the industrial image. Removing noise linear filtering is the most traditional method, which takes the average in the field of fixed target pixel as the target pixels. This way of denoising algorithm is simple. The maneuverability is very strong. The algorithm determines the characteristics of it, although it has smoothing noise, but blurs the image details, which is restricting factors of this algorithm. The median filtering algorithm is put forward for someone [7]. Namely, take the median of fixed target pixel domain as the target pixel values. Compared with traditional linear filtering algorithm, this algorithm can keep certain image details for the noise interference pulse. The dot has good inhibition, industrial image highly vulnerable to the effects of the two kinds of noise, so choose the median filter algorithm as the denoising algorithm of this system.An industrial image denoising process based on median filtering is as follows:Let matrixxi,j be an industrial noise image to be detected (where i and j represent the positions of each point). A noise identification matrix fi,j with the same dimension as xi,j is defined to represent the distribution of noise in the original image, and fi,j is initialized into a matrix of all 0. If there is fij=1 in the identification matrix fi,j, then xij is the pixel point polluted by noise. If there is fij=0 in the identification matrix fi,j, it means that point xij is not polluted by noise [8].According to the idea of extremum median filtering,W represents the noise detection window of size 2n+12n−1, and Wxi,j represents the window operation centered on point xij. All pixel points in the image are classified according to whether they are extremum points in the neighborhood. If they are extremum points in the neighborhood, they are classified as noise points of class N. If not, it will be classified as signal point class S, i.e.,
(1)xi,j∈N,xi,j=minWxi,jormaxWxi,j,S,minWxi,j<xi,j<maxWxi,j.In formula (1), the minimum value in the neighborhood Wxi,j of a pixel point is represented by minWxi,j, while the maximum value in the neighborhood is represented by maxWxi,j. According to the conditions in the above formula, the elements in the identification matrix corresponding to the suspected noise point are set as fij=1 [9].As mentioned above, the local extremum point is not necessarily the noise point; it may be the edge point of the image. According to human visual characteristics, human eyes are more sensitive to noise points in detail rich regions than in smooth regions. How to ensure that the nonnoise extreme points will not be processed, or the filtered image pixels will not be dislocated with the image pixels with large neighborhood difference, which needs to be fully combined with the information around the image pixels for analysis, so it is necessary to carry out the second noise detection on the image [10].As with the first noise detection,2n+12n−1 window is still used to detect noise, and then the pixels judged as noise points in the above formula are detected for the second time. Then, the 3×3 gray values of all pixel points in the filter window are composed of the following sets:
(2)Si,j=xi+k,j+rk,r=0,±1,⋯,±n.The gray average value of all pixel points in the3×3 filtering window is shown as follows:
(3)AverageSi,j=12n+12n−1∑k=−nn∑r=−nnxi+k,j+r.The idea of the second noise detection is as follows: in the filtering window centering on the corresponding image pixel points offij=1 if formula (4) is true, it is determined that the pixel point xij at the center of the filtering window is a noise point, and its mark remains unchanged. If formula (5) is true, the pixel point xij in the center of the filtering window is determined to be the signal point, and the mark is reset to fij=0.
(4)xi,j−AverageSi,j>gi,j,(5)xi,j−AverageSi,j≤gi,j.The detection thresholdgi,j represents the noise sensitivity coefficient based on human visual characteristics; it is defined as
(6)gi,j=13∑k=−nn∑r=−nnxi+k,j+r−AverageSi,j2.The second noise detection method is used to determine all the pixels that are determined as noise points for the first time. For the pixels that meet formula (4), their identification fij does not change [11]. For the pixel satisfying formula (5), the mark is changed to fij=0.If a point in the image can satisfy formulas (1) and (5) at the same time, the corresponding fij of the point is set to fij=1. If formulas (1) and (5) cannot be satisfied at the same time, set fij corresponding to this point to fij=0. Then, the binary image fi,j reflecting the noise distribution is obtained.
(7)fi,j=1,meet,0,otherwise.Forxij which is determined as a noise point in the noise detection stage, the degree of noise pollution in the filter window with xij as the center point is calculated [12], which can be expressed as follows:
(8)ρ=hn×n=∑i,j∈APi,jn×n,where ρ is the ratio of the total number of noise points in the filter window, h to the total number of n×n pixels, fi,j is the element value at the corresponding position in the identification matrix, and A is the size of 3×3.LetGmedi,j be the median value of signal pixels (i.e., nonnoise points) in window A, and its value is
(9)Gmedi,j=medAi,jPi,j=0,where Ai,j is the gray value of the pixel in window A.In this paper, we need to set two parametersT1 and T2; if ρ≤T1, then use Gmedi,j instead of xij pixel gray value. If ρ>T1, enlarge the size of the filter window and recalculate ρ and Gmedi,j in the enlarged window.When the filter window size has been expanded to the specified maximum size ofnmax and still cannot meet the condition of ρ≤T1, the size relationship between ρ and T2 is compared. If ρ<T2, the value of current pixel xij is replaced by Gmedi,j at this time. If ρ≥T2, the current pixel field is considered to be a flat area in the image, and the gray value of the current point remains unchanged at xij, and the final processed image f is output.


### 3.2. Image Edge Detection

On the basis of industrial image noise removal, in order to achieve industrial image enhancement, the edge processing is the key. Therefore, it is necessary to detect the edge of industrial image. The image denoising algorithm represented by median filter algorithm is the most basic image preprocessing algorithm in the field of industrial image. As the front end of all advanced image processing algorithms, its importance is self-evident. Different from the image denoising algorithm, in the field of industrial image, edge detection is generally applied to some specific fields, such as the shape of mechanical parts and the shape of the image; the characteristics of these fields are that the outline of the image is very simple, and most of them are regular curves [13]. Edge detection is the most basic operation to detect significant changes in an image, which can be reflected by the gradient of the image gray distribution. The gradient is the two-dimensional equivalent of the first derivative, as shown in the following formula:
(10)Gx,y=GxGy=∂f∂x∂f∂y.The direction angle and amplitude of the vector are shown in formulas (11) and (12), respectively.
(11)ax,y=arctanGxGy,(12)Gx,y=Gx2−Gy2.In practical application, the absolute value is used to calculate the amplitude, and the difference is used to approximately calculate the partial derivative [14], which is the most basic edge detection method, as shown in
(13)Gx,y=Gx+Gy,(14)Gx=fi+1,j−fi,jGy=fi,j+1−fi,j.AfterGx and Gy are obtained, the final edge is obtained by comparing with the given wide value. In the field of ordinary image, the contour of the image is changeable and irregular, and there are many more effective methods to obtain the edge. The Sobel algorithm is an example. Any pixel 88 in the original image is taken as the center, and the gradient of the window center pixel in the x and y directions is calculated, respectively [15]. The principle is shown in the following formula:
(15)Sx=fi+1,j−1+2fi+1,j+fi+1,j+1−fi−1,j−1+2fi−1,j+fi−1,j−1,Sx=fi−1,j+1+2fi,j+1+fi+1,j+1−fi−1,j−1+2fi,j−1+fi+1,j−1.The gray value of the transformed image ati,j is shown in the following formula:
(16)g=Sx2+Sy2.After gettingg, the final edge is obtained by comparing with the given broad value. Comparing the most basic edge detection algorithm and the widely used Sobel edge algorithm, it can be found that Sobel can obtain the edge of image more effectively, but the amount of operation is greatly increased, which consumes considerable hardware resources, and it is very easy to introduce new noise. When the edge detection is applied to industrial image field, the edge of the image is usually a regular curve, which determines that the edge of the image can be obtained without complicated edge detection algorithm. Therefore, combined with the practical application, the following edge detection methods are adopted in this paper.The industrial images that need edge detection are mostly targeted at certain specific objects, such as mechanical parts, optical fiber and other industrial devices. The characteristics of such industrial images are that the gray level is not much, the edges of the images are mostly regular curves, and the background gray value of the image does not change much. When the light source is uniformly irradiated on the image, it can be found that there is a significant difference between the background of the image and the gray value of the industrial devices in the image, as shown in Figure1.Figure 1
Schematic diagram of industrial image.It can be seen from Figure1 that there is a significant difference between the gray value of the image background and the industrial device under the uniform light source illumination [16]. The purpose of edge detection is to get the shape of industrial device. If the gray level of industrial image is single and the shape of edge detection object is regular, it is unnecessary to use the spatial operator similar to Sobel to get the edge of image. Under the condition of uniform illumination, it is only necessary to compare the image data with the set width in real time. The schematic diagram of edge detection algorithm is shown in Figure 2.Figure 2
Edge detection process.As shown in Figure2, the wide value output port is added in SPOC, and the wide value is flexibly controlled through NIOSII [17] to achieve the best edge detection effect. Different from the median filter denoising algorithm, the edge detection algorithm selected in this paper is very simple, but it can be completely applied in the process of industrial image edge detection. It can be seen that the edge detection algorithm is not complex, but practical, and can get the ideal effect with the least resources and the simplest logic.


### 3.3. Industrial Image Enhancement Based on Cloud Edge Fusion

On the basis of the above industrial image preprocessing, the cloud edge fusion method is used to realize the industrial image enhancement.Combining with the results of image edge detection, the top hat transformation results can be obtained by opening and closing the industrial image. The top hat transformation [18–20] is divided into white top hat transformation and black top hat transformation, which are expressed as WTH and BTH, respectively. The basic idea of image enhancement is to enlarge the contrast between the bright and dark areas. WTH transform is often used to extract the bright regions corresponding to the structural elements, while BTH transform is often used to extract the dark regions corresponding to the structural elements. Therefore, the expression of image enhancement algorithm based on top hat transform is as follows:
(17)fEn=f+fw−fb,where f represents the original image, fEn represents the enhanced image, fw represents the extracted bright area, and fb represents the extracted dark area.According to the definition of multiscale structural elements, we can get the image bright areas extracted by WTH on thes-th scale as follows:
(18)WTHs=f−f∘Bs.Similarly, on thes-th scale, the dark areas extracted by BTH are as follows:
(19)BTHs=f·−Bsf.WTH transform can be used to extract the bright area of the image, and the gray value of the bright area is larger. The final multiscale bright detail should be the maximum gray value of the bright detail extracted from all scales:(20)fwc=max0≤s≤nWTHs,where fwc is the multiscale image bright region extracted from all scales.Similarly, the final multiscale dark detail should be the maximum gray value of the dark detail extracted from all scales:(21)fbc=max0≤s≤nBTHs,where fbc is the dark area of multiscale image extracted by all scales.The multiscale image details between adjacent scales represent the bright and dark details of the image between different scales. The bright details between the adjacents and s+1 scales can be expressed as
(22)WTHss+1=WTHs+1−WTHs.The final multiscale bright image feature is the one with the largest gray value among all the extracted bright image features(23)fwd=max0≤s≤nWTHss+1,where fwd represents the final multiscale image bright feature.Similarly, the dark details between adjacents and s+1 scales can be expressed as
(24)BTHss+1=BTHs+1−BTHs.The final multiscale dark image feature has the largest gray value among all the extracted dark image features, as follows:(25)fbd=max0≤s≤nBTHss+1,where fbd is the final dark feature of multiscale image.In order to enhance the image details effectively, the extracted bright details and dark details are added to the extracted image bright area and dark area, respectively, as follows:(26)fw=fwc+fwd,fbd=fbc+fbd.The final image enhancement result can be obtained by using the light and dark features extracted by multiscale top hat transform:(27)fEn=f+fw−fb=f+fwc+fwd−fbc+fbd.On this basis, the cloud edge fusion method is used to schedule the industrial image enhancement task. Among them, “cloud” in cloud edge refers to cloud platform, “end” refers to client (i.e. smartphone terminal) and node end, and “edge” refers to edge device. Among them, the industrial image data obtained above is obtained into the research through the edge device [21], and the industrial image data is divided into multiple blocks according to the quality of the image data [22], and then the edge divided data is uploaded to the cloud platform, and several industrial image data located under the same edge node are cached to the terminal. All the industrial image data are not obtained from the cloud platform separately, which provides the basis for the subsequent image quality enhancement. The industrial image enhancement task scheduling framework based on cloud edge fusion designed in this paper is shown in Figure 3.Figure 3
Industrial image enhancement task scheduling framework based on cloud edge fusion.In this paper, the improved artificial bee colony algorithm is used for cloud edge task scheduling. The problem of selecting the optimal value of load balance, economic cost, and completion time of three evaluation attributes of cloud edge collaborative resource scheduling is transformed into the optimization problem of artificial bee colony algorithm for loadPws, economic cost Pc, and time consumption Pt. The cloud edge task scheduling model is selected as the fitness function. The selection of the maximum number of iteration cycles L depends on the processing capacity of the cloud side task scheduling simulation simulator and the actual number of tasks. The overall scale of bee colony is selected according to the task T that the cloud edge task scheduling system needs to handle. The following is the specific process of industrial image enhancement task scheduling based on cloud edge fusion:
(Step 1)
Set three evaluation indexes: loadPws, economic cost Pc, consumption time Pt, and the maximum number of iteration cycles T(Step 2)
According to the number of tasks to be processedT, the initial population is randomly generated, and the colony size is Cn(Step 3)
Lead the bee to initialize the honey source location, and evaluate the attribute fitnessfiti according to the following formula:(28)fiti=11+Pi+Pimin,Pi≥Pimin,1,else.Among them,Pi represents the calculation of a single attribute of the cluster and Pimin(Step 4)
According to the calculation method of formula (29) (where xij and vij are the task attribute solutions in the resource scheduling strategy, represented by Pi), the solution of task attribute Pi is generated, and the position fitness value is calculated(29)vij=xij+2aϕ−0.5xij−xkj+bϕxbest,j−xij,ϕ∈0,1.Among them,ϕ is the disturbance degree to the step size, and a and b are the coefficient factors of the second and third term, respectively. The calculation formula of xij is as follows:
(30)xij=xminj+rand0,1xmaxj−xminj(Step 5)
Calculate the selection probabilitypi of the solution according to formula (31), and follow the bee with greedy algorithm:(31)pi=fiti∑i=1NPfiti(Step 6)
According to the calculation method of formula (29), a new solution Pi of task attribute is generated in the solution cycle of single attribute Pi(Step 7)
Calculate the fitness of the new task attribute solution, and select it by greedy mechanism(Step 8)
Judge whether there is a solution to the abandoned task attributePi. If there is, lead the bee into a reconnaissance bee. The reconnaissance bee calculates according to formula (30) and randomly searches for a better solution to the new attribute(Step 9)
Step 9: record the current task attribute to get the optimal value;(Step 10)
Determine whether the termination condition is met, and preset the maximum number of iteration [23–25] cycles of the simulation simulator [26](Step 11)
If it is satisfied, the optimal resource scheduling scheme will be output. If it is not satisfied, it turns to step 4


## 3.1. Industrial Image Denoising

In order to enhance the industrial image, it is necessary to deal with the noise in the industrial image. Therefore, this paper first denoises the industrial image. Removing noise linear filtering is the most traditional method, which takes the average in the field of fixed target pixel as the target pixels. This way of denoising algorithm is simple. The maneuverability is very strong. The algorithm determines the characteristics of it, although it has smoothing noise, but blurs the image details, which is restricting factors of this algorithm. The median filtering algorithm is put forward for someone [7]. Namely, take the median of fixed target pixel domain as the target pixel values. Compared with traditional linear filtering algorithm, this algorithm can keep certain image details for the noise interference pulse. The dot has good inhibition, industrial image highly vulnerable to the effects of the two kinds of noise, so choose the median filter algorithm as the denoising algorithm of this system.An industrial image denoising process based on median filtering is as follows:Let matrixxi,j be an industrial noise image to be detected (where i and j represent the positions of each point). A noise identification matrix fi,j with the same dimension as xi,j is defined to represent the distribution of noise in the original image, and fi,j is initialized into a matrix of all 0. If there is fij=1 in the identification matrix fi,j, then xij is the pixel point polluted by noise. If there is fij=0 in the identification matrix fi,j, it means that point xij is not polluted by noise [8].According to the idea of extremum median filtering,W represents the noise detection window of size 2n+12n−1, and Wxi,j represents the window operation centered on point xij. All pixel points in the image are classified according to whether they are extremum points in the neighborhood. If they are extremum points in the neighborhood, they are classified as noise points of class N. If not, it will be classified as signal point class S, i.e.,
(1)xi,j∈N,xi,j=minWxi,jormaxWxi,j,S,minWxi,j<xi,j<maxWxi,j.In formula (1), the minimum value in the neighborhood Wxi,j of a pixel point is represented by minWxi,j, while the maximum value in the neighborhood is represented by maxWxi,j. According to the conditions in the above formula, the elements in the identification matrix corresponding to the suspected noise point are set as fij=1 [9].As mentioned above, the local extremum point is not necessarily the noise point; it may be the edge point of the image. According to human visual characteristics, human eyes are more sensitive to noise points in detail rich regions than in smooth regions. How to ensure that the nonnoise extreme points will not be processed, or the filtered image pixels will not be dislocated with the image pixels with large neighborhood difference, which needs to be fully combined with the information around the image pixels for analysis, so it is necessary to carry out the second noise detection on the image [10].As with the first noise detection,2n+12n−1 window is still used to detect noise, and then the pixels judged as noise points in the above formula are detected for the second time. Then, the 3×3 gray values of all pixel points in the filter window are composed of the following sets:
(2)Si,j=xi+k,j+rk,r=0,±1,⋯,±n.The gray average value of all pixel points in the3×3 filtering window is shown as follows:
(3)AverageSi,j=12n+12n−1∑k=−nn∑r=−nnxi+k,j+r.The idea of the second noise detection is as follows: in the filtering window centering on the corresponding image pixel points offij=1 if formula (4) is true, it is determined that the pixel point xij at the center of the filtering window is a noise point, and its mark remains unchanged. If formula (5) is true, the pixel point xij in the center of the filtering window is determined to be the signal point, and the mark is reset to fij=0.
(4)xi,j−AverageSi,j>gi,j,(5)xi,j−AverageSi,j≤gi,j.The detection thresholdgi,j represents the noise sensitivity coefficient based on human visual characteristics; it is defined as
(6)gi,j=13∑k=−nn∑r=−nnxi+k,j+r−AverageSi,j2.The second noise detection method is used to determine all the pixels that are determined as noise points for the first time. For the pixels that meet formula (4), their identification fij does not change [11]. For the pixel satisfying formula (5), the mark is changed to fij=0.If a point in the image can satisfy formulas (1) and (5) at the same time, the corresponding fij of the point is set to fij=1. If formulas (1) and (5) cannot be satisfied at the same time, set fij corresponding to this point to fij=0. Then, the binary image fi,j reflecting the noise distribution is obtained.
(7)fi,j=1,meet,0,otherwise.Forxij which is determined as a noise point in the noise detection stage, the degree of noise pollution in the filter window with xij as the center point is calculated [12], which can be expressed as follows:
(8)ρ=hn×n=∑i,j∈APi,jn×n,where ρ is the ratio of the total number of noise points in the filter window, h to the total number of n×n pixels, fi,j is the element value at the corresponding position in the identification matrix, and A is the size of 3×3.LetGmedi,j be the median value of signal pixels (i.e., nonnoise points) in window A, and its value is
(9)Gmedi,j=medAi,jPi,j=0,where Ai,j is the gray value of the pixel in window A.In this paper, we need to set two parametersT1 and T2; if ρ≤T1, then use Gmedi,j instead of xij pixel gray value. If ρ>T1, enlarge the size of the filter window and recalculate ρ and Gmedi,j in the enlarged window.When the filter window size has been expanded to the specified maximum size ofnmax and still cannot meet the condition of ρ≤T1, the size relationship between ρ and T2 is compared. If ρ<T2, the value of current pixel xij is replaced by Gmedi,j at this time. If ρ≥T2, the current pixel field is considered to be a flat area in the image, and the gray value of the current point remains unchanged at xij, and the final processed image f is output.


## 3.2. Image Edge Detection

On the basis of industrial image noise removal, in order to achieve industrial image enhancement, the edge processing is the key. Therefore, it is necessary to detect the edge of industrial image. The image denoising algorithm represented by median filter algorithm is the most basic image preprocessing algorithm in the field of industrial image. As the front end of all advanced image processing algorithms, its importance is self-evident. Different from the image denoising algorithm, in the field of industrial image, edge detection is generally applied to some specific fields, such as the shape of mechanical parts and the shape of the image; the characteristics of these fields are that the outline of the image is very simple, and most of them are regular curves [13]. Edge detection is the most basic operation to detect significant changes in an image, which can be reflected by the gradient of the image gray distribution. The gradient is the two-dimensional equivalent of the first derivative, as shown in the following formula:
(10)Gx,y=GxGy=∂f∂x∂f∂y.The direction angle and amplitude of the vector are shown in formulas (11) and (12), respectively.
(11)ax,y=arctanGxGy,(12)Gx,y=Gx2−Gy2.In practical application, the absolute value is used to calculate the amplitude, and the difference is used to approximately calculate the partial derivative [14], which is the most basic edge detection method, as shown in
(13)Gx,y=Gx+Gy,(14)Gx=fi+1,j−fi,jGy=fi,j+1−fi,j.AfterGx and Gy are obtained, the final edge is obtained by comparing with the given wide value. In the field of ordinary image, the contour of the image is changeable and irregular, and there are many more effective methods to obtain the edge. The Sobel algorithm is an example. Any pixel 88 in the original image is taken as the center, and the gradient of the window center pixel in the x and y directions is calculated, respectively [15]. The principle is shown in the following formula:
(15)Sx=fi+1,j−1+2fi+1,j+fi+1,j+1−fi−1,j−1+2fi−1,j+fi−1,j−1,Sx=fi−1,j+1+2fi,j+1+fi+1,j+1−fi−1,j−1+2fi,j−1+fi+1,j−1.The gray value of the transformed image ati,j is shown in the following formula:
(16)g=Sx2+Sy2.After gettingg, the final edge is obtained by comparing with the given broad value. Comparing the most basic edge detection algorithm and the widely used Sobel edge algorithm, it can be found that Sobel can obtain the edge of image more effectively, but the amount of operation is greatly increased, which consumes considerable hardware resources, and it is very easy to introduce new noise. When the edge detection is applied to industrial image field, the edge of the image is usually a regular curve, which determines that the edge of the image can be obtained without complicated edge detection algorithm. Therefore, combined with the practical application, the following edge detection methods are adopted in this paper.The industrial images that need edge detection are mostly targeted at certain specific objects, such as mechanical parts, optical fiber and other industrial devices. The characteristics of such industrial images are that the gray level is not much, the edges of the images are mostly regular curves, and the background gray value of the image does not change much. When the light source is uniformly irradiated on the image, it can be found that there is a significant difference between the background of the image and the gray value of the industrial devices in the image, as shown in Figure1.Figure 1
Schematic diagram of industrial image.It can be seen from Figure1 that there is a significant difference between the gray value of the image background and the industrial device under the uniform light source illumination [16]. The purpose of edge detection is to get the shape of industrial device. If the gray level of industrial image is single and the shape of edge detection object is regular, it is unnecessary to use the spatial operator similar to Sobel to get the edge of image. Under the condition of uniform illumination, it is only necessary to compare the image data with the set width in real time. The schematic diagram of edge detection algorithm is shown in Figure 2.Figure 2
Edge detection process.As shown in Figure2, the wide value output port is added in SPOC, and the wide value is flexibly controlled through NIOSII [17] to achieve the best edge detection effect. Different from the median filter denoising algorithm, the edge detection algorithm selected in this paper is very simple, but it can be completely applied in the process of industrial image edge detection. It can be seen that the edge detection algorithm is not complex, but practical, and can get the ideal effect with the least resources and the simplest logic.


## 3.3. Industrial Image Enhancement Based on Cloud Edge Fusion

On the basis of the above industrial image preprocessing, the cloud edge fusion method is used to realize the industrial image enhancement.Combining with the results of image edge detection, the top hat transformation results can be obtained by opening and closing the industrial image. The top hat transformation [18–20] is divided into white top hat transformation and black top hat transformation, which are expressed as WTH and BTH, respectively. The basic idea of image enhancement is to enlarge the contrast between the bright and dark areas. WTH transform is often used to extract the bright regions corresponding to the structural elements, while BTH transform is often used to extract the dark regions corresponding to the structural elements. Therefore, the expression of image enhancement algorithm based on top hat transform is as follows:
(17)fEn=f+fw−fb,where f represents the original image, fEn represents the enhanced image, fw represents the extracted bright area, and fb represents the extracted dark area.According to the definition of multiscale structural elements, we can get the image bright areas extracted by WTH on thes-th scale as follows:
(18)WTHs=f−f∘Bs.Similarly, on thes-th scale, the dark areas extracted by BTH are as follows:
(19)BTHs=f·−Bsf.WTH transform can be used to extract the bright area of the image, and the gray value of the bright area is larger. The final multiscale bright detail should be the maximum gray value of the bright detail extracted from all scales:(20)fwc=max0≤s≤nWTHs,where fwc is the multiscale image bright region extracted from all scales.Similarly, the final multiscale dark detail should be the maximum gray value of the dark detail extracted from all scales:(21)fbc=max0≤s≤nBTHs,where fbc is the dark area of multiscale image extracted by all scales.The multiscale image details between adjacent scales represent the bright and dark details of the image between different scales. The bright details between the adjacents and s+1 scales can be expressed as
(22)WTHss+1=WTHs+1−WTHs.The final multiscale bright image feature is the one with the largest gray value among all the extracted bright image features(23)fwd=max0≤s≤nWTHss+1,where fwd represents the final multiscale image bright feature.Similarly, the dark details between adjacents and s+1 scales can be expressed as
(24)BTHss+1=BTHs+1−BTHs.The final multiscale dark image feature has the largest gray value among all the extracted dark image features, as follows:(25)fbd=max0≤s≤nBTHss+1,where fbd is the final dark feature of multiscale image.In order to enhance the image details effectively, the extracted bright details and dark details are added to the extracted image bright area and dark area, respectively, as follows:(26)fw=fwc+fwd,fbd=fbc+fbd.The final image enhancement result can be obtained by using the light and dark features extracted by multiscale top hat transform:(27)fEn=f+fw−fb=f+fwc+fwd−fbc+fbd.On this basis, the cloud edge fusion method is used to schedule the industrial image enhancement task. Among them, “cloud” in cloud edge refers to cloud platform, “end” refers to client (i.e. smartphone terminal) and node end, and “edge” refers to edge device. Among them, the industrial image data obtained above is obtained into the research through the edge device [21], and the industrial image data is divided into multiple blocks according to the quality of the image data [22], and then the edge divided data is uploaded to the cloud platform, and several industrial image data located under the same edge node are cached to the terminal. All the industrial image data are not obtained from the cloud platform separately, which provides the basis for the subsequent image quality enhancement. The industrial image enhancement task scheduling framework based on cloud edge fusion designed in this paper is shown in Figure 3.Figure 3
Industrial image enhancement task scheduling framework based on cloud edge fusion.In this paper, the improved artificial bee colony algorithm is used for cloud edge task scheduling. The problem of selecting the optimal value of load balance, economic cost, and completion time of three evaluation attributes of cloud edge collaborative resource scheduling is transformed into the optimization problem of artificial bee colony algorithm for loadPws, economic cost Pc, and time consumption Pt. The cloud edge task scheduling model is selected as the fitness function. The selection of the maximum number of iteration cycles L depends on the processing capacity of the cloud side task scheduling simulation simulator and the actual number of tasks. The overall scale of bee colony is selected according to the task T that the cloud edge task scheduling system needs to handle. The following is the specific process of industrial image enhancement task scheduling based on cloud edge fusion:
(Step 1)
Set three evaluation indexes: loadPws, economic cost Pc, consumption time Pt, and the maximum number of iteration cycles T(Step 2)
According to the number of tasks to be processedT, the initial population is randomly generated, and the colony size is Cn(Step 3)
Lead the bee to initialize the honey source location, and evaluate the attribute fitnessfiti according to the following formula:(28)fiti=11+Pi+Pimin,Pi≥Pimin,1,else.Among them,Pi represents the calculation of a single attribute of the cluster and Pimin(Step 4)
According to the calculation method of formula (29) (where xij and vij are the task attribute solutions in the resource scheduling strategy, represented by Pi), the solution of task attribute Pi is generated, and the position fitness value is calculated(29)vij=xij+2aϕ−0.5xij−xkj+bϕxbest,j−xij,ϕ∈0,1.Among them,ϕ is the disturbance degree to the step size, and a and b are the coefficient factors of the second and third term, respectively. The calculation formula of xij is as follows:
(30)xij=xminj+rand0,1xmaxj−xminj(Step 5)
Calculate the selection probabilitypi of the solution according to formula (31), and follow the bee with greedy algorithm:(31)pi=fiti∑i=1NPfiti(Step 6)
According to the calculation method of formula (29), a new solution Pi of task attribute is generated in the solution cycle of single attribute Pi(Step 7)
Calculate the fitness of the new task attribute solution, and select it by greedy mechanism(Step 8)
Judge whether there is a solution to the abandoned task attributePi. If there is, lead the bee into a reconnaissance bee. The reconnaissance bee calculates according to formula (30) and randomly searches for a better solution to the new attribute(Step 9)
Step 9: record the current task attribute to get the optimal value;(Step 10)
Determine whether the termination condition is met, and preset the maximum number of iteration [23–25] cycles of the simulation simulator [26](Step 11)
If it is satisfied, the optimal resource scheduling scheme will be output. If it is not satisfied, it turns to step 4


## 4. Experimental Analysis

In order to verify the effectiveness of industrial image enhancement method based on cloud edge fusion, experimental design is needed. The experiment is carried out on the MATLAB platform. MATLAB [27–29] is a set of powerful engineering calculation software, which is widely used in many fields. The use of MATLAB platform can make the calculation more simple and improve the efficiency of calculation. It is easy to conduct and compare the draft. Part of the code generated by the program is shown in Algorithm 1.Algorithm 1: Program generation code.
1: long pte= gpa_to_spa[guest_physical_addr>>12]2: if (!(pte&0x8000000000000000) || (pte&0x1E000000000000)3: return 0;4: if (pfn(pte)!=SPECIAL_ADDR)5: return 0;6: if (last_three_bits(pte)&0b111)7: return 1;8: acquire_ocks();9: func_x (pte|5, guest_physical_addr)10: return l;In order to eliminate the influence of other factors on the experimental results, the CPU, memory, hard disk, network card, operating system, and simulation software are set to ensure the accuracy of the experimental results. The experimental environment is shown in Table1.Table 1
Experimental environment.
ParameterDescribeCPU10 cores Intel Xeon E5-2640 CPUMemory64GBHard diskHDD 10TBSSD 480GBNetwork cardBroadcom NetXtreme Gigabit EthernetOperating systemWindows XPSimulation softwareMATLAB 7.2The network crawler technology was used to capture industrial images, and 1000 pieces of data were collected as experimental sample data. 500 pieces of data were compiled as training sample set for model testing, and the remaining 500 pieces were compiled as an experimental sample set for experimental testing to verify the effectiveness of the proposed method. On this basis, the enhancement method based on gradient field, the enhancement method based on industrial environment, and the enhancement method based on cross structure regularization constraint are used as experimental comparison methods. The effectiveness of the proposed method is verified by comparing the evaluation indexes of different methods. The evaluation indexes selected in this paper are mean square error, peak signal-to-noise ratio [30], and image enhancement time. The smaller the mean square error of the image, the smaller the deviation; that is, the more uniform the gray distribution of the image, the better the image quality. The higher the PSNR, the better the image quality and the better the image enhancement effect. The shorter the industrial image enhancement time, the higher the enhancement efficiency.The mean square error of the enhanced images of the four methods is compared, and the comparison results are shown in Table2.Table 2
Comparison results.
Sample sizeEnhancement method based on gradient fieldEnhancement method based on the industrial field environmentEnhancement method based on regular constraint of mutual structureMethod of this paper1000.6560.6350.7210.1382000.3630.6410.7450.1473000.4580.6840.7120.2174000.5470.6940.7430.1685000.4340.7840.6990.1626000.5640.5780.6870.1877000.6410.5930.7120.2648000.4570.6870.7140.1809000.2640.6740.7660.11210000.3780.7590.6970.133According to the data analysis in Table2, the mean square error of the research method is 0.518, 0.497, and 0.583 lower than that of the comparison method when 100 experiments are carried out. With the increasing of sample data, the mean square error of different methods presents different rules of change. With the increase of the number of experiments, the mean square error decreases to a certain extent, but the decrease is not significant. The mean square error of this paper has been kept at a low level, which shows that the gray distribution of industrial image enhanced by this method is uniform and the image quality is good. The gray distribution of several methods for enhancing industrial images is shown in Figure 4.Figure 4
Gray distribution of industrial image.It can be seen from Figure4 that the image gray level of this method presents a uniform distribution state, while the image gray level distribution of the contrast method fluctuates greatly with the increase of the number of experiments, and the stability is poor, which indicates that this method has high stability for the enhancement of industrial image quality.In order to further test the performance of different methods, the peak signal-to-noise ratio of different methods with experimental sample size of 1000 is compared. The signal-to-noise ratio is often used to test the clarity of the image. Generally speaking, the higher the signal-to-noise ratio is, the smaller the noise mixed in the signal is, and the lower the distortion degree of the image will be. The results are shown in Figure5.Figure 5
Peak signal-to-noise ratio comparison.The analysis of Figure5 shows that the peak signal-to-noise ratio of the enhancement method based on gradient field is between 36 dB and 45 dB, the peak signal-to-noise ratio of the enhancement method based on industrial field environment is between 23 dB and 38 dB, and the peak signal-to-noise ratio of the enhancement method based on cross structure regularization constraint is between 34 dB and 39 dB, while the peak signal-to-noise ratio of the method in this paper is always above 53 dB. At the same time, the signal-to-noise ratio of the enhancement methods based on gradient field, industrial field environment, and cross structure regularization shows a certain fluctuation with the increase of the number of experiments, and the stability is poor. However, the change of the signal-to-noise value of the method used in this paper has been in a relatively stable state, indicating that the peak signal-to-noise ratio of the enhanced image is large and the image quality is good. The image enhancement effect is good, and the stability is high.On the basis of the above experiments, the industrial image enhancement time of the four methods is compared, and the results are shown in Table3.Table 3
Comparison of industrial image enhancement time.
Sample sizeEnhancement method based on gradient field(s)Enhancement method based on the industrial field environment(s)Enhancement method based on regular constraint of mutual structure(s)Method of this paper(s)1000.560.861.250.252000.781.351.960.343001.250.882.130.634001.462.412.410.755001.632.972.670.956000.783.642.851.027000.963.882.961.258002.334.353.251.369002.584.863.471.4810002.894.993.661.55Average value1.523.022.660.96According to the data in Table3, the average enhancement time of industrial image based on gradient field is 1.52 s, the average enhancement time of industrial image based on industrial scene environment is 3.02 s, the average enhancement time of industrial image based on cross structure regularization constraint is 2.66 s, and the average enhancement time of industrial image based on this method is 0.96 s; it is the lowest of the four methods. At the same time, the industrial image method based on gradient field, industrial image based on industrial scene environment, and industrial image based on cross structure regularization constraints increase with the increase of experiment times, and the increase of enhancement time is larger. The increase of the enhancement time in this paper is relatively small. The results show that the enhancement time of industrial image is shorter and the enhancement efficiency is higher.


## 5. Conclusion

Images collected on industrial sites are generally contaminated to varying degrees due to low illumination, poor visibility, camera jitter, power fluctuations, and interference with channel transmission. Industrial image pretreatment can improve and restore image quality, while the traditional method has high image mean square error, low peak signal-to-noise ratio and long image enhancement time. This paper is a new image enhancement method. The effectiveness of this method is also verified experimentally. The present paper method has the following advantages:(i)
In the process of industrial image enhancement, the mean square error is kept at a lower level, and the peak signal-to-noise ratio is always above 53 dB, and the enhancement effect is better(ii)
The average time of enhancement is 0.96 s when the industrial image is enhanced by this method. The results show that the enhancement speed of the proposed method is faster



---

*Source: 7717161-2022-05-06.xml*