Radian measurement method, device and equipment and storage medium

By using arc edge contour template images and a three-point fitted circle method, the curvature of the four corners of 3C electronic product panels is automatically calculated, solving the measurement instability and interference problems caused by manual selection, and achieving efficient and accurate curvature measurement.

CN121582322APending Publication Date: 2026-02-27中科慧远半导体技术(广东)有限公司 +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511731601.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-21
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

In existing technologies, the measurement of the curvature of the four corners of the display panel of 3C electronic products relies on manual selection of the area of ​​interest. This method suffers from inaccurate positioning, weak anti-interference ability, large fluctuations in measurement values, significant deviations from the true values, and low efficiency, making it difficult to meet the online testing requirements of large-scale mass production.

Method used

Contour similarity matching is performed using arc-edge contour template images. Candidate circles are generated by fitting circles at three points. Deviation values ​​are calculated and target key points are screened. The curvature value is automatically calculated to eliminate interference points and ensure measurement stability and robustness.

Benefits of technology

It enables rapid locking of the target arc edge contour area even when the panel position is offset, improving the stability and accuracy of measurement, reducing human operation errors, and meeting the online inspection requirements of large-scale mass production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121582322A_ABST
    Figure CN121582322A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, and provides a radian measurement method and device, equipment and a storage medium, and the method comprises the steps: obtaining a pre-created arc edge contour template image; performing contour similarity matching on the to-be-measured image by using the arc edge contour template image to find a target arc edge contour area, and obtaining a key point set of the target arc edge contour area; for the key point set, generating a plurality of candidate circles by adopting a three-point circle fitting mode; calculating a deviation value corresponding to each candidate circle, determining a target key point according to the deviation value and a preset condition, and determining a target fitting circle and a target arc endpoint; and according to the target fitting circle and the target arc endpoint, calculating to obtain a radian value corresponding to the to-be-measured image. Through the technical scheme, the target arc edge contour area is quickly locked, the influence of interference points on the fitting circle result is avoided, and the robustness and stability of the measurement result are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to a method, apparatus, device and storage medium for measuring radians. Background Technology

[0002] In the manufacturing process of 3C electronic product displays, the cutting precision of the curved edges at the four corners of the panel directly affects product quality and subsequent assembly compatibility. Due to mechanical errors of the cutting equipment, material stress release, and the squeezing effect of subsequent processes, the curved edges at the four corners often exhibit curvature deviations. If such defective products flow into the next process, it will not only lead to assembly failure but also waste resources such as parts and labor. At the same time, it will affect the yield statistics and optimization direction of the production process.

[0003] Currently, the industry primarily relies on manually selecting regions of interest (ROIs) to measure the curvature of panel corners. The curvature is then calculated by fitting a circle to extract key points along the curved edges. However, this method has significant drawbacks: Firstly, due to insufficient machine feeding accuracy, the panel's position in the inspection image is prone to shift, causing misalignment between the manually selected ROI and the actual curved edge area. This results in extremely poor stability for repeatable measurements, with significant deviations in multiple measurements of the same product. Secondly, product edges often have transition zones (such as residual burrs from cutting or areas of light reflection), making it easy for manually selected key points to become interfering, causing the fitted circle to deviate from the true curved edge and further widening the deviation between the measured value and the actual curvature. Furthermore, manual measurement is inefficient and cannot meet the demands of large-scale mass production online inspection. Summary of the Invention

[0004] This application provides a method, apparatus, device, and storage medium for measuring radians, aiming to solve the technical problems existing in related technologies, such as large fluctuations in measured values ​​and significant deviations from the true values ​​due to inaccurate positioning and weak anti-interference capabilities.

[0005] In a first aspect, embodiments of this application provide a method for measuring radians, including: Obtain the pre-created arc edge contour template image; On the image to be measured, the arc edge contour template image is used to perform contour similarity matching in order to find the target arc edge contour region and obtain the key point set of the target arc edge contour region. For the set of key points, multiple candidate circles are generated by fitting a circle using three points; Calculate the deviation value corresponding to each candidate circle, determine the target key point based on the deviation value and preset conditions, and determine the target fitting circle and the endpoint of the target arc. The deviation value is the sum of the absolute values ​​of the differences between the distance and radius of the other key points in the key point set (excluding the three points that fit the candidate circle) to the center of the candidate circle. The radian value corresponding to the image to be measured is calculated based on the target fitted circle and the endpoint of the target arc.

[0006] In one embodiment, optionally, the process of creating a pre-created arc edge contour template image includes: Obtain the preset template image, and select the ROI region containing the curved edge according to the received selection instructions; The ROI region is segmented according to a preset threshold to obtain an arc-edge region; The arc-shaped region is converted into a contour, and the interfering straight edges in the contour are removed to obtain the arc-shaped contour. Save the arc edge contour as the arc edge contour template image.

[0007] In one embodiment, optionally, removing interfering straight edges from the contour includes: The set of points at the outermost end of the arc edge region is retained as the outer contour of the arc edge; Obtain the circumscribed rectangle of the arc edge region, and shrink the circumscribed rectangle inward by a preset pixel value; Calculate the intersection of the circumscribed rectangle after shrinking and the outer contour of the arc edge to obtain the arc edge contour after removing the interference straight edges.

