AI edge detection method and system for oversized image

By setting ROI regions in ultra-large images and constructing dual-input images, and combining AI models to optimize edge detection, the accuracy and efficiency problems of industrial image measurement in complex scenarios are solved, and high-precision automated detection is achieved.

CN121582279APending Publication Date: 2026-02-27NANJING MUMUSILI TECH CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511565833.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-30
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

Existing technologies suffer from poor adaptability to complex scenes, high reliance on manual intervention, and bottlenecks in processing ultra-large industrial images, resulting in low detection accuracy and efficiency. Furthermore, deep learning-based edge detection models cannot be directly applied to industrial measurement.

Method used

An AI edge detection method for ultra-large images is adopted. By setting ROI regions, the image is evenly divided into small rectangular regions. A dual-input image is constructed and combined with an AI model. AI inference and edge optimization are performed simultaneously, and edge points are integrated and fitted. The edge points are then converted into physical dimensions by combining camera intrinsic parameters.

Benefits of technology

It achieves efficient processing of images of 10,000×10,000 pixels and above, ensuring the continuity, uniqueness and non-overlap of edge points, meeting the high precision and automation requirements of industrial measurement, and reducing manual intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121582279A_ABST
    Figure CN121582279A_ABST
Patent Text Reader

Abstract

The invention discloses an AI edge detection method and system for an oversized image, and belongs to the technical field of industrial image measurement. The method comprises the steps of ROI region setting, ROI region segmentation, double-input image construction, AI model reasoning and synchronous edge optimization processing, primitive fitting, physical size conversion and the like. According to the method, the problems of low edge extraction precision, poor processing efficiency, difficulty in adapting to a standardized measurement process and the like in a weak contrast, high noise and multi-edge scene in oversized image edge detection are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of industrial image measurement technology, and is specifically applied to edge detection and geometric measurement of ultra-large industrial images. Background Technology

[0002] The current common technical approach for industrial image measurement is a three-step process: "human interaction - region processing - primitive fitting". Human interaction stage: Users draw the region of interest (ROI) of the graphic element to be measured (straight line, circle, arc) through the device interface. For example, when measuring the pins of dense electronic components, the rectangular ROI containing the edge of the target pin is selected. Region processing stage: The ROI is divided into multiple small regions, and gradient detection methods (such as Canny operator, Sobel operator, sub-pixel edge algorithm) are used to extract edge points. The core logic is that "the pixel with the largest gray-scale gradient value is the edge point". Primitive fitting stage: Fit lines, circles, and arcs to the edge points of all small regions, calculate and output size parameters (such as spacing, diameter, and angle).

[0003] This approach faces three unavoidable pain points in industrial scenarios: Poor adaptability to complex scenarios: In scenarios with low contrast (such as the edge of anodized metal surface, blurred edges of plastic injection molding), high noise (such as workshop dust interference, camera sensor noise), and multiple overlapping edges (such as dense pins, multi-layer board stacking), gradient detection method only relies on local gray-scale changes and lacks global feature association, which easily misjudges noise as edges or misses real edges. High dependence on manual labor: The above complex scenarios require manual correction of edge points. Differences in experience among different operators can lead to large measurement repeatability errors and low efficiency, making it difficult to meet the high-efficiency inspection requirements of automated production lines. Bottlenecks in ultra-large image processing: Image measurement often requires processing ultra-large images of 20,000×20,000 pixels, or even 100,000×100,000 pixels. Traditional solutions employ "image downsizing" or "fixed slicing." Image downsizing directly leads to a loss of edge positioning accuracy; for example, after a 10x reduction, the pixel-level error increases from 0.001 mm / pixel to 0.01 mm / pixel, failing to meet high-precision measurement requirements. Fixed slicing disrupts the spatial continuity of edges (e.g., long edges across slices are truncated), resulting in large deviations in the fitted primitives and affecting the accuracy of size determination.

