Image Edge Recognition of Virtual Reality Scene Based on Multi-Operator Dynamic Weight Detection

Image edge detection in virtual reality scenes is one of the most important technologies in the field of image processing and computer vision. It occupies an important position in the image processing system and is a key factor that affects the performance of the entire system. The quality of the algorithm directly affects the performance of the computer’s visual system. This paper briefly describes the basic theoretical methods of image edge detection. The basic theory and processing flow of image edge detection are analyzed, and several commonly used edge detection preprocessing methods and their basic principles are elaborated in detail. The existing traditional edge detection methods are briefly introduced, and the traditional edge detection methods are compared. This paper studies the adaptive multi-scale edge detection method based on Canny algorithm, and through theoretical analysis, compares the advantages and disadvantages of various algorithms in image edge detection. In the process of acquiring image edges, the local maximum value of the modulus is calculated along the gradient direction and the threshold is adaptively selected based on the image blocking principle. Comparing with the traditional modulus maximum edge detection method, this algorithm overcomes the contradiction that can suppress the interference of noise and obtain better edge detection effect to a certain extent. Experiments show that the method in this paper not only suppresses the interference of impulsive noise to the image edge detection, but also greatly reduces the possibility of false edges, and obtains a satisfactory accurate binary edge image.


I. INTRODUCTION
Image edge detection is an important content in image analysis. The edge mainly exists between the target and the target, the target and the background, or the area and the area. It is an important basis for image analysis such as image segmentation, shape characteristics, and texture characteristics [1]. The first step in image analysis and understanding The associate editor coordinating the review of this manuscript and approving it for publication was Zhihan Lv . operations is often edge detection. The edge is a reflection of the grayscale discontinuity of the image, which marks the end of one area and the beginning of another area and contains a lot of information (such as direction, step nature, shape, etc.) of the image [2], [3]. It is an important image feature in image recognition. Image edge detection is the process of detecting discontinuous points in the image function [4]. The execution efficiency of the algorithm and the detection accuracy of the discontinuous points are important criteria for judging the application of the algorithm in the field of VOLUME 8, 2020 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ computer vision [5]- [7]. The inaccuracy of the edge detection algorithm directly affects the application of target tracking and recognition in image sequences, and also affects the results of feature-based image processing techniques, such as stereo analysis, region segmentation, data encoding, image restoration, data hiding. The contour of the object is composed of the edge segments of the object [8]. However, in the process of object imaging, due to noise, projection, mixing, distortion and other factors that lead to the deformation and blurring of the image of the object, it is difficult to detect the edge. Therefore, it is necessary to construct a good measure of the edge of the image.
With the development of computer hardware technology, the resolution of the display is getting higher and higher, which will inevitably cause the reduction of the edge grayscale change band [9], [10]. The edges of the image are always generated in different scales, forming different edges, and this information is unknown before image processing. The traditional edge detection method does not have the function of automatic zoom, it is impossible to completely detect the true edge of the image and the traditional method has not established a set of qualitative standards for evaluating the advantages and disadvantages of an edge detection method [11]. With the development of image processing and the research and application of emerging technologies, many new edge detection operators have emerged [12]- [14]. Scholars point out that at different scales, the set of sharp changes in the grayscale of the image corresponds to the edge of the image [15]. This requires the use of multi-scale thinking when detecting image edges, and wavelet multi-resolution analysis of image signals is very suitable for extracting local features of signals, so wavelet is a powerful tool for image edge detection [16], [17]. Wavelet edge detection selects a larger scale to filter noise to identify edges, selects a smaller scale to achieve accurate positioning of edges, synthesizes edge images at different scales to obtain detection results [18]- [20]. The basic idea of morphological edge detection is to use structural elements with a certain shape to measure and extract the corresponding shape in the image to achieve the purpose of image analysis and recognition [21], [22]. The mathematical basis of mathematical morphology and the language used is set theory. The application of mathematical morphology can simplify image data, maintain their basic shape features, and remove irrelevant structures [23]. The algorithm of mathematical morphology has a natural parallel implementation structure [24]. Many commonly used edge detection operators work by calculating the difference of small local areas in an image [25], [26]. Such edge detectors or operators are relatively sensitive to noise and often enhance noise while detecting edges. The morphological edge detector mainly uses the concept of morphological gradient, although it is also sensitive to noise but does not enhance or amplify the noise [27], [28].
From the perspective of neurophysiology and psychophysics, relevant scholars have proposed that there are multiple edge masks and stripe masks in the pre-processing of human vision to convolve the image, and the output of these masks approximates the first derivative of the brightness function and second order directional derivatives [29]- [31]. For the step edge, the most drastic changes are the extreme point of the first derivative and the zero-crossing point of the second derivative, so the Gauss-Laplace operator is derived [32]. This method first smoothes the image, that is, the Gaussian function is used to smooth the image, and then the Laplace operator is used to detect the edge, thereby reducing the noise of the image and realizing the preprocessing of the image before edge extraction [33]. In order to evaluate the effectiveness of a certain edge detection method and at the same time help future generations to find new and more effective edge detection methods, scholars have proposed an edge detection method and given three methods for extracting edges [34]. For the first time, this method theoretically establishes the theoretical basis for optimal edge detection: good signal-to-noise ratio, edge localization, and maximum false response suppression [35]. This method quickly became popular as a standard for other detection methods on edge detection [36], [37]. These operators generally regard the pixel to be processed as the center, calculate the gray gradient in different directions in its neighborhood, to a certain extent, achieve the edge extraction of the image and achieve better processing results. Defects have not completely solved the requirements for true edge extraction of the image, such as edge positioning is not accurate enough, the edge is not single pixel wide, there is edge point miss detection, and noise interference is more serious [38]- [40]. Of course, the filtering technology can remove noise to a certain extent, but this kind of denoising is based on the blurring of the edges, so that the above problems cannot be solved well.
In this paper, multiple edge detection operators with different scales are combined to correctly detect the edges generated in an image. Several edge detection operators with different scales are used to detect the edges, and then their output results are combined to obtain an ideal edge map. Specifically, the technical contributions of this paper can be summarized as follows: First: We conducted an in-depth analysis of the multioperator edge detection method. The difference between the multi-operator edge detection method in the presence or absence of noise is compared.
Second: Based on the study of multi-scale edge focusing and edge extraction theory, the defects of the traditional Canny algorithm are analyzed, and an adaptive multi-scale Canny edge detection algorithm is studied and implemented, which has excellent edge detection performance.
Third: Through a lot of experiments, compared with the wavelet multi-scale edge detection operator and Canny operator, it is proved that the effect of the multi-operator dynamic weighting algorithm in this paper has obvious advantages in detecting the edge of noisy images. From the overall performance, the algorithm effect of this paper is better.