[0008] In one embodiment, optionally, contour similarity matching is performed using the arc-edge contour template image, including: Based on the shape features of the arc edge contour template image, a region matching the shape features is searched throughout the image to be measured. Calculate the shape similarity between each search region and the arc edge contour template image, and select the region with the highest similarity as the target arc edge contour region.

[0009] In one embodiment, optionally, obtaining the key point set of the target arc edge contour region includes: Generate a minimum bounding rectangle based on the target arc edge contour region; Threshold segmentation is performed within the minimum bounding rectangle to obtain the arc edge region to be measured; Extract the contour points of the arc edge region to be measured to form the key point set.

[0010] In one embodiment, optionally, multiple candidate circles are generated using a three-point fitting method, including: Three non-collinear points are randomly selected from the set of key points; Calculate the center coordinates and radius of the three points based on the analytical equation of the circle to generate a candidate circle; Traverse all non-collinear three-point combinations in the key point set to generate all candidate circles.

[0011] In one embodiment, optionally, the preset condition is: The key points corresponding to the candidate circles whose deviation values ​​exceed the preset deviation values ​​are identified as abnormal key points and removed, and the remaining key points are identified as the target key points.

[0012] In one embodiment, optionally, determining the target fitted circle and the endpoints of the target arc includes: Select the candidate circle with the smallest deviation value from all candidate circles as the target fitting circle; Select the two points that are furthest apart from the target key points as the endpoints of the target arc.

[0013] In one embodiment, optionally, calculating the radian value corresponding to the image to be measured includes: Calculate the angle between the line connecting the two endpoints and the center of the target arc based on the coordinates of the endpoints and the center of the target fitted circle. The angle value of the included angle is determined as the radian value.

[0014] In one embodiment, optionally, the image to be measured is a panel image of a 3C electronic product, and the radian value is the radian value of the four corner arcs of the panel image.

[0015] Secondly, embodiments of this application provide an arc measurement device, comprising: The acquisition module is used to acquire a pre-created arc edge contour template image; The matching module is used to perform contour similarity matching on the image to be measured using the arc edge contour template image, so as to find the target arc edge contour region and obtain the key point set of the target arc edge contour region. The generation module is used to generate multiple candidate circles for the set of key points by using a three-point fitted circle method; The determination module is used to calculate the deviation value corresponding to each candidate circle, determine the target key points based on the deviation value and preset conditions, and determine the target fitting circle and the endpoint of the target arc. The deviation value is the sum of the absolute values ​​of the differences between the distances and radii of the other key points in the key point set (excluding the three points that fit the candidate circle) to the center of the candidate circle. The calculation module is used to calculate the radian value corresponding to the image to be measured based on the target fitted circle and the endpoint of the target arc.

[0016] In one embodiment, optionally, the method further includes: The selection module is used to obtain a preset template image and select the ROI region containing curved edges according to the received selection instructions; The segmentation module is used to segment the ROI region according to a preset threshold to obtain the arc-edge region; The conversion module is used to convert the arc edge region into a contour, remove interfering straight edges in the contour, and obtain the arc edge contour. The saving module is used to save the arc edge contour as the arc edge contour template image.

[0017] In one embodiment, optionally, the conversion module includes: A retention unit is used to retain the set of points at the outermost end of the arc edge region as the outer contour of the arc edge; The shrinking unit is used to obtain the circumscribed rectangle of the arc edge region and shrink the circumscribed rectangle inward by a preset pixel value; The calculation unit is used to calculate the intersection of the circumscribed rectangle after shrinking and the outer contour of the arc edge, so as to obtain the arc edge contour after removing the interference straight edges.

[0018] In one embodiment, optionally, the matching module includes: The search unit is used to search for regions that match the shape features in the image to be measured, based on the shape features of the arc edge contour template image. The first selection unit is used to calculate the shape similarity between each search region and the arc edge contour template image, and select the region with the highest similarity as the target arc edge contour region.

[0019] In one embodiment, optionally, the acquisition module includes: The first generation unit is used to generate a minimum bounding rectangle based on the target arc edge contour region; A segmentation unit is used to perform threshold segmentation within the minimum bounding rectangle to obtain the arc edge region to be measured. The extraction unit is used to extract the contour points of the arc edge region to be measured, forming the key point set.

[0020] In one embodiment, optionally, the generation module includes: The second selection unit is used to randomly select three non-collinear points from the set of key points; The second generation unit is used to calculate the center coordinates and radius of the three points according to the analytical equation of the circle, and generate a candidate circle; The traversal unit is used to traverse all non-collinear three-point combinations in the key point set to generate all candidate circles.

[0021] In one embodiment, optionally, the preset condition is: The key points corresponding to the candidate circles whose deviation values ​​exceed the preset deviation values ​​are identified as abnormal key points and removed, and the remaining key points are identified as the target key points.

[0022] In one embodiment, optionally, the determining module includes: The third selection unit is used to select the candidate circle with the smallest deviation value from all candidate circles as the target fitting circle; The fourth selection unit is used to select the two points that are farthest apart from the target key points as the endpoints of the target arc.