[0004] In recent years, edge detection technology based on deep learning has made breakthroughs in natural scenes (street scenes, portraits), but it is difficult to directly transfer to industrial image measurement. On the one hand, most existing AI models have an input size of ≤1000×1000 pixels, which cannot directly process ultra-large images of 10,000×10,000 pixels. Forcing such input will lead to GPU memory overflow (e.g., a 10,000×10,000 pixel 3-channel image requires about 1.1GB of video memory, far exceeding the 2GB video memory limit of ordinary industrial equipment GPUs). On the other hand, the edge points output by AI models often have problems such as "discretization" (the distance between adjacent points exceeds 5 pixels), "multiple points within a column" (more than 2 candidate points appear in the same column), and "edge overlap" (different edges are nested). These problems cannot be directly connected to the standardized process of industrial measurement and still require manual intervention for correction, thus failing to achieve true automation. Summary of the Invention

[0005] To address the technical problems mentioned in the background section, this invention proposes an AI edge detection method and system for ultra-large images.

[0006] To achieve the above-mentioned technical objectives, the technical solution of the present invention is as follows: An AI edge detection method for ultra-large images includes the following steps: (1) For the ultra-large image to be measured, set the ROI region and measurement parameters; (2) Divide the ROI region into several rectangular small regions evenly, ensuring that each rectangular small region contains complete local edge features, and record the coordinate mapping relationship of each rectangular small region in the ultra-large image to be tested; (3) Construct a dual-input image for each rectangular region. One input image is a combination image of the rectangular region and its left and right adjacent regions, used to extract global edge features across regions. When the rectangular region is the first and last region, the rectangular region is missing one side of the adjacent region. Then the rectangular region and the two adjacent regions on the other side form a combination image. The other input image is the original image of the rectangular region, used to extract local detail features of the edge. (4) Input the dual-input image into the AI ​​model, perform AI inference and edge optimization simultaneously, determine the effective edge points of each rectangular small region, and obtain the coordinates of each effective edge point through the aforementioned coordinate mapping relationship; (5) Integrate all valid edge points of the rectangular small regions and fit them as corresponding primitives; (6) Combine the camera intrinsic parameters to convert the fitted primitive parameters into physical dimensions to obtain the detection results.

[0007] Further, in step (1), the measurement parameters include a confidence screening threshold, an edge continuity threshold, and an edge non-overlap threshold.

[0008] Further, in step (4), the AI ​​inference outputs a confidence map and a pixel-level two-dimensional feature vector map for each rectangular small region. Each pixel value on the confidence map represents the probability that the pixel is a true edge, and the two-dimensional vector of each pixel on the pixel-level two-dimensional feature vector map represents the feature correlation between the pixel and the surrounding pixels.

[0009] Further, in step (4), the edge optimization includes: based on the confidence map and the confidence screening threshold, retaining candidate edge points with a confidence greater than the confidence screening threshold; for each candidate edge point, calculating its feature response intensity, performing non-maximum suppression processing on each column of the image, and retaining only the candidate edge point with the largest feature response intensity.

[0010] Furthermore, the feature response intensity is the cosine similarity between the feature vector of the candidate edge point and the pre-trained edge template vector, and the pre-trained edge template vector is the feature mean obtained through a large number of edge samples.

[0011] Furthermore, in step (4), the edge optimization also includes: after obtaining the candidate edge points that have undergone non-maximum suppression processing, calculating the longitudinal distance between adjacent candidate edge points based on the pixel-level two-dimensional feature vector map and the edge continuity threshold. If the longitudinal distance is greater than the edge continuity threshold, it is determined to be an edge break, and break points need to be added at the break point to ensure that the edge is continuous and without breakage.

[0012] Furthermore, the step of supplementing the fracture point at the fracture site involves generating the missing edge point in the middle through linear interpolation based on the feature vectors of the edge points on both sides of the fracture site.

[0013] Further, in step (4), the edge optimization also includes: after obtaining candidate edge points that have undergone non-maximum suppression processing, the candidate edge points are clustered to obtain edge clusters, and based on the edge non-overlap threshold, it is determined whether two adjacent edge clusters are potentially overlapping. For two edge clusters that are potentially overlapping, the confidence sum of all points in the two clusters is calculated respectively, and the edge cluster with the higher confidence sum is retained, while the edge cluster with the lower confidence sum is removed.