A. VIRTUAL REALITY TECHNOLOGY
To achieve a virtual reality scene, the points, lines, surfaces, light sources, and textures of objects needed in the scene are represented in three-dimensional coordinates in a virtual three-dimensional space, and the textures and materials are associated with the corresponding observed objects. With the help of Microsoft's Direct X multimedia programming interface and 3D game engine, we do not need to start from the basic point line and surface development, but rely on Direct X and Unity 3D game engine to establish a virtual reality scene. Hierarchical structure diagram of virtual reality visual system is shown in Figure 1.
Most of the graphics processing units now support coordinate transformation and lighting functions. Complex three-dimensional graphics coordinate conversion and light source illumination operations can effectively improve the computational efficiency and reduce the computational burden of the central processing unit through the high-speed parallel processing of the graphics processing unit. In the coordinate conversion stage, Direct X can call the graphics processing unit to convert the vertex coordinates, normals and corresponding textures of the three-dimensional graphics in the virtual space environment to the space coordinates based on screen pixels, and perform clipping and scaling on the three-dimensional scene. At the same time, according to the position of the light source, it also determines which pixels in the corresponding scene are illuminated by the backlight and which pixels are shaded because the light source is blocked. In the second stage of rasterization processing, the information that cannot be directly displayed on the screen, such as the point, line, and surface texture processed in the first stage, is converted into a two-dimensional image that can be displayed on the screen.
Unity 3D adopts a very open business strategy, which is almost completely free for individual game developers, and the technical documentation is very comprehensive, which is enough to effectively improve the learning and development VOLUME 8, 2020 efficiency of developers. In the latest Unity 5, the free version of personal development is used. The Unity 3D game engine is not only suitable for game development, its excellent rendering effects, flexible development methods and the introduction of support for Direct 11 enable it to create highly realistic virtual reality scenes. The technical characteristics are as follows: (1) One-time development, deployment everywhere: Users can perform the same development under the Windows platform and Mac OS, and can publish on the desktop Windows, Mac and Linux platforms. The Windows Phone platform can even be published on game consoles Play Station and Xbox platforms. Although due to differences in performance and graphics processing support between various platforms, some rendering effects and processing methods cannot be fully universal, but most models, animations, and renderers are universal, greatly improving the efficiency of cross-platform development.
(2) Highly integrated and timely scene editor: Unity 3D editor integrates many kinetic energy such as object models, materials, textures, light source settings, animations, and physics engines, and developers can view it in real time in the shopping street interface to modify the attribute content in the editor to achieve WYSIWYG game development. Combined with support for third-party plug-ins, you can get very strong scene editing and creative capabilities.
(3) Powerful scripting system: Unity 3D uses the Mono class library based on dot NET, which can write scripts in three different types of programming languages, C #, Java Script and Boo, and provides a rich programming interface to adapt it. Most program developers are used to developing powerful script control programs to enrich the interaction of virtual scenes.
(4) Good support for the network: In Unity 3D, you can use the Asset Bundle to put any models, textures, animation clips or even the entire scene on the server to dynamically load when the program is running, which can facilitate the model and the model on the server. The scene model update provides conditions for building an online 3D shopping mall.