[0023] In one embodiment, optionally, the computing module includes: Angle calculation unit is used to calculate the angle between the two endpoints and the center of the circle based on the coordinates of the endpoints of the target arc and the center coordinates of the target fitted circle. A determining unit is used to determine the angle value of the included angle as the radian value.

[0024] In one embodiment, optionally, the image to be measured is a panel image of a 3C electronic product, and the radian value is the radian value of the four corner arcs of the panel image.

[0025] Thirdly, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described radian measurement method.

[0026] Fourthly, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps of the above-described radian measurement method.

[0027] In the above-described method, apparatus, device, and storage medium for measuring arcuate shape, a pre-created arcuate contour template image is acquired. On the image to be measured, the arcuate contour template image is used for contour similarity matching to locate the target arcuate contour region and acquire a set of key points for that region. For the key point set, multiple candidate circles are generated using a three-point fitting circle method. The deviation value corresponding to each candidate circle is calculated. Based on the deviation value and preset conditions, target key points are determined, and the target fitting circle and the endpoint of the target arc are determined. The deviation value is the sum of the absolute values ​​of the distances from the center of the candidate circle to the radius of the other key points in the key point set (excluding the three points fitting the candidate circle) to the radius. Based on the target fitting circle and the endpoint of the target arc, the arcuate value corresponding to the image to be measured is calculated. In this invention, contour similarity matching of the arcuate contour template image eliminates the need for manual selection or high-precision material placement. Even if the product in the image to be measured shifts due to material placement errors, the target arcuate contour region can still be quickly located, ensuring the targeted extraction of the key point set and improving the stability of the measurement from the source. By calculating the deviation value corresponding to the candidate circle and combining it with preset conditions to screen target key points, abnormal interference points caused by product edge transition zones, dirt, burrs, etc., can be accurately eliminated, avoiding the influence of interference points on the fitted circle results and improving the robustness of the measurement results. The entire measurement process requires no manual intervention, and is fully automated from area positioning and key point extraction to curvature calculation. Compared with traditional manual measurement methods, it significantly shortens the inspection time, meets the online inspection needs of large-scale mass production of 3C electronic products, and reduces errors caused by manual operation. Attached Figure Description

[0028] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0029] Figure 1 A schematic flowchart of a radian measurement method according to an embodiment of this application is shown.

[0030] Figure 2 A schematic flowchart illustrating the process of creating an arc-edge contour template image according to an embodiment of this application is shown.

[0031] Figure 3 A schematic diagram of the arc-edge region according to an embodiment of this application is shown.

[0032] Figure 4 A schematic diagram of the arc edge profile according to an embodiment of this application is shown.

[0033] Figure 5 A schematic flowchart of step S203 in a radian measurement method according to an embodiment of this application is shown.

[0034] Figure 6 A schematic diagram of a key point set acquisition process according to an embodiment of this application is shown.

[0035] Figure 7 A schematic flowchart of step S203 in a radian measurement method according to an embodiment of this application is shown.

[0036] Figure 8 A schematic diagram of the radian value result according to an embodiment of this application is shown.

[0037] Figure 9 A block diagram of a radian measuring device according to an embodiment of this application is shown. Detailed Implementation

[0038] To better understand the technical solution of this application, the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0039] It should be understood that the described embodiments are merely some, not all, of the embodiments in this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.

[0040] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. The singular forms “a,” “the,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0041] To address the technical problem of poor annotation prediction results due to insufficient preliminary annotation data in related technologies, this application proposes a radian measurement method, apparatus, device, and storage medium.

[0042] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0043] Please see Figure 1 , Figure 1 A schematic flowchart of a radian measurement method according to an embodiment of this application is shown.

[0044] like Figure 1 As shown in the figure, this application provides a method for measuring radians, including: Step S101: Obtain the pre-created arc edge contour template image; Among them, the arc edge contour template image refers to a template image containing standard arc edge contour features created through a preset process, which is used to locate the target arc edge region in the image to be measured.

[0045] In this step, the arc edge contour template image is a pre-created benchmark based on measurement standards. Its contour features are consistent with the standard shape of the target arc edge to be measured (such as the arc edges at the four corners of a 3C product panel), including key features such as the shape and curvature trend of the arc edge. It can be saved in the form of stored contour point coordinates. In this way, a unified matching benchmark is provided, avoiding errors caused by relying on manual redefinition of standards for each measurement, laying the foundation for subsequent contour similarity matching, and ensuring the consistency of positioning.

[0046] Step S102: On the image to be measured, use the arc edge contour template image to perform contour similarity matching to find the target arc edge contour region and obtain the key point set of the target arc edge contour region. Contour similarity matching is the process of determining the region closest to the template by calculating the shape similarity between the contours of each region in the image to be measured and the contours of the template (such as the degree of similarity in the distribution of contour points and the curvature changes).

[0047] The target arc edge contour region is the region in the image to be measured that has the highest matching degree with the arc edge contour template image, that is, the region containing the arc edge to be measured.

[0048] The key point set is extracted from the target arc edge contour region. It is a set of contour points that can characterize the shape of the arc edge and is the basic data for subsequent circle fitting.

[0049] In the above technical solution, there is no need to rely on high-precision material feeding. Even if the product is offset in the image, the target arc edge area can still be accurately located through contour matching, which solves the measurement instability problem caused by position offset in traditional manual selection. At the same time, the extraction of key point set provides a reliable data foundation for subsequent circle fitting.