[0014] Furthermore, the edge non-overlapping threshold includes an edge non-overlapping area threshold and an edge non-overlapping spacing threshold. The minimum bounding rectangle of the edge cluster is calculated. If the overlapping area of ​​the minimum bounding rectangles of two edge clusters is greater than the edge non-overlapping area threshold, or the minimum pixel distance between clusters is less than the edge non-overlapping spacing threshold, then it is determined to be a potential cross-overlapping.

[0015] Secondly, the present invention also relates to an AI edge detection system for ultra-large images, comprising: ROI settings module: Used to set the ROI region and measurement parameters for ultra-large images to be measured; ROI segmentation module: used to uniformly divide the ROI region into several rectangular small regions, ensuring that each rectangular small region contains complete local edge features, and recording the coordinate mapping relationship of each rectangular small region in the ultra-large image to be tested; Dual-input construction module: Used to construct dual-input images for each rectangular region. One input image is a combined image of the rectangular region and its left and right adjacent regions, used to extract global edge features across regions. When the rectangular region is the first and last region, it is missing one side of its adjacent region, so the rectangular region is combined with the two regions immediately adjacent to the other side to form a combined image. The other input image is the original image of the rectangular region, used to extract local detail features of the edges. AI inference module: used to input the dual-input image into the AI ​​model, simultaneously perform AI inference and edge optimization, determine the effective edge points of each rectangular small region, and obtain the coordinates of each effective edge point through coordinate mapping relationship; Primitive Fitting Module: Used to integrate all valid edge points of small rectangular regions and fit them into corresponding primitives; Measurement output module: Used to combine camera intrinsic parameters to convert the fitted primitive parameters into physical dimensions and obtain the detection results.

[0016] The beneficial effects of adopting the above technical solution are as follows: This invention supports efficient processing of ultra-large images of 10,000 x 10,000 pixels and above, balancing local details and global features to avoid loss of accuracy and efficiency degradation. Multiple constraints and supporting processing mechanisms are designed to ensure that the edge points output by the AI ​​meet the requirements of "continuity, column uniqueness, and non-overlap," directly adapting to standardized industrial measurement processes, completely reducing manual intervention and achieving automation. This invention improves the robustness of edge detection in complex scenes, maintaining stable output of high-precision edge points even in low-contrast, high-noise, and multi-edge scenarios, meeting the accuracy requirements of industrial-grade measurements. Attached Figure Description

[0017] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation

[0018] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings.

[0019] This embodiment uses the measurement of the pin spacing of electronic components as an example for illustration. Figure 1 As shown, the process of this invention is as follows.

[0020] Step 1: User sets ROI region Input: A super-large image of electronic components (12000×8000 pixels, including 10 groups of pins, each with 2 parallel edges).

[0021] Operation: The user selects the ROI region of the first group of pins on the visualization interface using the mouse, with coordinates (x1=2000, y1=3000, x2=4000, y2=3500). Simultaneously, the measurement parameters are set as follows: Edge continuity threshold = 3 pixels, Edge non-overlapping area threshold = 5% of the area of ​​the smallest bounding rectangle of the smaller edge cluster, Edge non-overlapping spacing threshold = 5 pixels, Confidence filtering threshold = 0.7.

[0022] Output: ROI region (2000×500 pixels), measurement parameter configuration.

[0023] Step 2: ROI region segmentation Segmentation rules: Based on the principle of preserving local details, the 2000×500 ROI region is evenly divided into 20 small rectangular regions of 100×50 pixels (region number 1-20), ensuring that each small region contains complete local edge features.

[0024] Coordinate mapping: Records the absolute coordinates of each small region in the original image. For example, the coordinates of region i=10 are (x=2900-3000, y=3000-3050). Subsequent edge points can be traced back to their original positions through this mapping table to avoid coordinate offset.

[0025] Output: 20 small region images (100×50 pixels), and a small region-original image coordinate mapping table.

[0026] Step 3: Construction of dual-input images Global feature input (input1): For the i-th small region, combine its left neighboring region (i-1), itself (i), and right neighboring region (i+1) to form a 100×150 pixel input1 (e.g., when i=10, combine regions 9, 10, and 11), which is used to extract global edge features across regions. Local feature input (input2): The original size (100×50 pixels) of the i-th small region is retained as input2, which is used to extract local detail features of the edge (such as tiny bumps and minor wear on the edge of the pin).