B. BASIC PRINCIPLES OF IMAGE EDGE DETECTION
When we deal with digital images, the edge describes the most basic and important features in the image. The edge of the image provides some valuable target features such as target position and target contour. Digital image edge detection is a key first step in the processing of digital images in the field of computer vision such as image recognition and image analysis and interpretation. The accuracy and efficiency of edge detection are directly related to the performance of edge detection algorithms. According to the study of digital images, the purpose of edge detection on the image is to use a certain calculation method to extract the boundary between different gray areas in the image. The edge of the image is the part of the image where the gray scale changes sharply. Differentiating the image function becomes the most direct processing method for edge detection of the image.
In the field of mathematics, when there is only one variable in a linear real function, the derivative of the function means that the rate of change at that point in the function is the slope of the curve. In a two-dimensional function, for a point in the plane D, a vector can be derived by deriving the derivatives in both directions. This vector is called the gradient of this binary function, and the length of the vector is the magnitude of the gradient. Similar to the use of gradients of binary functions in higher mathematics to describe the rate of change of functions, digital images can also be regarded as binary functions. We can use two-dimensional difference method for edge detection. The processing flow of edge detection is shown in Figure 2.
In the preprocessing steps of the above edge detection technology, image smoothing filtering, image enhancement and edge detection have been widely used. This is because in most edge detection applications, only the approximate position and contour of the image edge need to be obtained, and no precise positioning of the edge is required.

C. IMAGE EDGE DETECTION METHOD
To detect the edge of an image, the detection is a significant change in the grayscale of the image, and the most basic operation to be achieved is to differentiate. In the case of a one-dimensional function, the stepped edge can be regarded as the local extremum of the first derivative of the function. The image can be viewed as an array of sampling points of a two-dimensional continuous function. Gradient is a measure of function change. Therefore, the derivative of the same dimension function is similar. The change of the gray value of the image as a two-dimensional function can be detected by the discrete approximation function of the gradient. Gradient is the two-dimensional equivalent of the derivative of a onedimensional function, which is defined as follows: The gradient is a vector with both size and direction. The magnitude of the gradient is given by: In practical engineering applications, due to the complexity of calculation, the sum of the absolute values of the two directions of the gradient is usually used to approximate the gradient amplitude: The calculation process of the gradient amplitude is independent of the direction of the edge. Such a gradient operator is called an isotropic operator. The direction of gradient H (x, y) is the direction of change when the function g(x, y) increases when the rate of change is maximum. The direction of gradient is defined as:  In the above formula, the angle α is the angle between the gradient direction and the positive x-axis direction. For digital images, the difference is used to replace the derivative, so the simplest gradient approximation is: When we deal with discrete digital images, the first-order difference of image pixels along the x and y directions can directly replace the partial derivatives of the image function in both directions. Differential edge detection is to use the first-order difference of the image grayscale to reach the extreme value at the rapid change point to detect the edge point. The value of the difference at a certain point represents the edge strength of the point.
Using the above edge detection method for differential edge detection intelligently performs the differential operation of the x direction and the y direction of the image. This requires the differential operation of the two directions of the image at the same time, which increases the complexity of the operation.