[0050] In one embodiment, optionally, the image to be measured is a panel image of a 3C electronic product, and the radian value is the radian value of the four corner arcs of the panel image.

[0051] 3C electronic products refer to computer, communication, and consumer electronics products, such as mobile phones, tablets, and monitors. A panel image is an image of the display panel of a 3C product, typically captured by an industrial camera. The four curved edges are the rounded edges at the four corners of the panel; these are critical parts for the product's appearance and assembly, and their curvature accuracy directly affects product quality.

[0052] This approach specifically addresses the measurement challenges of the curved edges at the four corners of 3C product panels, adapting to the measurement difficulties caused by material feeding deviations and edge transition zones in their production scenarios. It improves the detection accuracy and efficiency in this field, providing strong support for the quality control of 3C products.

[0053] Step S103: For the set of key points, generate multiple candidate circles by fitting a circle using three points; Three-point fitting of a circle is based on the principle in plane geometry that three non-collinear points determine a circle. It is a process of calculating the center and radius of a circle using the coordinates of three key points.

[0054] Candidate circles are circles that are fitted by different combinations of three points and may conform to the true curvature of the target arc edge. These circles are used to select the best fitted circle in the subsequent process.

[0055] In this step, three non-collinear points are randomly selected from the set of key points and substituted into the analytical equation of the circle (xa)² + (yb)² = r², where (a,b) is the center and r is the radius, to obtain the corresponding center coordinates and radius, generating a candidate circle; this process is repeated to traverse all possible combinations of non-collinear three points to obtain multiple candidate circles.

[0056] In this way, a large number of candidate circles are generated by combining multiple sets of three points, covering the possible curvature range of the arc edge. This avoids the distortion of results caused by the selection deviation of a single fitting method, and provides sufficient samples for subsequent selection of the optimal circle.

[0057] Step S104: Calculate the deviation value corresponding to each candidate circle, determine the target key point based on the deviation value and preset conditions, and determine the target fitting circle and the endpoint of the target arc. The deviation value is the sum of the absolute values ​​of the distances from the center of the candidate circle to the radius of the other key points in the key point set excluding the three points that fit the candidate circle. The deviation value is an indicator that measures the degree of fit between the candidate circle and the overall key point set. It is calculated as the sum of the absolute values ​​of the differences between the distances from the center of the candidate circle to the three key points (excluding the three points that fit the candidate circle) and the radius of the circle.