[0027] Boundary processing: For the first region (i=1), input1 selects combined regions 1, 2, and 3; for the last region (i=20), input1 selects combined regions 18, 19, and 20 to avoid the loss of global features caused by the absence of adjacent regions in the boundary region.

[0028] Output: 20 sets of dual-input images (each set contains input1: 100×150 pixels and input2: 100×50 pixels).

[0029] Step 4: AI Inference and Edge Optimization This step is the core process, simultaneously completing AI model inference and edge optimization, and outputting the effective edge points for each small region.

[0030] AI model loading and inference: Model selection: Load a pre-trained improved RPDCNet model (optimized for industrial edge detection, with input layer supporting dual-input fusion and output layer containing "confidence map" and "pixel-level two-dimensional feature vector map"). Feature fusion inference: Input1 is input into the "global feature branch" (5-layer convolution + attention module) to extract global correlation features across regional edges; input2 is input into the "local feature branch" (3-layer convolution + residual module) to extract detailed edge features; the dual-branch features are fused through a 1×1 convolutional layer.

[0031] Output: Confidence map: 100×50 pixels in size. Each pixel value represents the probability that the pixel is a true edge (range 0-1, such as 0.85-0.95 for pin edge pixels and 0.01-0.1 for background pixels). Pixel-level two-dimensional feature vector map: size 100×50×2 pixels. The two-dimensional vector of each pixel describes its feature correlation with the surrounding pixels (Euclidean distance between adjacent pixel vectors on the same edge ≤ 0.5, Euclidean distance between pixel vectors on different edges / background ≥ 1.0).

[0032] Edge optimization processing: ① Confidence screening (basic filtering): Based on the threshold (0.7) set in step 1, retain pixels with confidence > 0.7 as "candidate edge points" to initially remove low-confidence background noise (e.g., 30 candidate points are initially selected in region 10).

[0033] ② Suppress non-maximum values ​​within a column (satisfying the "column uniqueness constraint"): Calculate the feature response intensity of candidate points: use the cosine similarity between the feature vector of the candidate point and the pre-trained edge template vector (the template vector is the feature mean of a large number of pin edge samples, with a similarity range of 0-1); for each column (width direction) of the image, only the candidate point with the largest feature response intensity is retained to ensure that there is only one edge point per column, avoiding measurement ambiguity caused by multiple points in the column (e.g., in the 25th column of region 10, candidate point A has a similarity of 0.92, candidate point B has a similarity of 0.78, so A is retained).

[0034] Output: The 10 best edge points in each column of region 10.

[0035] ③ Edge continuity verification and interpolation (satisfying the "edge continuity constraint"): Calculate the vertical distance (row number difference) between adjacent column edge points. If the distance is greater than the continuity threshold (3 pixels) set in step 1, it is determined to be an edge break. Supplement the break points based on feature vector interpolation: Based on the feature vectors of the edge points on both sides of the break, generate the missing edge points in the middle through linear interpolation to ensure that the edge is continuous and without breakage.

[0036] Output: 12 consecutive edge points of region 10.

[0037] ④ Edge cluster cross-filtering (satisfying the "edge non-overlapping constraint"): For the edge points of the current small region, the DBSCAN clustering algorithm is used to form edge clusters in combination with the edge points of the processed small regions. The minimum bounding rectangle (MBR) of each edge cluster is calculated. If the MBR overlap area of ​​two edge clusters is greater than 5% of the MBR area of ​​the smaller edge cluster, or the minimum pixel distance between clusters is less than 5 pixels, they are judged as potentially overlapping. For potentially overlapping clusters, the cluster with the higher total confidence of all points in the cluster is retained (low-confidence overlapping clusters are removed) to ensure that different edges do not overlap.

[0038] Output: 12 valid edge points of region 10 (no breaks, no intra-column multipoints, no overlaps).

[0039] Single-region output: Record the coordinates of the 12 valid edge points of region 10 in the original image (converted by the coordinate mapping table in step 2), and mark the confidence and feature response intensity of each point.