D. ANALYSIS OF EDGE DETECTION OPERATOR 1) SOBEL OPERATOR
In order to improve the location of edge points instead of performing gradient calculations on interpolated points between pixels, it is considered that the neighborhood can be used to construct edge detection operators. The Sobel operator places the gradient calculation point at the pixel in the center of the template.
The Sobel operator edge detection calculation method is to use the 3 × 3 neighborhood of each pixel in the image to convolve with the above partial derivative template, and select a larger response as the image edge. In fact, the Sobel algorithm uses the gray-scale weighted values of the adjacent points on the top, bottom, left and right of the pixel point to perform edge detection according to the principle that the gradient at the edge point reaches the extreme value. The principle of Sobel's edge detection method is simple and easy to implement, and the effect of edge detection is also good. At the same time, due to the introduction of the local average idea in the coefficient selection of the convolution template operator for partial derivative calculation, it has a certain ability to resist noise. Sobel algorithm has become one of the most commonly used algorithms in the traditional edge detection. Due to the influence of local averaging when performing edge detection, Sobel edge detection recognizes some disturbances as edges, resulting in a decrease in the edge signal-to-noise ratio and a decrease in edge positioning accuracy. When using a larger neighborhood, the local average characteristic will be better, but the amount of calculation increases a lot, and the detected edges are also thicker, which has a greater impact on the edge positioning accuracy. Therefore, the Sobel operator edge detection method is commonly used in engineering applications that do not require high edge detection accuracy.

2) PREWITT OPERATOR
The domain pixel arrangement of the Prewitt operator is exactly the same as that of the Sobel operator, and a 3 × 3 neighborhood is also selected to ensure that the gradient detected by the edge detection is the gradient at the pixel.
The Prewitt operator is to calculate the gradient amplitude according to the following formula under the neighbor pixels arranged in this way: In the above formula, T x and T y are partial derivatives. VOLUME 8, 2020 Compared with the Sobel operator, the Sobel operator uses two convolution operators to form an edge detector, both of which are convolved with the pixel 3 × 3 neighborhood, and a larger response amplitude is selected as the output result of the edge detector. The Prewitt operator is also a first-order differential operator that also detects edges in the horizontal and vertical directions, but the focus of the Prewitt operator is not to determine the current gradient calculation point from the center pixel of the template during gradient calculation. The following two methods can further determine the direction of the image edge. One method is to take the square root of the sum of the partial derivatives of the horizontal and vertical directions as the output of the edge detection to obtain a more comprehensive response. The gradient value is closer. Another method is to expand the Prewitt operator into eight direction edge detection operators, use these direction edge detection operators to detect images in turn, and use the maximum value of the response in these eight direction operators as the edge detection output at this point value. According to the matrix convolution operation, the direction operator most similar to the neighborhood of the detected point will get the maximum response. The definition of 8 orientation templates of Prewitt edge detection operator is shown in Figure 3.

3) CANNY OPERATOR
The principle of the Canny operator's optimal edge detection algorithm is to first smooth the image with a Gaussian filter of a certain scale, and then use the central gray window to calculate the direction and amplitude of the gradient at that point, and then perform non-maximum value on the gradient gray image suppression, and finally the method of detecting and connecting edges from candidate edge points is the double threshold method. Because of the good edge detection effect and the derivation from the optimal edge detection criteria, the Canny edge detection method is considered to be one of the most successful edge detection methods. However, because Canny edge detection uses a Gaussian filter to smooth out noise in the entire image range, the impact noise suppression is very poor. The impact noise is easy to be mistakenly detected as the image edge, which reduces the signal-to-noise ratio of the detected edge image. The double threshold method is to artificially set a high threshold and a low threshold for the grayscale image detected by the Canny operator, traverse the image, and judge the gradient amplitude of each pixel of the gradient image. Above the high threshold, the point must be considered for edge points. If the gradient amplitude is lower than the low threshold, it is considered that the point must not be an edge point. For pixels with a gradient amplitude higher than the low threshold but lower than the high threshold, the next time the image is traversed, it will be judged according to the edge connectivity. If there is an edge point in the neighborhood pixel of the pixel point, the point is considered to be an edge point, otherwise, the point is considered to be a non-edge point.