[0058] Deviation value calculation formula: ,in( , () is the center, r is the radius, ( , ) are the other key points besides the three points that fit the candidate circle.

[0059] The preset conditions are used to filter valid key points and candidate circles, and are usually a threshold range of deviation values. Target key points are the key points remaining after removing outliers that accurately reflect the arc edge contour. The target fitted circle is the circle selected from the candidate circles that has the highest degree of fit with the target key points (smallest deviation value) and is closest to the true curvature of the arc edge. The target arc endpoints are the key points at both ends of the arc edge, used to determine the measurement range of the arc.

[0060] In this step, for each candidate circle, the absolute values ​​of the differences between the distances from all non-fitted points to its center and its radius are calculated to obtain the deviation value. The key points corresponding to the candidate circles whose deviation values ​​exceed the preset threshold are identified as abnormal points (such as edge transition zones or interference points caused by dirt) and removed. The remaining key points are the target key points. The candidate circle with the smallest deviation value is selected as the target fitted circle, and the two points with the greatest distance from the target key points are selected as the endpoints of the target arc.

[0061] In this technical solution, the fitting accuracy of the candidate circle is quantified by calculating the deviation value, and interference points are eliminated by combining preset conditions, which significantly improves the anti-interference ability of the fitting results; the target fitting circle with the smallest deviation value is selected to ensure that it has the highest degree of conformity with the real arc edge; the farthest point is used as the endpoint to ensure the objectivity of the arc measurement range and avoid the subjective error of manual point selection.

[0062] Step S105: Calculate the radian value corresponding to the image to be measured based on the target fitted circle and the endpoint of the target arc.

[0063] The radian value is the size of the central angle corresponding to the endpoint of the target arc on the target fitted circle, used to characterize the degree of curvature of the arc edge.

[0064] In this step, based on the precise target fitting circle and endpoints, the calculated radian value can truly reflect the curvature of the arc edge, with high measurement accuracy. The entire process is automated, which greatly improves efficiency compared to manual measurement, and the results have good repeatability, providing reliable data for production process optimization.

[0065] The technical solution of this invention obtains the arc edge calculation area of ​​the image under test through contour matching, preventing large fluctuations in results due to product position deviations. Deviation value calculation and outlier removal improve the stability of the calculated values, prevent the influence of abnormal points generated by dirt or other foreign objects on the arc edge, and improve the robustness of the measurement results. Through key point traversal optimization, the target circle can be selected more reasonably, and the results obtained are closer to manually measured values.

[0066] like Figure 2 As shown, in one embodiment, optionally, the process of creating a pre-created arc edge contour template image includes: Step S201: Obtain the preset template image and select the ROI region containing the arc edge according to the received selection instruction; The default template image is a reference image containing standard curved edges (such as an image of a qualified 3C product panel) as the basis for creating the template.

[0067] A selection command can be an operation command entered by the user through an interactive device (such as a mouse or touch screen) to specify an area of ​​interest.

[0068] The ROI (Region of Interest) is a local area in an image that contains the target to be analyzed.

[0069] By manually selecting the ROI region, the standard curved edges in the template image are accurately located, reducing the interference of the background area on subsequent contour extraction and ensuring the accuracy of the template contour.

[0070] Step S202: The ROI region is segmented according to a preset threshold to obtain the arc-edge region, as shown below. Figure 3 As shown; The preset threshold is a critical value for distinguishing the grayscale (or color) values ​​between the curved edge area and the background area, and is set according to the grayscale difference between the curved edge and the background.

[0071] Threshold segmentation is an image processing method that divides pixels into two categories, target (arc edge) and background, by comparing the gray values ​​of image pixels with a preset threshold, thereby separating the arc edge region.

[0072] Threshold segmentation separates the arc edge region from the ROI, achieving an initial distinction between the arc edge and the background, and providing a clear regional basis for subsequent contour extraction.

[0073] Step S203: Convert the arc-edge region into a contour, remove interfering straight edges from the contour, and obtain the arc-edge contour, as shown below. Figure 4 As shown; Interference straight edges are straight edges that are not part of the target curved edge (such as the straight edges of a product border) that may exist in the curved edge area and will interfere with the accuracy of the curved edge contour.

[0074] Step S204: Save the arc edge contour as the arc edge contour template image.

[0075] The processed arc edge contour is stored in a specific format (such as a coordinate array) as a template for contour matching in the image to be measured, which is convenient for repeated use.

[0076] In this way, a template can be created once and reused multiple times, reducing repetitive operations and improving the efficiency of the measurement process; at the same time, it ensures that a consistent standard is used for each match, improving the consistency of measurements.

[0077] like Figure 5 As shown, in one embodiment, optionally, step S203 includes: Step S501: Retain the set of points at the outermost end of the arc edge region as the outer contour of the arc edge; The outer contour of the arc edge refers to the boundary contour closest to the edge of the image in the arc edge region. It is the outermost boundary of the arc edge and can most intuitively reflect the shape of the arc edge.

[0078] In this step, the contour containing the outermost pixels (i.e., the outer contour) is selected from all contours in the arc edge region. The inner contour, which may be formed by holes or impurities within the region, is excluded, and the main boundary of the arc edge is preserved. In this way, the focus is on the outer boundary of the arc edge, avoiding the influence of internal interfering contours on subsequent processing and ensuring the accuracy of the main features of the contour.

[0079] Step S502: Obtain the circumscribed rectangle of the arc edge region, and shrink the circumscribed rectangle inward by a preset pixel value; The circumscribed rectangle is the smallest rectangle that completely encloses the curved outer contour, and its sides are parallel to the coordinate axes of the image coordinate system. The indentation preset pixel value shrinks the boundary of the circumscribed rectangle by a specified number of pixels (e.g., 2 pixels) towards the center, forming a smaller rectangle.

[0080] In this step, the boundary of the circumscribed rectangle is determined by calculating the minimum and maximum x and y coordinates of the outer contour of the arc edge. Then, the top, bottom, left, and right boundaries of the rectangle are shrunk inward by a preset number of pixels (e.g., 2 pixels) to reduce the rectangle's range. In this way, the shrunk rectangle can eliminate any straight edges that may exist on the outer contour, providing a range constraint for the subsequent extraction of the pure arc edge contour.

[0081] Step S503: Calculate the intersection of the circumscribed rectangle after shrinking and the outer contour of the arc edge to obtain the arc edge contour after removing the interference straight edges.

[0082] By comparing whether each point on the outer contour of the curved edge is within the bounded rectangle after the indentation, contour points within the rectangle are retained, while points outside the rectangle are discarded, resulting in a contour containing only the curved portion of the edge. In this way, through rectangle indentation and intersection calculations, interfering straight edges at both ends of the curved edge are accurately eliminated, yielding a pure curved edge contour. This further improves the accuracy of the template contour and provides a more reliable benchmark for subsequent matching.

[0083] In one embodiment, optionally, contour similarity matching is performed using the arc-edge contour template image, including: Based on the shape features of the arc edge contour template image, a region matching the shape features is searched throughout the image to be measured. Shape features refer to the geometric properties of a contour, such as the relative positions of contour points, curvature changes, angle distribution, perimeter and area ratio, etc., which are key parameters characterizing the shape of a contour.

[0084] In this step, shape features of the template contour are extracted (e.g., shape context descriptors are used to quantize the shape of the contour). A search window is then slid across the image to be measured at certain step sizes. The similarity between the contour shape features of each region within the window and the template features is calculated, and potential matching regions are recorded. In this way, shape feature-based searching ensures the specificity of the matching. Even if there are slight deformations in the curved edges of the image to be measured, the target region can still be found through shape similarity, thus improving the robustness of the matching.

[0085] Calculate the shape similarity between each search region and the arc edge contour template image, and select the region with the highest similarity as the target arc edge contour region.

[0086] Shape similarity refers to the degree to which the shape features of two contours match. It is usually represented by a value between 0 and 1 (1 is a perfect match) and is calculated by the distance between feature vectors (such as Euclidean distance or cosine distance).

[0087] In this step, for each search region, an algorithm (such as feature vector comparison) is used to calculate its shape similarity score with the template contour. The region with the highest score is then selected from all regions and identified as the target arc edge contour region. In this way, selecting the optimal matching region through quantitative similarity scoring avoids the subjectivity of manual judgment, ensures the accuracy of target arc edge region localization, and provides a reliable regional basis for subsequent measurements.

[0088] like Figure 6 As shown, in one embodiment, optionally, obtaining the key point set of the target arc edge contour region includes: Step S601: Generate the minimum bounding rectangle based on the target arc edge contour region; The minimum bounding rectangle is the rectangle with the smallest area that can completely enclose the target arc-shaped contour region, closely fitting the boundary of the arc-shaped region. The minimum bounding rectangle defines the precise range for subsequent thresholding, reduces the influence of background or other interference outside the region, and improves the targeting of arc-shaped region extraction.

[0089] Step S602: Perform threshold segmentation within the minimum bounding rectangle to obtain the arc edge region to be tested; The region to be measured, the arc edge region, refers to the set of arc edge pixels within the smallest bounding rectangle of the image to be measured, separated by threshold segmentation; it is the actual arc edge region to be measured. For the image region within the smallest bounding rectangle, a threshold segmentation method (such as adaptive thresholding) consistent with that used during template creation is employed to separate the arc edge pixels from the background pixels, obtaining the pixel region of the arc edge to be measured. In this way, segmenting the arc edge region within a defined rectangular area avoids interference from other areas of the image, ensuring that only the pixels of the target arc edge are extracted, thus improving the accuracy of region extraction.

[0090] Step S603: Extract the contour points of the arc edge region to be measured to form the key point set.

[0091] Contour points refer to the boundary pixels of the arc edge region to be measured. Their coordinates characterize the actual shape of the arc edge and serve as the raw data for subsequent circle fitting. Through contour extraction algorithms (such as edge detection and contour tracking), continuous boundary pixels are extracted from the arc edge region to be measured. The coordinates of these points are stored sequentially to form a keypoint set. The keypoint set accurately reflects the shape of the arc edge to be measured, providing high-quality raw data for subsequent circle fitting and radian calculation, and is fundamental to ensuring measurement accuracy.

[0092] like Figure 7 As shown, in one embodiment, optionally, step S103 includes: Step S701: Randomly select three non-collinear points from the set of key points; Three non-collinear points refer to three key points that are not on the same straight line, satisfying the condition in plane geometry that three points determine a circle.

[0093] Three points are randomly selected from the keypoint set. Geometric calculations are used to determine if the three points are collinear (collinearity is determined by the equal slope of the three points). If collinear, the selected points are reselected until three non-collinear points are obtained. This ensures that the selected three points uniquely define a circle, providing effective basic data for subsequent fitting and avoiding fitting failures caused by collinear points.

[0094] Step S702: Calculate the center coordinates and radius of the three points according to the analytical equation of the circle to generate a candidate circle; This step uses mathematical analytical methods to accurately calculate the parameters of the candidate circles, ensuring that each candidate circle is based on actual key points, thus providing reliable samples for the subsequent selection of the optimal circle.

[0095] Step S703: Traverse all non-collinear three-point combinations in the key point set to generate all candidate circles.

[0096] The algorithm generates all possible three-point combinations from the keypoint set. For each combination, it determines whether they are collinear. For non-collinear combinations, the fitting process described above is repeated, ultimately yielding all possible candidate circles. This generates a large number of candidate circles, covering the possible curvature range of the arc edge, avoiding fitting bias caused by a single combination, and increasing the probability of subsequently selecting the optimal circle.

[0097] In one embodiment, optionally, determining the target fitted circle and the endpoints of the target arc includes: Select the candidate circle with the smallest deviation value from all candidate circles as the target fitting circle; The candidate circle with the smallest deviation value is the circle that best matches the overall set of target key points, and its center and radius are closest to the true curvature of the arc edge. This step compares the deviation values ​​of all candidate circles and selects the candidate circle with the smallest deviation value. This circle best matches the distribution of target key points and is therefore determined to be the target fitted circle that best reflects the true arc edge. In this way, by quantitatively selecting based on deviation values, we ensure that the target fitted circle has the highest degree of matching with the true arc edge, providing an accurate geometric benchmark for subsequent curvature calculations.

[0098] Select the two points that are furthest apart from the target key points as the endpoints of the target arc.

[0099] The two points furthest apart refer to the two points with the largest Euclidean distance in the target key point set. These typically correspond to the two ends of the arc edge and are key points defining the arc edge's range. This step calculates the Euclidean distance between all pairs of points in the target key point set, selects the two points with the largest distance, and defines them as the endpoints of the target arc, i.e., the start and end positions of the arc edge. In this way, using the furthest point as the endpoint objectively defines the measurement range of the arc edge, avoiding the subjectivity of manual point selection, ensuring consistent arc measurement ranges across different products, and improving the comparability of results.

[0100] In one embodiment, optionally, calculating the radian value corresponding to the image to be measured includes: Calculate the angle between the line connecting the two endpoints and the center of the target arc based on the coordinates of the endpoints and the center of the target fitted circle. The angle between the two endpoints and the center of the circle refers to the angle between the two line segments formed by connecting the two endpoints from the center of the circle, i.e., the central angle, which is equal to the radian of the arc side.

[0101] Let the center of the circle be O ( , ), endpoint P1 ( , P2 , ), calculate vector =( )and =( The angle between two vectors is calculated using the dot product formula.

[0102] In this way, the central angle is accurately calculated through vector operations, ensuring that the angle value can truly reflect the curvature of the arc edge, providing an accurate numerical basis for arc measurement.

[0103] The angle value of the included angle is determined as the radian value, such as Figure 8 As shown.

[0104] The calculated central angle value is used as the final radian measurement result, which is then compared with a preset acceptable threshold to determine whether the product meets the process requirements. In this way, the obtained radian value accurately reflects the actual curvature of the arc edge and can be directly used for product quality inspection and process optimization, solving the problems of low accuracy and poor stability of traditional measurement methods.

[0105] Figure 9 A block diagram of a radian measuring device according to an embodiment of this application is shown.

[0106] like Figure 9 As shown, in a second aspect, embodiments of this application provide an arc measuring device 90, comprising: Module 91 is used to acquire a pre-created arc edge contour template image; The matching module 92 is used to perform contour similarity matching on the image to be measured using the arc edge contour template image, so as to find the target arc edge contour region and obtain the key point set of the target arc edge contour region. The generation module 93 is used to generate multiple candidate circles for the set of key points by using a three-point fitted circle method; The determination module 94 is used to calculate the deviation value corresponding to each candidate circle, determine the target key point according to the deviation value and preset conditions, and determine the target fitting circle and the endpoint of the target arc. The deviation value is the sum of the absolute values ​​of the difference between the distance and the radius of the other key points in the key point set excluding the three points that fit the candidate circle and the center of the candidate circle. The calculation module 95 is used to calculate the radian value corresponding to the image to be measured based on the target fitted circle and the endpoint of the target arc.

[0107] In one embodiment, optionally, the method further includes: The selection module is used to obtain a preset template image and select the ROI region containing curved edges according to the received selection instructions; The segmentation module is used to segment the ROI region according to a preset threshold to obtain the arc-edge region; The conversion module is used to convert the arc edge region into a contour, remove interfering straight edges in the contour, and obtain the arc edge contour. The saving module is used to save the arc edge contour as the arc edge contour template image.

[0108] In one embodiment, optionally, the conversion module includes: A retention unit is used to retain the set of points at the outermost end of the arc edge region as the outer contour of the arc edge; The shrinking unit is used to obtain the circumscribed rectangle of the arc edge region and shrink the circumscribed rectangle inward by a preset pixel value; The calculation unit is used to calculate the intersection of the circumscribed rectangle after shrinking and the outer contour of the arc edge, so as to obtain the arc edge contour after removing the interference straight edges.

[0109] In one embodiment, optionally, the matching module includes: The search unit is used to search for regions that match the shape features in the image to be measured, based on the shape features of the arc edge contour template image. The first selection unit is used to calculate the shape similarity between each search region and the arc edge contour template image, and select the region with the highest similarity as the target arc edge contour region.

[0110] In one embodiment, optionally, the acquisition module includes: The first generation unit is used to generate a minimum bounding rectangle based on the target arc edge contour region; A segmentation unit is used to perform threshold segmentation within the minimum bounding rectangle to obtain the arc edge region to be measured. The extraction unit is used to extract the contour points of the arc edge region to be measured, forming the key point set.

[0111] In one embodiment, optionally, the generation module includes: The second selection unit is used to randomly select three non-collinear points from the set of key points; The second generation unit is used to calculate the center coordinates and radius of the three points according to the analytical equation of the circle, and generate a candidate circle; The traversal unit is used to traverse all non-collinear three-point combinations in the key point set to generate all candidate circles.

[0112] In one embodiment, optionally, the preset condition is: The key points corresponding to the candidate circles whose deviation values ​​exceed the preset deviation values ​​are identified as abnormal key points and removed, and the remaining key points are identified as the target key points.

[0113] In one embodiment, optionally, the determining module includes: The third selection unit is used to select the candidate circle with the smallest deviation value from all candidate circles as the target fitting circle; The fourth selection unit is used to select the two points that are farthest apart from the target key points as the endpoints of the target arc.

[0114] In one embodiment, optionally, the computing module includes: Angle calculation unit is used to calculate the angle between the two endpoints and the center of the circle based on the coordinates of the endpoints of the target arc and the center coordinates of the target fitted circle. A determining unit is used to determine the angle value of the included angle as the radian value.

[0115] In one embodiment, optionally, the image to be measured is a panel image of a 3C electronic product, and the radian value is the radian value of the four corner arcs of the panel image.

[0116] Based on the above, Figure 1 The method shown, and Figure 9 In order to achieve the above objectives, the present application also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the above-described radian measurement method.

[0117] Based on the above, Figure 1 Correspondingly, this application embodiment also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described radian measurement method.

[0118] Based on this understanding, the technical solution of this application can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, or portable hard drive), and includes several instructions to cause a computer device (such as a personal computer, server, or network device) to execute the methods described in the various implementation scenarios of this application.

[0119] Based on the above, Figure 1 Accordingly, this application also provides a storage medium storing a computer program, which, when executed by a processor, implements the above-described method. Figure 1 The method for measuring radians is shown.

[0120] Based on this understanding, the technical solution of this application can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, or portable hard drive), and includes several instructions to cause a computer device (such as a personal computer, server, or network device) to execute the methods described in the various implementation scenarios of this application.

