An 8-direction Sobel edge detection system based on FPGA
By designing an 8-direction Sobel edge detection system on the FPGA platform, combined with non-maximum suppression and the Otsu algorithm, the problem of insufficient detection directions of the traditional Sobel operator and the long calculation time of the Otsu method is solved, achieving more efficient and accurate edge detection. .
Patent Information
- Application Number
- CN202410488684.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-23
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-04-23
AI Technical Summary
The traditional Sobel operator only detects two directions, which is prone to edge detection or inaccuracy. Moreover, the Otsu method takes a long time to calculate the image threshold and cannot meet the real-time processing requirements.
Design an 8-direction Sobel edge detection system based on FPGA, add 45°, 135°, 180°, 225°, 270°, 315° detection templates, use the non-maximum suppression method to refine the gradient values, and pass the image Blocking and Otsu algorithms implement adaptive threshold calculation and make full use of the parallel characteristics of FPGA.
It improves the accuracy and reliability of edge detection, reduces the amount of calculation and time-consuming, and meets the needs of real-time processing of video images.
Smart Images

Figure CN118379315B
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of computer data processing, and in particular to an 8-direction Sobel edge detection system based on FPGA. Background Art
[0002] Digital image processing technology plays an important role in fields such as artificial intelligence. The amount of information contained in each picture is huge, and the edge of the image reflects the most essential characteristics of the picture. Edge detection has great development space in many fields such as aerospace, military, medical, and industry. Edge detection technology can effectively remove invalid information and reduce the amount of data contained in the picture, so as to meet the requirements of modern technology. Common edge detection operators can be divided into first-order differential operators and second-order differential operators. Among them, first-order differential operators include Sobel operator, Roberts operator, and Prewitt operator; second-order differential operators include Laplace operator, Canny operator, and Log operator. In the actual production environment, the image environment collected by the camera is often complex, and there are problems such as uneven lighting. Therefore, median filtering, Gaussian filtering and other technologies can be used to pre-process the images that need to extract edges.
[0003] In practical applications, traditional devices such as PCs and DSPs cannot meet the real-time processing requirements of video images due to their poor portability. The video image processing system built based on Field Programmable Gate Array (FPGA) hardware has the advantages of good portability and fast running speed, and is very suitable for building a video image processing system.
[0004] Currently, the mainstream method for determining the threshold value is to use the Otsu method to calculate the image threshold. The traditional Otsu method has problems such as large amount of calculation and long time consumption. Summary of the invention
[0005] One of the purposes of the present invention is to provide an 8-direction Sobel edge detection system based on FPGA. In view of the problems that the traditional Sobel operator only detects two directions and the threshold is set manually, and the edge is easily missed or inaccurate, the present invention adds 45°, 135°, 180°, 225°, 270°, and 315° detection templates on the basis of 0° and 90°. After the gradient value is obtained, the non-maximum suppression method is used to refine the gradient. By introducing the idea of image segmentation, the histogram statistical process is accelerated, and the threshold of a frame of image is calculated using the Otsu algorithm to achieve threshold adaptation, the accuracy and reliability of edge detection are increased, and the parallel characteristics of FPGA are fully utilized.
[0006] An embodiment of the present invention provides an 8-direction Sobel edge detection system based on FPGA, comprising:
[0007] Image acquisition module and FPGA platform;
[0008] Among them, the FPGA platform includes:
[0009] A grayscale conversion module is used to convert the image acquired by the image acquisition module into a grayscale image and extract the Y component image;
[0010] 3*3 matrix generation module, used to generate a 3*3 pixel matrix based on the Y component image;
[0011] The median filter module is used to perform median filtering on the Y component image based on a 3*3 pixel matrix;
[0012] An image block module is used to divide the Y component image after median filtering into multiple image blocks;
[0013] An image block histogram processing module, used for performing histogram processing on multiple image blocks;
[0014] A threshold calculation module, used for calculating a threshold based on a histogram processing result;
[0015] Multi-directional Sobel edge detection module, used to perform edge detection on the Y component image after median filtering based on 8 directional detection templates;
[0016] A non-maximum suppression module is used to perform non-maximum suppression on edge detection results;
[0017] The binarization module is used to compare the threshold with the non-maximum suppression result to determine the edge detection result.
[0018] Preferably, the 3*3 matrix generation module calls twice a BRAM with a depth of 1024 and a width of 8 to store the first two rows of image pixels;
[0019] When the third row of data arrives, the first two rows of data stored in the RAM are read out, thereby obtaining a pixel data of three rows and one column;
[0020] The pixel data of three rows and one column are stored three times in succession to obtain a pixel array of three rows and three columns.
[0021] Preferably, the median filter module sorts 3 pixels in each row of the 3*3 pixel matrix to obtain the maximum, median and minimum values of each row;
[0022] Extract the minimum of the three maximum values, the middle of the three middle values, and the maximum of the three minimum values;
[0023] The median of the three values obtained is taken again, and finally the median of the 9 pixels is obtained.
[0024] Preferably, the image segmentation module segments the Y component image after median filtering into N blocks of W*H images; N is 4, W is 320, and N is 240.
[0025] Preferably, the threshold calculation module calculates the threshold using the Otsu algorithm, and the formula of the algorithm is:
[0026] In the formula, g represents the maximum variance between classes, i.e., the threshold value, and n k Indicates the number of gray levels at level k.
[0027] Preferably, the 8 direction detection templates are 0°, 45°, 90°, 135°, 180°, 225°, 270°, and 315° detection templates.
[0028] Preferably, the non-maximum suppression module uses a 3*3 sliding window to find the local maximum in the direction perpendicular to the edge; the current pixel gradient value is compared with the two adjacent gradient values in its gradient direction. If it is larger than the adjacent gradient values, the pixel point is judged as an edge point and the gradient value of the point is retained; otherwise, it is judged as a non-edge point and set to 0.
[0029] Preferably, the binarization module compares the refined gradient value with a threshold value. If the gradient value is greater than the threshold value, it is regarded as an edge and the pixel point is assigned a value of 1, otherwise it is assigned a value of 0.
[0030] Preferably, the 8-direction Sobel edge detection system based on FPGA further includes:
[0031] An optimization module is used to optimize the edge detection results and output the optimization results;
[0032] The optimization module optimizes the edge detection result, including:
[0033] Obtaining the acquisition position and acquisition viewing angle of the image acquired by the image acquisition module;
[0034] Based on the acquisition position and the acquisition viewing angle, a plurality of groups of one-to-one corresponding first lens objects and lens areas are determined from a preset environment map;
[0035] Traverse each first lens object in turn;
[0036] During each traversal, determining an image area corresponding to the lens area corresponding to the traversed first lens object from the edge detection result;
[0037] Searching for a first edge line in the image area based on a preset edge line search template corresponding to the traversed first lens object;
[0038] Based on the preset first edge line correction template corresponding to the traversed first lens object, the first edge line is corrected and optimized.
[0039] Preferably, the optimization module optimizes the edge detection result and further includes:
[0040] After traversing each first lens object, determining a plurality of second edge lines other than the first edge line from the edge detection result;
[0041] Traverse each second edge line in turn;
[0042] During each traversal, the first edge line that meets the standard line relationship with the traversed second edge line is determined from the edge detection result and used as the third edge line;
[0043] Extracting features from the traversed second edge line, the relative positional relationship between the traversed second edge line and the third edge line, and the third edge line to obtain a feature set;
[0044] Constructing a feature description vector of the feature set;
[0045] Determining a classification mark corresponding to the feature description vector from a preset classification mark library;
[0046] After traversing each second edge line, classifying each second edge line into a plurality of edge line sets of the second lens object based on the classification mark;
[0047] Traverse each second lens object in turn;
[0048] During each traversal, based on a preset second edge line correction template corresponding to the traversed second lens object, the second edge line in the edge line set of the traversed second lens object is corrected and optimized.
[0049] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings.
[0050] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0052] Figure 1 A schematic diagram of a schematic diagram of an FPGA hardware platform in an embodiment of the present invention;
[0053] Figure 2 is a schematic diagram of an image processing module in an embodiment of the present invention;
[0054] Figure 3 Schematic diagram of an 8-directional Sobel detection template in an embodiment of the present invention. DETAILED DESCRIPTION
[0055] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0056] The embodiment of the present invention provides an 8-direction Sobel edge detection system based on FPGA, such as Figure 1 As shown, including:
[0057] Image acquisition module and FPGA platform;
[0058] Among them, the FPGA platform includes:
[0059] Grayscale conversion module, used to convert the image collected by the image acquisition module into a grayscale image and extract the Y component image; (the Y component can be extracted through the formula Y = 0.299*R + 0.587*G + 0.144*B. Since FPGA does not support floating-point operations, the above formula can be expanded by 256 times to obtain Y = 77*R + 150*G + 29*B. The Y value is shifted right by 8 bits through the shift operator, that is, it is reduced by 256 times to obtain the Y component of the image. In order to make full use of the parallel processing characteristics of FPGA, the calculation process adopts the idea of pipeline. All multiplications are completed in the first always block, all additions are completed in the second always block, and shift operations are performed in the third always block. Therefore, the video line field synchronization signal and data signal need to be delayed by 3 clocks. Finally, the 8-bit Y component is output.)
[0060] 3*3 matrix generation module, used to generate a 3*3 pixel matrix based on the Y component image; (This part uses the IP core that comes with Vivado to call twice a BRAM with a depth of 1024 and a width of 8 to store the first two rows of image pixels. The RAM is defined as SimpleDual-Port RAM (pseudo dual-port RAM). RAM0 stores the pixel data of the first row, and RAM1 stores the pixel data of the second row. When the third row of data arrives, the first column data of the first two rows stored in the RAM is read out to obtain a "three-row and one-column" pixel data. Next, the "three-row and one-column" pixel data is stored three times in succession to obtain a "three-row and three-column" pixel array, and the image pixels are output after delaying the field valid signal, data valid signal and clock enable signal for two cycles;)
[0061] The median filter module is used to perform median filtering on the Y component image based on a 3*3 pixel matrix;
[0062] An image block module is used to divide the Y component image after median filtering into multiple image blocks;
[0063] Image block histogram processing module, used to perform histogram processing on multiple image blocks; (This part calls Vivado's BRAM IP core to store a frame of image data. The RAM is defined as Simple Dual-Port RAM [pseudo dual-port RAM]. Port A can only complete read operations, and port B can only complete write operations. When the input pixel data is valid, the read address is the input grayscale value, ranging from 0-255. The read data is incremented by one and then written back to the address. The address of the write data is also the input grayscale value. In order to prevent conflicts between read and write data, the address of the write data is delayed by one clock cycle compared to the address of the read data. Before the end of one frame and the arrival of the next frame, the field synchronization signal will remain at a low level for a period of time. During this period, no image pixel data is input. During this period, the data in the RAM is read out and the RAM is cleared. As a unit module for histogram statistics, this module should be instantiated N times according to the N of the image block module;)
[0064] The threshold calculation module is used to calculate the threshold based on the histogram processing results; (the method for calculating the threshold adopts the one-dimensional Otsu algorithm, the core formula of which is In the formula, g represents the maximum variance between classes, i.e., the threshold value. The segmentation threshold for foreground and background is T, n k Represents the number of gray levels at level k, and L is the gray level of the image. )
[0065] Multi-directional Sobel edge detection module, used to perform edge detection on the Y component image after median filtering based on 8 directional detection templates;
[0066] Non-maximum suppression module, used to perform non-maximum suppression on edge detection results; (Non-maximum suppression module: encode 8 directions, 0° is recorded as 000, 45° is recorded as 001, 90° is recorded as 010, 135° is recorded as 011, 180° is recorded as 100, 225° is recorded as 101, 270° is recorded as 110, 315° is recorded as 111, the gradient direction encoding and the maximum gradient value are passed to the module, the gradient data is traversed in a 3*3 window, and the gradient value of the pixel in the center of the window is compared with the two adjacent gradient values in the maximum gradient direction. If it is larger than the adjacent gradient value, the pixel point is judged as a suspicious edge point and the gradient value of the point is retained; otherwise, it is judged as a non-edge point. This module is mainly used to refine edge pixels;)
[0067] The binarization module is used to compare the threshold with the non-maximum suppression result to determine the edge detection result. (The gradient value after non-maximum suppression is compared with the adaptive threshold. If the gradient value is greater than the threshold, the pixel is regarded as an edge image and assigned a value of 1; otherwise, it is assigned a value of 0.)
[0068] The 3*3 matrix generation module calls twice a BRAM with a depth of 1024 and a width of 8 to store the first two rows of image pixels;
[0069] When the third row of data arrives, the first two rows of data stored in the RAM are read out, thereby obtaining a pixel data of three rows and one column;
[0070] The pixel data of three rows and one column are stored three times in succession to obtain a pixel array of three rows and three columns.
[0071] The median filter module sorts 3 pixels in each row of the 3*3 pixel matrix to obtain the maximum, median and minimum values of each row;
[0072] Extract the minimum of the three maximum values, the middle of the three middle values, and the maximum of the three minimum values;
[0073] The median of the three values obtained is taken again, and finally the median of the 9 pixels is obtained.
[0074] The image segmentation module segments the Y component image after median filtering into N W*H images; N is 4, W is 320, and N is 240.
[0075] The threshold calculation module uses the Otsu algorithm to calculate the threshold. The formula of the algorithm is:
[0076] In the formula, g represents the maximum variance between classes, i.e., the threshold value, and n k Indicates the number of gray levels at level k.
[0077] The 8 direction detection templates are 0°, 45°, 90°, 135°, 180°, 225°, 270°, and 315° detection templates.
[0078] The non-maximum suppression module uses a 3*3 sliding window to find the local maximum in the direction perpendicular to the edge; the current pixel gradient value is compared with the two adjacent gradient values in its gradient direction. If it is larger than the adjacent gradient value, the pixel is judged as an edge point and the gradient value of the point is retained; otherwise, it is judged as a non-edge point and set to 0.
[0079] The binarization module compares the refined gradient value with the threshold. If the gradient value is greater than the threshold, it is considered an edge and the pixel is assigned a value of 1, otherwise it is assigned a value of 0.
[0080] FPGA-based 8-directional Sobel edge detection system, also includes:
[0081] An optimization module is used to optimize the edge detection results and output the optimization results;
[0082] The optimization module optimizes the edge detection result, including:
[0083] Obtaining the acquisition position and acquisition viewing angle of the image acquired by the image acquisition module;
[0084] Based on the acquisition position and the acquisition viewing angle, a plurality of groups of one-to-one corresponding first lens objects and lens areas are determined from a preset environment map;
[0085] Traverse each first lens object in turn;
[0086] During each traversal, determining an image area corresponding to the lens area corresponding to the traversed first lens object from the edge detection result;
[0087] Searching for a first edge line in the image area based on a preset edge line search template corresponding to the traversed first lens object;
[0088] Based on the preset first edge line correction template corresponding to the traversed first lens object, the first edge line is corrected and optimized.
[0089] The image acquisition module is a camera, the acquisition position is the shooting position of the camera, and the acquisition angle is the shooting angle of the camera; the environment map is a virtual map that simulates the real environment in a one-to-one ratio, such as a city panoramic map. At present, some map software will provide a city panoramic map, which can be used as an environment map; a virtual camera can be set in the environment map to control the virtual camera to shoot in the environment map at the acquisition position and acquisition angle. The shooting area of the virtual camera is the lens area, and the object photographed in the shooting area of the virtual camera is the first lens object, and the first lens object corresponds to the lens area one by one; each time the first lens object is traversed, the image area corresponding to the lens area corresponding to the traversed first lens object is determined from the edge detection result, that is, the image area corresponding to the lens area acquired by the image acquisition module; the edge line search template is to search for a first edge line similar to the contour line of the first lens object; the first edge line correction template is to correct the first edge line to make it wirelessly close to the contour line of the first lens object; when the first edge line is searched out, the first edge line is corrected and optimized based on the first edge line correction template. Generally, due to the influence of shooting environment factors (such as light, obstructions, etc.), a large number of edge detection errors may appear in the edge detection results. The embodiment of the present invention, with the help of the environment map, introduces an edge line search template and a first edge line correction template, which can quickly correct the first edge line that needs to be corrected in the edge detection result, thereby greatly improving the accuracy and applicability of the system edge detection.
[0090] In one embodiment, the optimization module optimizes the edge detection result, and further includes:
[0091] After traversing each first lens object, determining a plurality of second edge lines other than the first edge line from the edge detection result;
[0092] Traverse each second edge line in turn;
[0093] During each traversal, the first edge line that meets the standard line relationship with the traversed second edge line is determined from the edge detection result and used as the third edge line;
[0094] Extracting features from the traversed second edge line, the relative positional relationship between the traversed second edge line and the third edge line, and the third edge line to obtain a feature set;
[0095] Constructing a feature description vector of the feature set;
[0096] Determining a classification mark corresponding to the feature description vector from a preset classification mark library;
[0097] After traversing each second edge line, classifying each second edge line into a plurality of edge line sets of the second lens object based on the classification mark;
[0098] Traverse each second lens object in turn;
[0099] During each traversal, based on a preset second edge line correction template corresponding to the traversed second lens object, the second edge line in the edge line set of the traversed second lens object is corrected and optimized.
[0100] However, there may be some static objects in the environment map that will not move unless under special circumstances, such as urban buildings, road facilities, etc.; however, there may also be some dynamic objects in the environment map, such as pedestrians, passing vehicles, etc. Therefore, there may be dynamic objects in the edge detection results that have not appeared in the environment map, resulting in the inability to correct the edge lines of the dynamic objects in the edge detection results. The embodiments of the present invention can solve this problem. The second edge line is the edge line of a dynamic object that has not appeared in the environmental map; when there is a standard line relationship between the second edge line and the first edge line, it means that the standard shape of the second edge line can be derived based on the first edge line. For example, when a vehicle is traveling on the road, the line relationship between edge line A of the vehicle contour and edge line B of the road contour is that edge line A is above edge line B, and there are at least two contact points between edge line A and edge line B. Therefore, this line relationship can be used as a standard line relationship to deduce the second edge line of the vehicle contour based on the first edge line of the road contour. The standard line relationship can be set in advance by technical personnel according to the edge line relationship between different contact objects; however, the dynamic object in the edge detection result may be obscured due to its moving state, resulting in multiple intermittent second edge lines; feature extraction is performed on the traversed second edge line, the relative position relationship between the traversed second edge line and the third edge line, and the third edge line to obtain a feature set. The features in the feature set include: the shape of the traversed second edge line, the relative position relationship between the traversed second edge line and the third edge line The contact point position between the lines, the shape of the third edge line, etc.; based on the feature description technology, the feature set feature is described as a feature description vector; there are classification tags corresponding to different feature description vectors in the classification tag library, and the classification tag indicates the dynamic object to which the traversed second edge line belongs, that is, the second lens object; a feature set is constructed in advance according to the different shapes of the second edge lines, the contact point position between the second edge line and the third edge line, and the shape of the third edge line, and the dynamic object reflected by the feature set is set, and then the feature set is converted into a feature description vector and associated with the dynamic object to construct a classification tag library, which can be achieved; when classifying each second edge line, according to the dynamic object reflected by the classification tag, the second edge lines reflecting the same dynamic object are grouped into a set to form an edge line set; after determining the second lens object, the second edge line correction template is introduced in the same way as the first edge line correction template, and the second edge line in the edge line set of the traversed second lens object is corrected and optimized, so as to realize the correction of the edge line of the dynamic object that has not appeared in the environment map, and further improve the accuracy and applicability of the system edge detection.
[0101] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. An 8-direction Sobel edge detection system based on FPGA, characterized in that: include: Image acquisition module and FPGA platform; wherein the FPGA platform includes: A grayscale conversion module is used to convert the image acquired by the image acquisition module into a grayscale image and extract the Y component image; A 3*3 matrix generation module, used for generating a 3*3 pixel matrix based on the Y component image; A median filtering module, used for performing median filtering on the Y component image based on the 3*3 pixel matrix; An image block module is used to divide the Y component image after median filtering into multiple image blocks; An image block histogram processing module, used for performing histogram processing on the multiple image blocks; A threshold calculation module, used for calculating a threshold based on a histogram processing result; Multi-directional Sobel edge detection module, used to perform edge detection on the Y component image after median filtering based on 8 directional detection templates; A non-maximum suppression module is used to perform non-maximum suppression on edge detection results; A binarization module, used for comparing the threshold with the non-maximum suppression result to determine the edge detection result; An optimization module is used to optimize the edge detection results and output the optimization results; The optimization module optimizes the edge detection result, including: Obtaining the acquisition position and acquisition viewing angle of the image acquired by the image acquisition module; Based on the acquisition position and the acquisition viewing angle, a plurality of groups of one-to-one corresponding first lens objects and lens areas are determined from a preset environment map; Traverse each first lens object in turn; During each traversal, determining an image area corresponding to the lens area corresponding to the traversed first lens object from the edge detection result; Searching for a first edge line in the image area based on a preset edge line search template corresponding to the traversed first lens object; Based on the preset first edge line correction template corresponding to the traversed first lens object, the first edge line is corrected and optimized.
2. The 8-direction Sobel edge detection system based on FPGA as claimed in claim 1, characterized in that: The 3*3 matrix generation module calls twice a BRAM with a depth of 1024 and a width of 8 to store the first two rows of image pixels; When the third row of data arrives, the first two rows of data stored in the RAM are read out, thereby obtaining a pixel data of three rows and one column; The pixel data of three rows and one column are stored three times in succession to obtain a pixel array of three rows and three columns.
3. The 8-direction Sobel edge detection system based on FPGA as claimed in claim 1, characterized in that: The median filter module sorts 3 pixels in each row of the 3*3 pixel matrix to obtain the maximum, median and minimum values of each row; Extract the minimum of the three maximum values, the middle of the three middle values, and the maximum of the three minimum values; The median of the three values obtained is taken again, and finally the median of the 9 pixels is obtained.
4. The 8-direction Sobel edge detection system based on FPGA as claimed in claim 1, characterized in that: The image segmentation module segments the Y component image after median filtering into N W*H images; N is 4, W is 320, and N is 240.
5. The 8-direction Sobel edge detection system based on FPGA as claimed in claim 1, characterized in that: The threshold calculation module uses the Otsu algorithm to calculate the threshold. The formula of the algorithm is: In the formula, g represents the maximum variance value between classes, i.e., the threshold value, and the segmentation threshold for foreground and background is T, n k Represents the number of gray levels at the kth level, and L is the gray level of the image.
6. The 8-direction Sobel edge detection system based on FPGA as claimed in claim 1, characterized in that: The 8 direction detection templates are 0°, 45°, 90°, 135°, 180°, 225°, 270°, and 315° detection templates.
7. The 8-direction Sobel edge detection system based on FPGA as claimed in claim 1, characterized in that: The binarization module compares the refined gradient value with the threshold. If the gradient value is greater than the threshold, it is considered an edge and the pixel is assigned a value of 1, otherwise it is assigned a value of 0.
8. The 8-direction Sobel edge detection system based on FPGA as claimed in claim 1, characterized in that: The optimization module optimizes the edge detection result, and also includes: After traversing each first lens object, determining a plurality of second edge lines except the first edge line from the edge detection result; Traverse each second edge line in turn; During each traversal, the first edge line that meets the standard line relationship with the traversed second edge line is determined from the edge detection result and used as the third edge line; Extracting features from the traversed second edge line, the relative positional relationship between the traversed second edge line and the third edge line, and the third edge line to obtain a feature set; Constructing a feature description vector of the feature set; Determining a classification mark corresponding to the feature description vector from a preset classification mark library; After traversing each second edge line, classifying each second edge line into a plurality of edge line sets of the second lens object based on the classification mark; Traverse each second lens object in turn; During each traversal, based on a preset second edge line correction template corresponding to the traversed second lens object, the second edge line in the edge line set of the traversed second lens object is corrected and optimized.