III. MULTI-SCALE ADAPTIVE IMAGE EDGE RECOGNITION ALGORITHM IN VIRTUAL REALITY SCENE A. MULTI-SCALE EDGE FOCUSING IN VIRTUAL REALITY SCENES
When we consider the problem of extracting image edge features, a good algorithm should pay attention to the following three points: (1) You can find important edges in the image; (2) Unnecessary details and noise can be suppressed; (3) The positioning accuracy can be guaranteed. These three points can be said to be mutually restrictive, and it is difficult for the method of extracting edge information at a single scale to be satisfied at the same time. The application of the edge focusing method can better solve the above three points. The basic method of edge focusing is to use a strong smooth to detect important edges at low resolution, and then gradually weaken the smooth intensity to track and focus to determine its accurate position. Using the edge focusing method can better solve the above three points.
You select Gaussian smoothing, and specify the edge as the maximum value of the smoothed image gradient. Gaussian smoothing results in blurring of edges and other sharp discontinuities in the image. When a large-scale filter smoothes two edges that are adjacent to each other, they may be connected together so that only one edge can be detected. Therefore, it is difficult to accurately determine the filter size without knowing the size of the object.
The basic idea of using a multi-scale filter template and analyzing the edge characteristics at different scales of the filter is to detect the best edge of the image by using the large-scale filter template to generate robust edges and the small-scale filter template to generate the characteristics of accurately positioning the edges. Edge tracks edges from coarse to fine. This method combines high-precision positioning with good noise suppression.
One method to achieve edge focusing is to compare some edge maps at different resolution scales and then match edge segments, but the edge detection results of this method are not satisfactory. Using a continuous method is more robust, because if the step size in the scale space is small enough, the matching problem can be solved well. The basic idea of edge focusing is to use a short step size in the scale space, so that the moving distance of two consecutive steps does not exceed one pixel.

B. EDGE EXTRACTION ALGORITHM BASED ON ADAPTIVE SMOOTHING FILTER
The most commonly used filter in image smoothing is the Gaussian filter. This filter has ideal characteristics, especially as the Gaussian standard deviation σ increases, the Laplacian operation on the smoothed signal will not add a new zero crossing point. In addition, Gaussian convolution can be effectively obtained by a series of finite window mean filters, such as using small windows with equal weights to calculate. For one-dimensional signals, this smoothing process can be expressed as: In the formula, T (0) (x) represents the original signal before smoothing; T (t+1) (x) represents the signal after iterative smoothing at step t + 1; For any t and x, w (t) (x) = −1.
But the key issue is that we don't know where the mutation occurred, otherwise there is no need to smooth it. Here, the calculation of the discontinuity at each point of the original signal is used to estimate the weight coefficient of the template.
Adaptive smooth scale space representation is a fixed number of iteration operations, and k is selected as the scale parameter, while in Gaussian smooth scale space is often a fixed k value, the number of iterations is used as the scale parameter, which will produce edge points at different scales.
The adaptively smoothed image retains the abrupt edge information well, and it also enhances the edge information to a certain extent, while the noise signal is smoothed out. Therefore, by performing a simple differential operation on the adaptively smoothed signal and then detecting the maximum value, edge detection can be achieved.

C. CANNY ADAPTIVE EDGE DETECTION ALGORITHM 1) DEFECTS OF TRADITIONAL CANNY ALGORITHM
The Canny operator achieved good results in edge detection and soon became the standard for evaluating other edge detection methods. However, in practical applications, we found that the photos are affected by various factors during the shooting process, such as the influence of the light source illumination and the camera itself, so that there are noise and blurry edges in the image, or within the range of the entire photo, the contrast is inconsistent. In this case, if the traditional Canny operator is simply used for edge detection, it is difficult to set high and low threshold parameters. On the other hand, it cannot eliminate local noise interference, and some will be lost while detecting false edges. The defects of the traditional Canny algorithm are as follows: (1) The traditional Canny operator calculates the gradient amplitude in a 2 × 2 neighborhood by calculating the finite difference average. The positioning of the edge is more accurate, but it is too sensitive to noise, and it is easy to detect false edges and lose some details of the true edge; (2) The traditional Canny algorithm uses high and low thresholds to repair discontinuous contours, and uses fixed high and low thresholds for segmentation. It cannot take into account the local feature information in the image. The local edges whose gray value changes slowly cause discontinuous contour edges of the target object, which affects the segmentation effect. In addition, because the parameters of the high and low thresholds of the traditional Canny operator are not determined by the image edge feature information, they do not have adaptive capabilities and have a low degree of automation. The Canny adaptive edge detection algorithm improves on the defects of the traditional Canny algorithm and has achieved good experimental results.

2) CANNY ADAPTIVE EDGE DETECTION ALGORITHM
According to the defects of the traditional Canny algorithm in calculating the gradient amplitude, the improved image gradient amplitude calculation method determines the pixel gradient amplitude by calculating the approximate values of the first-order partial derivatives in the x direction, y direction, 135 • direction and 45 • direction in the neighborhood of pixel value. This method takes into account the requirements of accurate edge positioning and noise suppression in the calculation of gradient amplitude, and achieved good results in the experiment. The gradient amplitude and gradient direction of the pixel are calculated using the coordinate conversion formula from rectangular coordinates to polar coordinates.
The adaptive dynamic threshold method is aimed at the defects of the traditional Canny algorithm in the setting of high and low thresholds, and divides the entire image into several sub-images. In order to make the contour continuous, there can be a certain overlapping area between the subimages, the ratio of the overlapping area to the sub-image is ρ, and then the high and low thresholds of each sub-image are adaptively set according to the result of non-maximum suppression. The specific algorithm is as follows:

a: GRADIENT AMPLITUDE HISTOGRAM
The maximum value of the gradient amplitude should be less than 4 × L (L is the gray level of the image), and the gradient amplitude of the pixels whose edge flags in the image N [i, j] after non-maximum suppression is not 0, forming a gradient  amplitude histogram describing the edge strength, as shown in Figure 4.

b: JUDGMENT AND CLASSIFICATION OF THE GRADIENT HISTOGRAM OF THE SUB-IMAGE
According to the characteristics of the gradient amplitude histogram, the non-edge area and the edge area can be adaptively segmented. First, it is necessary to classify the gradient amplitude histogram according to its morphological features. The sub-image gradient amplitude histogram may be as follows: x All is the background: If the sub-image completely corresponds to the non-edge area in the original image and does not contain any edges, the edge flag bit of the pixels in the entire sub-image area should be set to 0, so as to suppress false caused by noise edge; y All are edges: Because the proportion of edges in the image is very small, it is impossible for all pixels to be edges in the sub-image; z Both background and edge: Most sub-images are in a state that contains both a large amount of background and a small amount of edges.
From the prior knowledge, it can be seen that the proportion of non-edges in the image is much larger than the proportion of edges, so the pixel set corresponding to the peak of a single peak in the gradient amplitude histogram must be a non-edge pixel set. The gradient amplitude with the largest number of pixels in the gradient amplitude histogram is called the gradient amplitude H max of the maximum pixel count, and the gradient amplitude of all pixels in the sub-image is calculated relative to the gradient amplitude H max . The mean square error is called the mean square error A max of the gradient amplitude of the maximum number of pixels in this paper is: Among them, k is the maximum value of the gradient amplitude that the number of pixels is not 0, and N is the total number of pixels.
When there is only a single peak in the gradient amplitude histogram, the gradient amplitude of the pixels is concentrated near the gradient amplitude H max of the maximum number of pixels, so the mean square error A max of the gradient amplitude of the maximum number of pixels is small. When the gradient amplitude histogram has not only a single peak of non-edge pixel gradient amplitude, but also the distribution of the gradient amplitude of the edge pixel, the edge pixel gradient amplitude is distributed at a position where H max is relatively far, so A max is large. Based on this, the threshold is set for judgment (for example, the mean square error threshold of the gradient amplitude of the maximum number of pixels can be set to 1). When the mean square deviation A max of the maximum number of pixels is less than the threshold, the sub-images are considered to be all non-edge backgrounds, and the corresponding gradient amplitudes N [i, j] are all assigned to 0, so it performs edge tracking, which saves the calculation time and reduces the calculation complexity. If A max is greater than the threshold, it is considered that the sub-image contains both non-edge areas and edge areas, and further processing is required.

c: ACCORDING TO THE GRADIENT AMPLITUDE HISTOGRAM, ADAPTIVELY GENERATE HIGH AND LOW THRESHOLDS
The adaptive dynamic threshold is relative to the conventional fixed threshold. Under the principle of global optimization, the different thresholds of each sub-image are determined according to the characteristics of the gradient histogram of different sub-images. In this paper, the global threshold is used as the basis, and the gradient amplitude distribution characteristics of the sub-image are used to adjust it. The resulting threshold is the dynamic adaptive threshold. For any image, let B H and B L be the global high and low thresholds of the entire image determined by the adaptive dynamic threshold method, and B h and B l are the local high and low thresholds determined by this method on the sub-image area, then the final high and low thresholds for dividing the sub-image are:  In the formula, 0 < β < 1 is the threshold adjustment rate. If β = 0, it means no adjustment, which means that the image segmentation is implemented according to the characteristics of the global gradient amplitude histogram; if β = 1, it means that the segmentation is completely based on the local features of the sub-image, which shows that the dynamic threshold algorithm can take into account the overall losing local details, the value of β can be determined according to the needs in practical applications, and the size of the sub-image can be appropriately selected.