[0040] Step 5: Integration of all ROI edge points and primitive fitting Edge point integration: For the effective edge points of 20 small regions (10-12 points in each region), the coordinates are backtracked to the original image coordinates through the coordinate mapping table and integrated into a complete edge point set of the ROI region (such as 2 pin edges, each containing 200 consecutive edge points).

[0041] Primitive Fitting: Based on measurement requirements (pin spacing is a straight-line distance), the least squares method (or RANSAC algorithm) is used to fit a straight line to each edge point set, and the straight-line parameters are output: Edge 1 (left side of pin): y = 0.02x + 3000.5; Edge 2 (right side of pin): y = 0.02x + 3001.0; Fitting error calculation: The fitting error is calculated by the sum of squared residuals. The fitting error of both edges is ≤0.005mm, which meets the high precision requirements.

[0042] Step 6: Physical Dimension Calculation and Output Physical size conversion: Combined with camera intrinsic parameters (such as pixel size = 0.001mm / pixel), calculate the vertical distance (i.e. pin spacing) between the two fitted lines = 0.5mm.

[0043] The system architecture involved in this invention is as follows: each functional module works in concert to achieve full automation from ultra-large image input to measurement result output.

[0044] Module Name Core Functions enter Output ROI settings module A visual user interface can be used, allowing users to select the ROI region and set measurement parameters. Large industrial images ROI coordinates, measurement parameters ROI Segmentation Module Divide the ROI region evenly into N rectangular sub-regions, and record the coordinate mapping relationship of each sub-region in the original image. ROI image Segmented small region images and coordinate mapping tables Dual-input building blocks For each small region, a dual-input image is constructed (global feature input + local feature input). Small area image Global feature input + local feature input AI model inference module Load the pre-trained AI model to complete inference, and simultaneously perform edge optimization processing. Dual input images, pre-trained AI model The effective edge point coordinates, confidence level, and feature response intensity of each small region. primitive fitting module The effective edge points of all small regions are integrated to complete the fitting of lines, circles, and arcs, and outliers are removed. Edge point coordinate set, fitted primitive type (line, circle, arc), fitting parameters (e.g., line slope, circle radius), fitting error Fitting results Measurement output module Physical size conversion Fitting results, camera intrinsic parameters Measurement results It will be understood by those skilled in the art that this invention may relate to apparatus for performing one or more of the operations described in this application. The apparatus may be specifically designed and manufactured for the desired purpose, or may include known devices in a general-purpose computer having programs stored therein that can be selectively activated or reconfigured.

[0045] Those skilled in the art will understand that each box in these structure diagrams and / or block diagrams and / or flow diagrams, as well as combinations of boxes in these structure diagrams and / or block diagrams and / or flow diagrams, can be implemented using computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing method to generate a machine, thereby creating, through execution by the processor of the computer or other programmable data processing method, methods specified in the boxes of the structure diagrams and / or block diagrams and / or flow diagrams.

[0046] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless defined as herein.

[0047] The embodiments are merely illustrative of the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. Any modifications made to the technical solution based on the technical concept proposed in this invention shall fall within the scope of protection of this invention.

Claims

1. An AI edge detection method for ultra-large images, characterized in that, Includes the following steps: (1) For the ultra-large image to be measured, set the ROI region and measurement parameters; (2) Divide the ROI region into several rectangular small regions evenly, ensuring that each rectangular small region contains complete local edge features, and record the coordinate mapping relationship of each rectangular small region in the ultra-large image to be tested; (3) Construct a dual-input image for each rectangular region. One input image is a combination image of the rectangular region and its left and right adjacent regions, used to extract global edge features across regions. When the rectangular region is the first and last region, the rectangular region is missing one side of the adjacent region. Then the rectangular region and the two adjacent regions on the other side form a combination image. The other input image is the original image of the rectangular region, used to extract local detail features of the edge. (4) Input the dual-input image into the AI ​​model, perform AI inference and edge optimization simultaneously, determine the effective edge points of each rectangular small region, and obtain the coordinates of each effective edge point through the aforementioned coordinate mapping relationship; (5) Integrate all valid edge points of the rectangular small regions and fit them as corresponding primitives; (6) Combine the camera intrinsic parameters to convert the fitted primitive parameters into physical dimensions to obtain the detection results.