[0121] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0122] It should be understood that although the terms "first," "second," etc., may be used to describe the setting units in the embodiments of this application, these setting units should not be limited to these terms. These terms are only used to distinguish the setting units from each other. For example, without departing from the scope of the embodiments of this application, the first setting unit may also be referred to as the second setting unit, and similarly, the second setting unit may also be referred to as the first setting unit.

[0123] Depending on the context, the word "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection." Similarly, depending on the context, the phrase "if determination" or "if detection (of the stated condition or event)" can be interpreted as "when determination," "in response to determination," "when detection (of the stated condition or event)," or "in response to detection (of the stated condition or event)."

[0124] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0125] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in a combination of hardware and software functional units.

[0126] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0127] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications 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 this application, and should all be included within the protection scope of this application.

Claims

1. A method for measuring radians, characterized in that, include: Obtain the pre-created arc edge contour template image; On the image to be measured, the arc edge contour template image is used to perform contour similarity matching in order to find the target arc edge contour region and obtain the key point set of the target arc edge contour region. For the set of key points, multiple candidate circles are generated by fitting a circle using three points; Calculate the deviation value corresponding to each candidate circle, determine the target key point based on the deviation value and preset conditions, and determine the target fitting circle and the endpoint of the target arc. The deviation value is the sum of the absolute values ​​of the differences between the distance and radius of the other key points in the key point set (excluding the three points that fit the candidate circle) to the center of the candidate circle. The radian value corresponding to the image to be measured is calculated based on the target fitted circle and the endpoint of the target arc.