d: EDGE TRACKING AND CONNECTION
The gradient amplitude of the pixel will be less than the high threshold B h , but greater than the low threshold B 1 . Next we need to connect the edges in the area into a contour. When the contour endpoint is reached, the algorithm looks for edges that can be connected to the contour at the 8-neighborhood of the edge image obtained by the low threshold. We use a recursive tracking algorithm to continuously collect edges until all gaps are connected. The edge tracking algorithm flow is shown in Figure 5.

e: ADAPTIVE MULTI-SCALE cANNY EDGE DETECTION ALGORITHM
A single-scale edge detection operator cannot correctly detect all edges. A small-scale edge detection operator is more sensitive to noise, but it can detect details of grayscale changes. It can detect rough changes in gray scale. Therefore, combining the edge images at different scales can extract a more ideal edge image. Based on the Canny adaptive edge detection algorithm, multiple scales are used for edge detection, and then the results on each scale are combined to obtain the ideal edge.

IV. SIMULATION EXPERIMENT AND RESULT ANALYSIS A. ADAPTIVE DYNAMIC WEIGHT THRESHOLD IMAGE SEGMENTATION BASED ON GENETIC ALGORITHM
In this paper, for the problem that the image segmentation threshold needs to be set manually, on the basis of the maximum entropy image segmentation algorithm, a genetic algorithm is introduced to automatically search the segmentation threshold and obtain the optimal segmentation threshold. This method can not only adaptively segment any image optimally, but also obtain segmentation threshold faster than other fuzzy search algorithms, and improve the robustness and real-time performance of the image segmentation algorithm.

1) THRESHOLD SELECTION METHOD BASED ON MAXIMUM ENTROPY VALUE
The information entropy of the image reflects the overall picture of the image. If an object is included in the background of the image, the amount of information (ie, the entropy value) at the junction between the object and the background can be the largest.
Using binary to segment the image, the fundamental purpose is to segment the target from the background, that is, to divide the image into two areas: the target area and the background area, so that a binary image can be obtained. In a multi-grayscale image containing an object, there must be a gray value t, which is used as the segmentation threshold to make the image get the best binary segmentation. Suppose t divides the multi-grayscale image into two areas, the grayscale value of one area ranges from 0 to t, and the total entropy is: (12) According to information coding theory, when the target is best segmented from the background, the entropy should be the largest. Therefore, the t value that maximizes H (F (t)) is the optimal segmentation threshold.
This paper is based on the theoretical basis of the maximum between-class variance method and the consistency criterion method, using the maximum entropy principle to determine the best gray threshold to segment the image.
In order to make the binarized image obtained after segmentation not only obtain the maximum inter-class variance but also have the maximum consistency, the optimal threshold t ∧ should be:

2) GENETIC ALGORITHM
Because the genetic algorithm's overall optimization strategy and optimization calculation process do not depend on gradient information, its global search ability is very strong, that is, the global optimal solution in the solution space has a strong approximation ability to the real solution. It is suitable for occasions where the structure of the problem is not particularly clear, the overall scale is very large, and the environment is very complex, and the contour image obtained by edge extraction of the image collected in real time is such a problem. Compared with other intelligent optimization algorithms, genetic algorithm has the advantage that it only depends on the individual in the solution space and its fitness when solving the target problem, so it can easily solve nonlinear and unstructured complex problems. The operation of genetic algorithm is divided into the following steps: (a) Before using genetic algorithm to start searching, it is necessary to encode the target solution space. This is a key step in the genetic algorithm, which has a direct impact on the convergence speed of the iterative operation behind the genetic algorithm. For a 256-level grayscale image, an eightbit long natural code can be used, and the target individual's code is similar to the organism's gene chain.
(b) Secondly, it is necessary to determine the calculation problem of the fitness of the individual in the solution space to solve the problem, that is, to select the calculation function of the individual fitness. Selecting the fitness calculation function is the most important step in the genetic algorithm, because the subsequent three basic genetic algorithm operations of selection, hybridization and mutation are based on the fitness function. It is the most searchable genetic algorithm.
(c) After determining the coding method of the understanding space and the calculation function of individual fitness, the next step is to randomly select N individuals in the solution space to form the initial population.
(d) You calculate the fitness of each individual in the population, and select M best individuals from them to breed the next generation population according to a certain strategy mechanism. The selection process should reflect the principle of ''survival of the fittest'', even if individuals with higher fitness have higher chances of breeding offspring.
(e) For the M individuals selected, two individuals are randomly selected according to the preset hybridization probability for crossover operation to generate two new individuals of the new generation population. The crossover operation is an operation in which two individuals exchange part of the gene chain with each other, and is a means for randomly exchanging information between individuals in a population. You repeat this process until a new generation of population is produced.
(f) In the new generation population obtained by crossover operation, several individuals are extracted from them according to the preset mutation probability, and mutation operations are performed according to a certain strategy, that is, the value of a certain bit of the individual coding value is changed. The mutation operation can improve the diversity of the population, thus avoiding the iterative search prematurely falling into the local optimal solution.
(g) You check whether the search stop condition is satisfied, if it is satisfied, stop evolution, if not, go to (d) to continue the search iteration process.
Based on real-time application considerations, we choose the calculation function of the maximum inter-class variance and consistency criterion as the individual fitness function of the genetic algorithm.
where t represents the segmentation threshold of the image to be processed, w 1 (t−1) represents the number of pixels in the image whose pixel value is less than the threshold t, and w 2 (t−1) represents the number of pixels in the image whose pixel value is greater than the threshold t. u 1 (t) represents the average gray value of pixels in the image whose pixel value is less than the threshold t, and u 2 (t) represents the average gray value of pixels in the image whose pixel value is greater than the threshold t.
Our goal is to find the maximum threshold t ∧ through the two optimization genetic algorithms proposed above, and use   the entropy map to select the final segmentation threshold. The situation of segmentation threshold search by genetic algorithm is shown in Figure 6 and Figure 7.
It can be seen from Figure 6 that the segmentation threshold obtained after 20 generations of heredity has basically stabilized. After 120 trials, the obtained segmentation thresholds are very close. Finally, the median value of all the results is t 1 = 75, and the actual optimal solution is t 1 = 74. Figure 7 shows that the results after 2 generations of heredity are very stable. After 105 trials, the median value of all the results is t 2 = 79, and the actual optimal solution is t 2 = 80. Through experiments, it can be known that the efficiency of searching the segmentation threshold by the above-mentioned second optimization genetic algorithm is very high, and stable optimal threshold can be obtained. Moreover, the searched optimal solution is very close to the real optimal solution. Therefore, the adaptive segmentation algorithm proposed in this paper is not only efficient, but also highly reliable.

B. EXPERIMENTAL RESULTS OF IMAGE EDGE RECOGNITION
In the experiments in this section, the 256 × 256 Football and Onion images are used for edge detection using wavelet multi-scale method, Canny operator and the algorithm proposed in this paper. The statistical data results of the edge image are shown in Figure 9 and Figure 11. It can be seen that the algorithm of this paper performs significantly better on edge detection of noisy images than the other two algorithms.
As can be seen from Figure 8 to Figure11, whether it is from subjective visual perception or objective indicators, when performing edge detection on noise-free images, the edge detection algorithm proposed in this paper reduces the appearance of false edges very well. The edge is not as   much as the other two algorithms, but it contains the contour edge of the image as much as possible, and the detected edges are the true edges of the image. However, the results of wavelet multi-scale detection operator and Canny operator have false contour edges to varying degrees. For images contaminated by Gaussian noise or impulsive noise, the algorithm in this paper greatly suppresses the interference of noise on edge detection, and there is no obvious difference from the edge detected when there is no noise. But for the other two algorithms, they are received to varying degrees. Due to the influence of noise, the effect of the method in this paper is significantly better than the latter two.
Whether it is the early median filtering operation or the later image segmentation processing, all algorithms can automatically find the threshold, without artificially setting the threshold, avoiding the dependence of the algorithm on people, so the algorithm in this paper has a high degree of adaptability.

V. CONCLUSION
This paper introduces the basic concept, processing flow and main detection steps of edge detection, gives the basic implementation principles of edge detection technology, and analyzes the existing edge detection algorithms. The classical edge detection algorithm is compared with or without noise detection effect, and the evaluation standard of the existing edge detection technology is expounded. We introduce multi-scale edge focusing method and edge extraction method based on adaptive smoothing filter. On this basis, the defects of the traditional Canny algorithm are analyzed, the adaptive multi-scale Canny edge detection algorithm is studied, and compared with the traditional Canny edge detection algorithm. For an image contaminated by noise, only the edge detection algorithm cannot correctly detect its edge. The edge detection method combined with median filtering and wavelet transform proposed in this paper can suppress the impulse noise in the image. The satisfactory edge detection results can be obtained. The edge detection effect is superior to the classic edge detection algorithm and wavelet multi-scale edge detection algorithm. However, due to its slow running speed, this algorithm is not suitable for real-time detection. In order to solve this problem, the next step may consider combining this algorithm with the morphological edge detection method, using the natural parallelism of morphology to realize the real-time edge detection.