2. The AI ​​edge detection method for ultra-large images according to claim 1, characterized in that, In step (1), the measurement parameters include confidence screening threshold, edge continuity threshold and edge non-overlap threshold.

3. The AI ​​edge detection method for ultra-large images according to claim 2, characterized in that, In step (4), the AI ​​inference outputs a confidence map and a pixel-level two-dimensional feature vector map for each rectangular small region. Each pixel value on the confidence map represents the probability that the pixel is a true edge, and the two-dimensional vector of each pixel on the pixel-level two-dimensional feature vector map represents the feature correlation between the pixel and the surrounding pixels.

4. The AI ​​edge detection method for ultra-large images according to claim 3, characterized in that, In step (4), the edge optimization includes: based on the confidence map and the confidence screening threshold, retaining candidate edge points with a confidence greater than the confidence screening threshold; for each candidate edge point, calculating its feature response intensity, performing non-maximum suppression processing on each column of the image, and retaining only the candidate edge point with the largest feature response intensity.

5. The AI ​​edge detection method for ultra-large images according to claim 4, characterized in that, The feature response intensity is the cosine similarity between the feature vector of the candidate edge point and the pre-trained edge template vector, where the pre-trained edge template vector is the feature mean obtained from a large number of edge samples.

6. The AI ​​edge detection method for ultra-large images according to claim 4, characterized in that, In step (4), the edge optimization further includes: after obtaining the candidate edge points after non-maximum suppression processing, calculating the longitudinal distance between adjacent candidate edge points based on the pixel-level two-dimensional feature vector map and the edge continuity threshold. If the longitudinal distance is greater than the edge continuity threshold, it is determined to be an edge break, and break points need to be added at the break point to ensure that the edge is continuous and without breakage.

7. The AI ​​edge detection method for ultra-large images according to claim 6, characterized in that, The method of supplementing the fracture point at the fracture site involves generating the missing edge point in the middle through linear interpolation based on the feature vectors of the edge points on both sides of the fracture site.

8. The AI ​​edge detection method for ultra-large images according to claim 4, characterized in that, In step (4), the edge optimization further includes: after obtaining candidate edge points that have undergone non-maximum suppression processing, the candidate edge points are clustered to obtain edge clusters, and based on the edge non-overlap threshold, it is determined whether two adjacent edge clusters are potentially overlapping. For two edge clusters that are potentially overlapping, the confidence sum of all points in the two clusters is calculated respectively, and the edge cluster with the higher confidence sum is retained, while the edge cluster with the lower confidence sum is removed.

9. The AI ​​edge detection method for ultra-large images according to claim 8, characterized in that, The edge non-overlapping threshold includes an edge non-overlapping area threshold and an edge non-overlapping spacing threshold. The minimum bounding rectangle of the edge cluster is calculated. If the overlapping area of ​​the minimum bounding rectangles of two edge clusters is greater than the edge non-overlapping area threshold, or the minimum pixel distance between clusters is less than the edge non-overlapping spacing threshold, then it is determined to be a potential cross-overlap.

10. An AI edge detection system for ultra-large images, characterized in that, include: ROI settings module: Used to set the ROI region and measurement parameters for ultra-large images to be measured; ROI segmentation module: used to uniformly divide the ROI region into several rectangular small regions, ensuring that each rectangular small region contains complete local edge features, and recording the coordinate mapping relationship of each rectangular small region in the ultra-large image to be tested; Dual-input construction module: Used to construct dual-input images for each rectangular region. One input image is a combined image of the rectangular region and its left and right adjacent regions, used to extract global edge features across regions. When the rectangular region is the first and last region, it is missing one side of its adjacent region, so the rectangular region is combined with the two regions immediately adjacent to the other side to form a combined image. The other input image is the original image of the rectangular region, used to extract local detail features of the edges. AI inference module: used to input the dual-input image into the AI ​​model, simultaneously perform AI inference and edge optimization, determine the effective edge points of each rectangular small region, and obtain the coordinates of each effective edge point through coordinate mapping relationship; Primitive Fitting Module: Used to integrate all valid edge points of small rectangular regions and fit them into corresponding primitives; Measurement output module: Used to combine camera intrinsic parameters to convert the fitted primitive parameters into physical dimensions and obtain the detection results.