2. The radian measurement method according to claim 1, characterized in that, The process of creating a pre-created arc-edge contour template image includes: Obtain the preset template image, and select the ROI region containing the curved edge according to the received selection instructions; The ROI region is segmented according to a preset threshold to obtain an arc-edge region; The arc-shaped region is converted into a contour, and the interfering straight edges in the contour are removed to obtain the arc-shaped contour. Save the arc edge contour as the arc edge contour template image.

3. The radian measurement method according to claim 2, characterized in that, The removal of interfering straight edges in the contour includes: The set of points at the outermost end of the arc edge region is retained as the outer contour of the arc edge; Obtain the circumscribed rectangle of the arc edge region, and shrink the circumscribed rectangle inward by a preset pixel value; Calculate the intersection of the circumscribed rectangle after shrinking and the outer contour of the arc edge to obtain the arc edge contour after removing the interference straight edges.

4. The radian measurement method according to claim 1, characterized in that, Using the arc-edge contour template image for contour similarity matching includes: Based on the shape features of the arc edge contour template image, a region matching the shape features is searched throughout the image to be measured. Calculate the shape similarity between each search region and the arc edge contour template image, and select the region with the highest similarity as the target arc edge contour region.

5. The radian measurement method according to claim 1, characterized in that, Obtaining the key point set of the target arc edge contour region includes: Generate a minimum bounding rectangle based on the target arc edge contour region; Threshold segmentation is performed within the minimum bounding rectangle to obtain the arc edge region to be measured; Extract the contour points of the arc edge region to be measured to form the key point set.

