Optical polishing area accurate positioning system and method based on hybrid edge detection
By using a hybrid edge detection system that combines an improved Sobel operator and a lightweight U-Net network, the problem of large edge positioning errors in optical polishing areas is solved, achieving high-precision, real-time positioning of optical polishing areas and meeting the high real-time and interpretability requirements of industrial sites.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI YUDI PHOTOELECTRIC TECH CO LTD
- Filing Date
- 2026-04-03
- Publication Date
- 2026-07-14
AI Technical Summary
Existing technologies struggle to automatically extract edges in optically polished areas. Traditional methods suffer from large positioning errors in gradient transition areas and complex backgrounds. Deep learning models lack real-time performance and interpretability, failing to meet sub-pixel process control requirements.
An optical polishing region precision localization system based on hybrid edge detection is adopted. It combines an improved Sobel operator, a curvature adaptive anisotropic diffusion filter, a lightweight U-Net network, and a dynamic threshold optimizer to form a three-level cascaded hybrid architecture, which realizes edge feature enhancement, adaptive segmentation, and real-time correction.
It achieves sub-pixel level precise positioning, reduces the average positioning error to ±0.8 pixels, and achieves a segmentation accuracy of 95.2%, meeting the high real-time requirements of industrial sites, and is seamlessly integrated with existing optical analysis software.
Smart Images

Figure CN122391634A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of image processing and precision optical manufacturing technology, and in particular to a system and method for precise positioning of optical polishing areas based on hybrid edge detection. Background Technology
[0002] Optical surface polishing is a manufacturing process for high-end optical components. Polishing quality is the ultimate indicator of an optical system's imaging quality, energy conversion efficiency, and wavefront fidelity. In polishing process experiments and closed-loop operations, detecting and calculating the geometric boundaries and depth distribution of the polished area is fundamental for process parameter feedback and material removal calculations. Precision optical measurements such as Zygo interferometers can obtain and analyze nanometer-level surface height difference data. However, automatically extracting the polished area boundaries from data characterized by continuous morphology, blurred edges, and significant noise has long been a challenging problem in precision optical manufacturing.
[0003] Current optical surface data analysis methods primarily utilize traditional image processing workflows within commercial software (such as MetroPro). These methods largely employ classic gradient operators like Canny and Sobel for edge detection, followed by fixed thresholds or simple adaptive strategies for region segmentation. While these methods are barely applicable to ideal planes and low-curvature spheres, they are ineffective in handling the gradual transitions, low-contrast boundaries, and complex background interference commonly encountered in actual polishing processes. Firstly, because the polished area and the unpolished substrate typically exhibit a smooth transition rather than an abrupt change, traditional gradient operators respond very weakly, resulting in edge localization errors generally exceeding ±3 pixels, making it difficult to meet sub-pixel process control requirements. Secondly, fixed or global thresholds cannot adapt to local brightness differences caused by uneven illumination, variations in material reflectivity, or differences in surface curvature, easily leading to missegmentation or missed segmentation in high-noise or low-contrast areas. Furthermore, current methods generally neglect the local geometric structure information of optical surfaces, especially on high-curvature components such as aspherical and freeform surfaces. Because the influence of curvature on edge morphology is not considered, segmentation deformation, edge offset, and even invalid segmentation frequently occur.
[0004] In recent years, deep learning has been widely applied in image semantic segmentation, and network architectures such as U-Net have also been widely used in medical imaging and remote sensing. However, applying deep learning to optical polishing still presents many challenges. First, accurately labeled polishing samples are scarce, and labeling requires significant resources. Second, standard deep learning models have too many parameters and long inference latency, making it impossible to implement high-real-time analysis processes in industrial settings. Furthermore, the "black box" nature of deep learning models makes them incompatible with existing optical analysis software, resulting in numerous issues regarding interpretability, traceability, and integrability. Traditional image processing offers physical interpretability, while lightweight deep learning boasts high expressiveness, high precision, and high efficiency, while also enabling adaptive edge detection of surface geometric features. However, combining the advantages of both to resolve this key contradiction is precisely the solution presented in this invention. Summary of the Invention
[0005] This invention addresses the problems of current methods, such as the inability to extract the edges of optically polished areas, insensitivity to fixed threshold segmentation, and difficulty in recognizing high-curvature surfaces. It proposes a precise positioning system and method for optically polished areas based on hybrid edge detection. This system not only achieves sub-pixel precision positioning but also reduces the average positioning error from ±3 pixels to ±0.8 pixels, while achieving a segmentation accuracy of 95.2%. It also perfectly enables real-time processing and seamless integration with existing optical analysis software workflows.
[0006] To achieve the above objectives, the technical solution adopted is:
[0007] This invention provides a precise positioning system for optically polished areas based on hybrid edge detection, comprising an edge enhancement preprocessing module, a coarse segmentation processing unit, a fine adjustment processing unit, and a feedback regulator connected sequentially and forming a closed loop, wherein:
[0008] Edge enhancement preprocessing module for receiving the height difference matrix of optical surface polishing The height difference matrix is enhanced with edge features by a cascaded structure of an improved Sobel operator and a curvature adaptive anisotropic diffusion filter, and the gradient magnitude matrix is output. ;
[0009] The coarse segmentation processing unit, connected to the edge enhancement preprocessing module, is used to receive the gradient magnitude matrix. An adaptive threshold generation strategy based on the fusion of bimodal histogram analysis and Otsu's algorithm is used to perform initial binary segmentation on the gradient magnitude matrix, followed by optimization using morphological operations to output an initial segmentation mask. ;
[0010] The fine-tuning processing unit, connected to the coarse segmentation processing unit, includes a lightweight U-Net network and a dynamic threshold optimizer, and is used to receive the initial segmentation mask. and the original height difference matrix Edge probability maps are obtained by using a lightweight U-Net network for edge probability prediction. Dynamic threshold correction is performed by combining surface curvature continuity analysis to output the final segmentation mask. ;
[0011] A feedback regulator, connected to the fine-tuning processing unit and the edge enhancement preprocessing module, is used to dynamically adjust the processing parameters of the edge enhancement preprocessing module based on the edge continuity index (ECI).
[0012] According to the optical polishing region precise localization system based on hybrid edge detection of the present invention, the improved Sobel operator further employs a 5×5 extended convolution kernel. and Its operation process is defined as follows:
[0013]
[0014]
[0015] in, For pixel coordinates, , These are the row offset and column offset within the convolution kernel, respectively. These are the weights of the improved Sobel convolution kernel in the x-direction. These are the weights of the improved Sobel convolution kernel in the y-direction. It is the height difference matrix in position Pixel value at that location, In pixels The gradient component in the x-direction calculated at [location]. In pixels The gradient components in the y-direction are calculated at point ; the final gradient magnitude matrix is .
[0016] According to the optical polishing region precise positioning system based on hybrid edge detection of the present invention, the curvature adaptive anisotropic diffusion filter is further based on the Perona-Malik model, and its diffusion equation is:
[0017]
[0018] Where I is the gradient magnitude matrix, and t is the iteration number. It is the gradient operator of I. It is the divergence operator; the conduction coefficient ,in This represents the result of applying a Gaussian filter to image I and then calculating its gradient. The standard deviation is Gaussian kernel, It's the convolution operator, key parameter The adjustment rules are as follows , It is the preset maximum curvature value. It is the Gaussian curvature of the local surface.
[0019] According to the optical polishing region precise localization system based on hybrid edge detection of the present invention, the specific process of the adaptive threshold generation strategy is as follows: First, analyze the gradient magnitude matrix. If the histogram distribution shows obvious bimodalities and the peak-to-valley ratio is greater than 3:1, then the gray value corresponding to the valley position in the histogram is selected as the basic threshold. If there is no obvious bimodal distribution, the Otsu algorithm is used to calculate the globally optimal threshold as... Then, the curvature weighting factor is used to... Make corrections, the correction formula is as follows ,in The mean absolute Gaussian curvature of the current processing region. This is the curvature sensitivity coefficient.
[0020] According to the optical polishing region precise positioning system based on hybrid edge detection of the present invention, the mathematical expression of the morphological operation is further as follows:
[0021]
[0022] in, For threshold-based The generated initial binary mask, and These represent circular structural elements with radii of 2 and 3 pixels, respectively. This indicates the opening operation. This indicates the closing operation.
[0023] According to the optical polishing region precise localization system based on hybrid edge detection of the present invention, the lightweight U-Net network further employs depthwise separable convolutional layers as basic components, wherein the encoder contains four downsampling blocks, each of which consists of two depthwise separable convolutional layers and a 2×2 max pooling layer; the decoder contains four upsampling blocks, which fuse the multi-scale features of each stage of the encoder with the corresponding stage features of the decoder through skip connections; the network input is dual-channel data, namely the initial segmentation mask. and the original height difference matrix The stacking of the inputs produces a single-channel edge probability map with the same resolution as the input. , where each pixel value This indicates the probability that the pixel is located at the edge of the polished area.
[0024] According to the optical polishing region precise positioning system based on hybrid edge detection of the present invention, the correction process of the dynamic threshold optimizer is further as follows: firstly, based on the original height difference matrix... Calculate the Gaussian curvature matrix of the surface marginal probability graph Each candidate pixel Calculate the standard deviation of the curvature values within its 8-neighborhood. Then, an adaptive threshold is dynamically generated based on the local curvature change. ,in Based on the threshold, The coefficient for sensitivity to curvature changes; finally, through comparison... and Generate the final segmentation mask .
[0025] According to the optical polishing region precise positioning system based on hybrid edge detection of the present invention, the edge continuity index (ECI) is further defined as the total length of connected edge pixels. Total length of all detected edge pixels The ratio; the feedback regulator sets a quality threshold. When the ECI is less than the quality threshold, it determines that the current edge continuity is insufficient and sends a control command to the edge enhancement preprocessing module to increase the diffusion iteration number of the curvature adaptive anisotropic diffusion filter.
[0026] Furthermore, the present invention also provides a method for precise localization of optically polished regions based on hybrid edge detection, comprising the following steps:
[0027] S1: The height difference matrix of the optical surface polishing is obtained through a cascade structure of an improved Sobel operator and a curvature adaptive anisotropic diffusion filter. Perform edge feature enhancement and output gradient magnitude matrix. ;
[0028] S2: An adaptive threshold generation strategy based on the fusion of bimodal histogram analysis and Otsu's algorithm is used to generate the gradient magnitude matrix. Initial binary segmentation is performed, and the segmentation result is optimized through morphological operations of opening followed by closing to generate an initial segmentation mask. ;
[0029] S3: Apply the initial segmentation mask and the original height difference matrix As a dual-channel input, an edge probability map is obtained by performing edge probability prediction through a lightweight U-Net network. ;
[0030] S4: Combine surface curvature continuity analysis with the edge probability map Perform dynamic threshold correction and output the final segmentation mask. ;
[0031] S5: Calculate the final segmentation mask The edge continuity index (ECI) is used. When the ECI is lower than the preset threshold, the diffusion iteration number of the curvature adaptive anisotropic diffusion filter in step S1 is increased, and steps S1 to S4 are re-executed.
[0032] According to the precise positioning method for optically polished regions based on hybrid edge detection of the present invention, the height difference matrix further... The input resolution is 1024×1024 or 2048×2048, and each element in the matrix represents the height deviation at the corresponding pixel coordinates.
[0033] The beneficial effects achieved by adopting the above technical solution are:
[0034] 1. Significant Advantages of Hybrid Architecture: The innovative three-tiered cascaded hybrid architecture of "edge enhancement - coarse segmentation - fine adjustment" organically integrates the physical interpretability of traditional image processing with the high expressive power of lightweight deep learning. This successfully overcomes the challenge of locating blurred, gradient edges in optically polished areas, achieving sub-pixel-level precision. At 1024×1024 resolution, the average positioning error is reduced from ±3 pixels using traditional methods to ±0.8 pixels, and the segmentation accuracy of multi-point polished areas is improved from 78.5% to 95.2%, far exceeding the accuracy levels of existing technologies.
[0035] 2. Strong adaptability of threshold optimization: A dynamic threshold optimization mechanism based on surface Gaussian curvature is introduced. The segmentation threshold can be adaptively adjusted according to measurement conditions, surface curvature and local geometric features, which completely solves the problem of missegmentation and missed segmentation that easily occurs on low contrast, high noise and high curvature surfaces by traditional fixed thresholds, and greatly improves the segmentation reliability under complex working conditions.
[0036] 3. Real-time integration, high efficiency and convenience: The lightweight U-Net network is constructed using deep separable convolution, which effectively reduces model parameters and computational complexity while maintaining the deep learning model's ability to recognize complex edge patterns. This allows the entire system to achieve real-time processing on ordinary industrial computers (only 120ms for a single 1024×1024 image) and seamlessly integrates with existing optical analysis software workflows, meeting the high real-time and scalability requirements of industrial sites.
[0037] 4. Stable and reliable feedback adjustment: A closed-loop feedback adjustment system based on the edge continuity index (ECI) is constructed, which can dynamically adjust the processing parameters in the edge enhancement preprocessing module according to the quality of the output results. When the ECI is lower than the preset threshold, the diffusion iteration number is automatically increased, which can effectively cope with the working conditions of different noise levels and surface quality, and ensure that the system can maintain stable processing robustness and result consistency in various scenarios, and realize adaptive and self-optimizing intelligent polishing area positioning. Attached Figure Description
[0038] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings of the embodiments of the present invention will be briefly described below. The drawings are merely illustrative of some embodiments of the present invention and are not intended to limit the scope of the present invention to all embodiments.
[0039] Figure 1 This is a schematic diagram of the optical polishing area precise positioning system based on hybrid edge detection according to Embodiment 1 of the present invention;
[0040] Figure 2 This is a schematic diagram of the principle framework of the "edge enhancement-coarse segmentation-fine adjustment" three-level cascaded hybrid architecture in Embodiment 1 of the present invention;
[0041] Figure 3 This is a flowchart of the feedback adjustment closed-loop logic based on the Edge Continuity Index (ECI) in Embodiment 1 of the present invention. Detailed Implementation
[0042] The exemplary solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Unless otherwise defined, the technical or scientific terms used in this invention should have the ordinary meaning understood by one of ordinary skill in the art.
[0043] Example 1
[0044] In the polishing process of optical components, the surface morphology of the optical component is first obtained, followed by the shape of the area to be polished, and then polishing. The surface morphology to be polished is generally gradually darkening, with large height differences and high edge contrast, and the surface morphology is relatively intact and generally flat. When blurring the edges, it is necessary to blur the edges to avoid false detection, over-segmentation, etc., which will significantly reduce the accuracy and efficiency of subsequent polishing path generation.
[0045] This invention discloses a precise positioning system for optical polishing areas based on hybrid edge detection, comprising an edge enhancement preprocessing module, a coarse segmentation processing unit, a fine adjustment processing unit, and a feedback regulator. These modules are sequentially connected to form a closed-loop processing architecture. Figure 1 and Figure 2 As shown, the details are as follows:
[0046] (1) Edge enhancement preprocessing module: receives the height difference matrix of optical surface polishing. Edge feature enhancement of the height difference matrix is achieved through a cascaded structure of an improved Sobel operator and a curvature-adaptive anisotropic diffusion filter, outputting a gradient magnitude matrix. .
[0047] The system first preprocesses the surface topography data obtained from the optical measurement equipment using an edge enhancement preprocessing module. The data is presented as a height difference matrix. The input format is called "form input". The matrix size is usually either 1024×1024 or 2048×2048. Each element in the matrix... Represents pixel coordinates The height deviation at the location is in nanometers; the main purpose of this module is to enhance the weak edge features between the polished area and the background, while filtering out noise. Its internal structure is a cascade structure of an improved Sobel operator and a curvature adaptive anisotropic diffusion filter. The improved Sobel operator is a 5×5 extended convolution kernel with better sensitivity instead of the standard 3×3 Sobel kernel used in conventional applications. It has better detail perception ability, as well as better directional selectivity and resistance to optical polishing.
[0048] The improved Sobel operator uses a 5×5 extended convolution kernel. and Compared to the standard 3×3 Sobel kernel, it has a larger receptive field and stronger directional selectivity, enhancing the gradient response to gently sloping edges in optically polished regions. Its kernel weight distribution is optimized, resulting in a gradient response intensity at least 30% higher for gently sloping edges on optical surfaces compared to the standard Sobel operator. The computational process of the improved Sobel operator is defined as follows:
[0049] For the input height difference matrix Each pixel Calculate its in direction and gradient components of direction and .
[0050] in, The calculation is as follows:
[0051]
[0052] same, The calculation is as follows:
[0053]
[0054] in, For pixel coordinates, It is a row index. It is a column index. , These are the row offset and column offset within the convolution kernel, respectively. These are the weights of the improved Sobel convolution kernel in the x-direction. These are the weights of the improved Sobel convolution kernel in the y-direction. It is the height difference matrix in position The pixel value at that location; then the gradient magnitude matrix of that pixel can be obtained. .
[0055] Traversing the entire matrix yields the preliminary gradient magnitude matrix. ,but There is still a lot of noise, which needs to be addressed. The input is fed into a curvature-adaptive anisotropic diffusion filter for noise reduction. The filter is based on the Perona-Malik model, and its diffusion equation is:
[0056]
[0057] Where I is the gradient magnitude matrix, and t is the iteration number. It is the gradient operator of I. It is the divergence operator. The conduction coefficient is:
[0058]
[0059] in, This represents the result of applying a Gaussian filter to image I and then calculating its gradient. The standard deviation is Gaussian kernel, It is the convolution operator. It is the gradient operator.
[0060] This solution innovatively proposes key parameters. The system employs a dynamic adjustment method. First, it adjusts the system based on the original height difference matrix. Calculate the Gaussian curvature of each pixel. The Gaussian curvature of an optical surface point reflects the local surface curvature. For polished edges or high-curvature aspherical regions, detail needs to be preserved, therefore diffusion should be reduced. In flat and low-curvature regions, diffusion can be stronger to eliminate noise. Key parameters in the conduction coefficient... Based on the Gaussian curvature of the local surface Dynamic adjustment, the adjustment rules are as follows:
[0061]
[0062] in, This is the preset maximum curvature value, optimized to a range of 0.05 to 0.2 during implementation. This filter design adaptively changes its smoothness based on the surface's geometric properties, effectively smoothing noise while preserving as much realistic edge information as possible. The output gradient magnitude matrix is preset to be obtained after 5 iterations of diffusion. .
[0063] (2) Coarse segmentation processing unit: connected to the edge enhancement preprocessing module, used to receive the gradient magnitude matrix. An adaptive threshold generation strategy based on the fusion of bimodal histogram analysis and Otsu's algorithm is adopted to perform initial binary segmentation on the gradient magnitude matrix. Then, morphological operations are used to optimize the segmentation result and output an initial segmentation mask. .
[0064] The coarse segmentation processing unit receives the gradient magnitude matrix output by the edge enhancement preprocessing module. This module obtains an overall adaptive segmentation threshold to segment the binary image of the gradient image. The adaptive threshold generation strategy implemented by this module is mainly a fusion of the histogram bimodal test and Otsu threshold segmentation.
[0065] The specific process of the adaptive threshold generation strategy is as follows: First, obtain the gradient magnitude matrix. The grayscale histogram is analyzed, and the grayscale distribution characteristics are determined. If a clear bimodal phenomenon exists in the grayscale histogram, and the ratio of the valley value (trough) between the two main peaks to the peak value of the lower main peak is less than 3:1, then it is considered that there is a significant difference between the background and the foreground, and the grayscale value corresponding to the valley position in the grayscale histogram is directly selected. That's sufficient. However, if the histogram lacks bimodal characteristics or the bimodality is not obvious (common in images with extremely low contrast), the Otsu algorithm is used to calculate the inter-class variance. The threshold with the largest inter-class variance is used as the optimal segmentation threshold. To improve the threshold's adaptability to different surface curvature regions, the system introduces a curvature weighting factor. The correction is performed using the following formula:
[0066]
[0067] in, The mean absolute Gaussian curvature of the current processing region. This is the curvature sensitivity coefficient, with a default value of 0.2 and a range of 0.1 to 0.3. This correction ensures that a slightly higher threshold is used in high curvature regions (where edges are more likely to be blurred) to reduce noise-induced false positives, while a standard threshold is used in low curvature regions. Then, the corrected threshold is... Applied to gradient magnitude matrix Binarization is performed on the top layer to obtain the initial binary mask. ,but Often, numerous isolated foreground spots caused by residual noise and pores within small polished areas due to discontinuous thresholding appear. Therefore, the system performs an opening-then-closing morphological operation on these areas, the mathematical expression of which is:
[0068]
[0069] in, For threshold-based The generated initial binary mask, and These represent circular structural elements with radii of 2 and 3 pixels, respectively. This indicates the opening operation. This indicates the closing operation. The operation uses a circular structuring element with a radius of 2 pixels. Corrosion followed by expansion filters out isolated noise spots with an area smaller than the structural element. The operation uses a circular structuring element with a radius of 3 pixels. First, expansion and then erosion are performed to fill the pores smaller than the structural elements within the region, and to smooth the region boundaries. After these operations, isolated foreground points caused by noise are removed, and small pores within the polished region caused by discontinuities in threshold segmentation are filled, resulting in an initial segmentation mask with better connectivity and significantly reduced noise. .
[0070] (3) Fine-tuning processing unit: connected to the coarse segmentation processing unit, including a lightweight U-Net network and a dynamic threshold optimizer, used to receive the initial segmentation mask. and the original height difference matrix Edge probability maps are obtained by using a lightweight U-Net network for edge probability prediction. Dynamic threshold correction is performed by combining surface curvature continuity analysis to output the final segmentation mask. .
[0071] The fine-tuning processing unit is the core component for improving positioning accuracy, receiving the initial segmentation mask output from the coarse segmentation module. and the original height difference matrix acquired by optical measurement equipment The two matrices are stacked to obtain a multi-channel data tensor, which serves as the input to the lightweight U-net network. The main structure of the lightweight U-net network retains the encoder-decoder structure of the standard U-net, but to meet the real-time performance requirements of industrial environments, depthwise separable convolutional layers are used instead of standard convolutional layers as the basic structural blocks. The encoder contains four downsampling blocks, each consisting of two depthwise separable convolutional layers and a 2×2 max-pooling layer, progressively extracting and compressing features, with the number of channels increasing sequentially to 32, 64, 128, and 256. The decoder contains four upsampling blocks, each upsampling by a 2×2 transposed convolutional layer, then bidirectionally exponentially paired with fragments of the encoder's transposed feature map, and the channels are concatenated. Finally, two depthwise separable convolutional layers fuse the features. The network finally generates a single-channel edge probability map with the same resolution as the input (e.g., 1024×1024) using a 1×1 convolutional layer and a sigmoid activation function. , where each pixel value Represents pixels The probability of finding the precise edge of the polished area. The lightweight design reduces the number of model parameters to less than 35% of the standard U-net, reducing computational cost while retaining the ability to recognize complex and blurred edge patterns.
[0072] Marginal probability graph This explains the sub-pixel level edge probabilities. Directly using a fixed threshold (e.g., 0.5) for binarization may still introduce errors in areas with significant curvature variations and noise. Therefore, the system further incorporates a dynamic threshold optimizer for curvature-adaptive threshold correction, first based on the original height difference matrix. The Gaussian curvature matrix of the entire surface is calculated precisely using differential geometry. Then, for the marginal probability map Each candidate pixel Examine the Gaussian curvature values in its 8-neighborhood (3×3 window) and calculate the standard deviation of the curvature values. , It represents the degree of drastic change in the surface geometry of a local area of that pixel. The more gradual the curvature change (such as the interior of a polished area, a completely flat background, etc.), the more drastic the change. The smaller the value, the better, especially in areas with significant curvature changes (real or false edges). The larger. Then, according to Dynamically calculate the adaptive threshold for this pixel. The calculation formula is as follows:
[0073]
[0074] in, The base threshold is 0.5 by default. The curvature change sensitivity is set to 0.3 by default and can be adjusted between 0.2 and 0.4. The physical meaning of the formula is to lower the decision threshold in areas of large curvature changes (potentially true edges), allowing more edge probability responses to pass and preventing missed detections; conversely, to raise the effective decision threshold in areas of small curvature changes, suppressing high-probability edge false positives caused by noise and preventing false positives. Finally, [the formula is missing from the original text]. and Pixel by pixel is compared to generate the final segmentation mask. :like ≥ ,but (Edge); otherwise (Background or interior). This mask represents the precisely positioned boundary of the polished area.
[0075] (4) Feedback regulator: Connected to the fine-tuning processing unit and the edge enhancement preprocessing module, it is used to dynamically adjust the processing parameters of the edge enhancement preprocessing module based on the edge continuity index (ECI). The feedback regulation closed-loop logic flow is as follows: Figure 3 As shown.
[0076] The feedback regulator forms the closed-loop regulation circuit of the system. This module continuously monitors the final segmentation mask output by the fine-tuning processing unit. Its key evaluation parameter is the Edge Continuity Index (ECI):
[0077] ECI= /
[0078] in, It refers to the total physical length of all connected edge pixels (obtained by marking the edge pixels with 8 connected components and summing the perimeters of each connected component). This refers to the total length of all detected edge pixels (simply count the number of edge pixels). The closer the Edge Continuity Index (ECI) is to 1, the better the detected edge continuity and the fewer breaks. The closed-loop adjustment system sets a quality threshold of 0.85. During continuous processing (e.g., processing 5 height difference matrices as a batch, calculating the average ECI of the batch results, and determining whether to send parameter adjustment commands based on the comparison between the average ECI and the quality threshold), the feedback regulator calculates the average error of the current batch results. If the ECI < 0.85, the edges are discontinuous, and the feedback regulator immediately sends a control signal to the edge enhancement preprocessing module, increasing the diffusion iteration count of its internal curvature adaptive anisotropic diffusion filter by 2. An increased diffusion count means more thorough smoothing, further suppressing noise and the true edge structure. The system then continues processing current or subsequent data based on the adjusted parameters. This feedback adjustment based on output quality enables the system to automatically adjust for parts with different noise levels and surface qualities, maintaining high-precision and stable output.
[0079] Based on the above system, this invention also discloses a method for precise localization of optically polished regions based on hybrid edge detection, the method comprising the following steps:
[0080] Step S1: The height difference matrix of the optical surface polished is obtained through a cascade structure of an improved Sobel operator and a curvature adaptive anisotropic diffusion filter. Perform edge feature enhancement and output gradient magnitude matrix. This step includes gradient calculation of a 5×5 improved Sobel convolution kernel and anisotropic diffusion filtering based on dynamically changing parameters according to local Gaussian curvature.
[0081] Step S2: Based on the adaptive threshold generation strategy that combines bimodal histogram analysis and the Otsu algorithm, the gradient magnitude matrix is processed. Initial binary segmentation is performed, and the segmentation result is optimized through morphological operations of opening followed by closing to generate an initial segmentation mask. This step includes operations such as histogram testing, Otsu threshold calculation, curvature weight correction, binarization, and boundary condition calculation.
[0082] Step S3: Apply the initial segmentation mask and the original height difference matrix As a dual-channel input, an edge probability map is obtained by performing edge probability prediction through a lightweight U-Net network. This step includes sub-steps such as dual-channel data stacking, feature extraction from the lightweight U-net network encoder, feature fusion and upsampling from the lightweight U-net network decoder, and probabilistic graph generation.
[0083] Step S4: Combine surface curvature continuity analysis with the edge probability map Perform dynamic threshold correction and output the final segmentation mask. This step includes details about the Gaussian curvature matrix. Calculation of local curvature standard deviation Calculation and adaptive threshold The process includes dynamic calculations and pixel-by-pixel threshold comparisons to generate the final mask, among other sub-steps.
[0084] Step S5: Calculate the final segmentation mask. The edge continuity index (ECI) is used. When the ECI is lower than a preset threshold, the diffusion iteration number of the curvature adaptive anisotropic diffusion filter in step S1 is increased, and steps S1 to S4 are re-executed. This step includes sub-steps such as ECI calculation, threshold comparison logic, and generation and sending of parameter adjustment instructions, thereby completing a complete closed-loop cycle of processing-evaluation-optimization.
[0085] Example 2
[0086] This embodiment mainly introduces the specific application and parameter adjustment of the present invention for large-aperture, high-steepness non-spherical optical elements and the positioning of optical elements in polished areas. Because the curvature variation of the surface of such components is very large, traditional edge detection techniques result in overly smooth, flat areas and a loss of detail in edge regions. To address this, in the edge enhancement preprocessing module, for the curvature adaptive anisotropic diffusion filter, to preserve sufficient detail in steep regions, the maximum curvature parameter... The value is set to 0.15. Meanwhile, to ensure higher stability under high interference conditions, the initial number of diffusion iterations is set to 7. In implementing the adaptive threshold generation strategy in the coarse segmentation processing unit, the curvature bending sensitivity coefficient can be... Adjusted to 0.25. This is because... A higher value allows the threshold to be more suitable for different curvature regions. To accommodate larger feature scales, the radius of the structural element can be adjusted. Used for opening operations, adjusting the radius to That is, execution .
[0087] During training, the lightweight U-net network used in the fine-tuning processing unit introduced a large amount of steep, non-spherical sample data, enabling the network weights to recognize such surface features. Furthermore, the base threshold of the dynamic threshold optimizer... It can be set to 0.5, and the curvature change sensitivity can be adjusted. Adjusting it to 0.35 makes the threshold more sensitive to areas of large curvature changes. This is the mass threshold of the feedback regulator. This can be relaxed to 0.82 because steep surfaces inherently possess geometric discontinuities, resulting in numerous cracks at the ideal edges. In addition to the number of diffusion iterations, the curvature sensitivity coefficient can be adjusted via feedback-based adjustment of the action. For example, when ECI is low and there are many edge cracks in the low-bending region, The value can be appropriately reduced. After parameter adjustment, the system can effectively handle highly steep aspherical mirrors with apertures exceeding 500 mm and a difference of hundreds of micrometers from spherical surfaces. It strictly follows the sequential processing steps of S110-S150. Experiments have shown that for such a complex surface, the method of this invention performs excellently in positioning the polished area, with an average positioning error of less than ±1.2 pixels and a stability rate exceeding 92%. In contrast, the traditional method combining Canny operation and fixed threshold segmentation has an average error of approximately ±5 pixels and an accuracy rate of only about 70%. Therefore, compared with traditional methods, the method used in this invention has significant advantages and can meet the positioning accuracy requirements of high-end optical manufacturing.
[0088] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A precise positioning system for optically polished areas based on hybrid edge detection, characterized in that, It includes an edge enhancement preprocessing module, a coarse segmentation processing unit, a fine adjustment processing unit, and a feedback regulator, which are connected in sequence to form a closed loop. Edge enhancement preprocessing module for receiving the height difference matrix of optical surface polishing The height difference matrix is enhanced with edge features by a cascaded structure of an improved Sobel operator and a curvature adaptive anisotropic diffusion filter, and the gradient magnitude matrix is output. ; The coarse segmentation processing unit, connected to the edge enhancement preprocessing module, is used to receive the gradient magnitude matrix. An adaptive threshold generation strategy based on the fusion of bimodal histogram analysis and Otsu's algorithm is used to perform initial binary segmentation on the gradient magnitude matrix, followed by optimization using morphological operations to output an initial segmentation mask. ; The fine-tuning processing unit, connected to the coarse segmentation processing unit, includes a lightweight U-Net network and a dynamic threshold optimizer, and is used to receive the initial segmentation mask. and the original height difference matrix Edge probability maps are obtained by using a lightweight U-Net network for edge probability prediction. Dynamic threshold correction is performed by combining surface curvature continuity analysis to output the final segmentation mask. ; A feedback regulator, connected to the fine-tuning processing unit and the edge enhancement preprocessing module, is used to dynamically adjust the processing parameters of the edge enhancement preprocessing module based on the edge continuity index (ECI).
2. The optical polishing region precise positioning system based on hybrid edge detection according to claim 1, characterized in that, The improved Sobel operator uses a 5×5 extended convolution kernel. and Its operation process is defined as follows: in, For pixel coordinates, , These are the row offset and column offset within the convolution kernel, respectively. These are the weights of the improved Sobel convolution kernel in the x-direction. These are the weights of the improved Sobel convolution kernel in the y-direction. It is the height difference matrix in position Pixel value at that location, In pixels The gradient component in the x-direction calculated at [location]. In pixels The gradient components in the y-direction are calculated at point ; the final gradient magnitude matrix is .
3. The optical polishing region precise positioning system based on hybrid edge detection according to claim 2, characterized in that, The curvature-adaptive anisotropic diffusion filter is based on the Perona-Malik model, and its diffusion equation is: Where I is the gradient magnitude matrix, and t is the iteration number. It is the gradient operator of I. It is the divergence operator; the conduction coefficient ,in This represents the result of applying a Gaussian filter to image I and then calculating its gradient. The standard deviation is Gaussian kernel, It's the convolution operator, key parameter The adjustment rules are as follows , It is the preset maximum curvature value. It is the Gaussian curvature of the local surface.
4. The optical polishing region precise positioning system based on hybrid edge detection according to claim 1, characterized in that, The specific process of the adaptive threshold generation strategy is as follows: First, analyze the gradient magnitude matrix. If the histogram distribution shows obvious bimodalities and the peak-to-valley ratio is greater than 3:1, then the gray value corresponding to the valley position in the histogram is selected as the basic threshold. ; If there is no obvious bimodal distribution, the Otsu algorithm is used to calculate the globally optimal threshold as... Then, the curvature weighting factor is used to... Make corrections, the correction formula is as follows ,in The mean absolute Gaussian curvature of the current processing region. This is the curvature sensitivity coefficient.
5. The optical polishing region precise positioning system based on hybrid edge detection according to claim 4, characterized in that, The mathematical expression for the morphological operation is: in, For threshold-based The generated initial binary mask, and These represent circular structural elements with radii of 2 and 3 pixels, respectively. This indicates the opening operation. This indicates the closing operation.
6. The optical polishing region precise positioning system based on hybrid edge detection according to claim 1, characterized in that, The lightweight U-Net network uses depthwise separable convolutional layers as its basic components. The encoder contains four downsampling blocks, each consisting of two depthwise separable convolutional layers and a 2×2 max-pooling layer. The decoder contains four upsampling blocks, which fuse multi-scale features from each stage of the encoder with corresponding features from the decoder through skip connections. The network input is dual-channel data, namely the initial segmentation mask. and the original height difference matrix The stacking of the inputs produces a single-channel edge probability map with the same resolution as the input. , where each pixel value This indicates the probability that the pixel is located at the edge of the polished area.
7. The optical polishing region precise positioning system based on hybrid edge detection according to claim 6, characterized in that, The calibration process of the dynamic threshold optimizer is as follows: First, based on the original height difference matrix... Calculate the Gaussian curvature matrix of the surface marginal probability graph Each candidate pixel Calculate the standard deviation of the curvature values within its 8-neighborhood. Then, an adaptive threshold is dynamically generated based on the local curvature change. ,in Based on the threshold, The coefficient for sensitivity to curvature changes; finally, through comparison... and Generate the final segmentation mask .
8. The optical polishing region precise positioning system based on hybrid edge detection according to claim 1, characterized in that, The Edge Continuity Index (ECI) is defined as the total length of connected edge pixels. Total length of all detected edge pixels The ratio; the feedback regulator sets a quality threshold. When the ECI is less than the quality threshold, it determines that the current edge continuity is insufficient and sends a control command to the edge enhancement preprocessing module to increase the diffusion iteration number of the curvature adaptive anisotropic diffusion filter.
9. A method for precise localization of optically polished regions based on hybrid edge detection, characterized in that, Includes the following steps: S1: The height difference matrix of the optical surface polishing is obtained through a cascade structure of an improved Sobel operator and a curvature adaptive anisotropic diffusion filter. Perform edge feature enhancement and output gradient magnitude matrix. ; S2: An adaptive threshold generation strategy based on the fusion of bimodal histogram analysis and Otsu's algorithm is used to generate the gradient magnitude matrix. Initial binary segmentation is performed, and the segmentation result is optimized through morphological operations of opening followed by closing to generate an initial segmentation mask. ; S3: Apply the initial segmentation mask and the original height difference matrix As a dual-channel input, an edge probability map is obtained by performing edge probability prediction through a lightweight U-Net network. ; S4: Combine surface curvature continuity analysis with the edge probability map Perform dynamic threshold correction and output the final segmentation mask. ; S5: Calculate the final segmentation mask The edge continuity index (ECI) is used. When the ECI is lower than the preset threshold, the diffusion iteration number of the curvature adaptive anisotropic diffusion filter in step S1 is increased, and steps S1 to S4 are re-executed.
10. The method for precise positioning of optical polishing regions based on hybrid edge detection according to claim 9, characterized in that, The height difference matrix The input resolution is 1024×1024 or 2048×2048, and each element in the matrix represents the height deviation at the corresponding pixel coordinates.