6. The radian measurement method according to claim 1, characterized in that, Multiple candidate circles are generated using a three-point fitting method, including: Three non-collinear points are randomly selected from the set of key points; Calculate the center coordinates and radius of the three points based on the analytical equation of the circle to generate a candidate circle; Traverse all non-collinear three-point combinations in the key point set to generate all candidate circles.

7. The radian measurement method according to claim 1, characterized in that, The preset conditions are: The key points corresponding to the candidate circles whose deviation values ​​exceed the preset deviation values ​​are identified as abnormal key points and removed, and the remaining key points are identified as the target key points.

8. A radian measuring device, characterized in that, include: The acquisition module is used to acquire a pre-created arc edge contour template image; The matching module is used to perform contour similarity matching on the image to be measured using the arc edge contour template image, so as to find the target arc edge contour region and obtain the key point set of the target arc edge contour region. The generation module is used to generate multiple candidate circles for the set of key points by using a three-point fitted circle method; The determination module is used to calculate the deviation value corresponding to each candidate circle, determine the target key points based on the deviation value and preset conditions, and determine the target fitting circle and the endpoint of the target arc. The deviation value is the sum of the absolute values ​​of the differences between the distances and radii of the other key points in the key point set (excluding the three points that fit the candidate circle) to the center of the candidate circle. The calculation module is used to calculate the radian value corresponding to the image to be measured based on the target fitted circle and the endpoint of the target arc.

9. A computer device, characterized in that, include: At least one processor; And, a memory communicatively connected to the at least one processor; The memory stores instructions executable by the at least one processor, the instructions being configured to perform the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The device stores computer-executable instructions for performing the method as described in any one of claims 1 to 7.