Workpiece mark size measurement method, system, device and equipment and storage medium

By combining laser luminance images and point cloud data, the coordinates of sub-pixel edge points and internal pixels are extracted, solving the accuracy problem of measuring the size of imprints on irregular workpiece surfaces and achieving high-precision two-dimensional and spatial size measurement.

CN120852296APending Publication Date: 2025-10-28SPEEDBOT ROBOTICS CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510870463.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-26
Publication Date
2025-10-28

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately measure the dimensions of imprints on the surfaces of irregular workpieces or workpieces with multiple shapes fitting together, and image-based acquisition methods are susceptible to ambient light interference, leading to inaccurate measurements.

Method used

By acquiring the laser luminance image and point cloud data of the workpiece under test, the coordinates of sub-pixel edge points and internal pixels are extracted. The point cloud data is then combined to perform two-dimensional and spatial dimension measurements, reducing ambient light interference and measurement deformation, and adapting to the measurement of irregular workpiece surfaces.

Benefits of technology

It improves the accuracy and applicability of imprint size measurement, and is suitable for irregular workpieces and the surfaces of workpieces with various shapes fitting together, while reducing the influence of ambient light interference and measurement deformation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120852296A_ABST
    Figure CN120852296A_ABST
Patent Text Reader

Abstract

The invention relates to a workpiece mark size measurement method, system, device and equipment and a storage medium. The method comprises the following steps: acquiring a laser brightness image and point cloud data of a to-be-measured workpiece; coordinates of sub-pixel edge points and coordinates of internal pixel points of the imprint are extracted from the laser brightness image, and a sub-pixel edge point coordinate set and an internal pixel point coordinate set are obtained; based on the sub-pixel edge point coordinate set, determining two-dimensional size information of the imprint; based on the point cloud data, determining point cloud coordinates corresponding to the sub-pixel edge points and point cloud coordinates corresponding to the internal pixel points, and obtaining a sub-pixel edge point cloud coordinate set and an internal pixel point cloud coordinate set; and according to the two-dimensional size information, the sub-pixel edge point cloud coordinate set and the internal pixel point cloud coordinate set, determining the space size information of the imprint. The method is beneficial to improving the accuracy of the measurement result of the impression size.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of geometric measurement technology, and in particular to a method, apparatus, computer device, computer-readable storage medium, and computer program product for measuring the size of workpiece imprints. Background Technology

[0002] Currently, most methods for extracting and measuring workpiece surface imprints rely on fitting regular surfaces or matching known surface models to construct measurements. For example, they involve planar unfolding or projection based on surface curve equations to obtain imprint size data. However, this method requires knowledge of the workpiece model or the direction of the fitted surface curve. Therefore, for irregular workpieces or workpieces with multiple shapes, it is difficult to fit using regular equations and obtain surface parameters, leading to inaccurate imprint size data. Furthermore, methods using projection or unfolding based on equation parameters suffer from inaccurate measurement of deformation and inability to effectively reflect spatial dimensions. Additionally, existing image-based methods for acquiring two-dimensional imprint information are often susceptible to interference from ambient light, resulting in inaccurate extraction. Therefore, these technologies suffer from inaccurate workpiece imprint size measurement. Summary of the Invention

[0003] Therefore, it is necessary to provide a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for measuring workpiece imprint dimensions that can improve measurement accuracy, in response to the above-mentioned technical problems.

[0004] In a first aspect, this application provides a method for measuring the size of workpiece imprints, including:

[0005] Acquire laser luminance images and point cloud data of the workpiece under test;

[0006] The coordinates of the sub-pixel edge points and the coordinates of the internal pixels of the imprint are extracted from the laser luminance image to obtain the sub-pixel edge point coordinate set and the internal pixel point coordinate set.

[0007] Based on the sub-pixel edge point coordinate set, the two-dimensional size information of the imprint is determined;

[0008] Based on point cloud data, the point cloud coordinates corresponding to sub-pixel edge points and the point cloud coordinates corresponding to internal pixels are determined, thus obtaining the sub-pixel edge point cloud coordinate set and the internal pixel point cloud coordinate set.

[0009] Based on the two-dimensional size information, the sub-pixel edge point cloud coordinate set, and the internal pixel point cloud coordinate set, the spatial size information of the imprint is determined.

[0010] Secondly, this application also provides a workpiece imprint size measuring device, comprising:

[0011] The data acquisition module is used to acquire the laser luminance image and point cloud data of the workpiece under test;

[0012] The pixel extraction module is used to extract the coordinates of the sub-pixel edge points and the coordinates of the internal pixels of the imprint from the laser luminance image, and obtain the sub-pixel edge point coordinate set and the internal pixel coordinate set.

[0013] The two-dimensional size measurement module is used to determine the two-dimensional size information of the imprint based on the sub-pixel edge point coordinate set;

[0014] The coordinate transformation module is used to determine the point cloud coordinates corresponding to sub-pixel edge points and the point cloud coordinates corresponding to internal pixels based on point cloud data, so as to obtain the sub-pixel edge point cloud coordinate set and the internal pixel point cloud coordinate set.

[0015] The spatial dimension measurement module is used to determine the spatial dimension information of the imprint based on two-dimensional dimension information, sub-pixel edge point cloud coordinate set, and internal pixel point cloud coordinate set.

[0016] Thirdly, this application also provides a workpiece imprint size measurement system, including a processor and a laser scanning module:

[0017] The laser scanning module is used to respond to the scanning information sent by the processor, emit a laser beam to the workpiece to be measured, generate a laser brightness image and point cloud data of the workpiece to be measured based on the reflected beam, and send the laser brightness image and point cloud data to the processor.

[0018] The processor is used to send scanning information to the laser scanning module, acquire the laser luminance image and point cloud data of the workpiece to be tested sent by the laser scanning module, execute the steps in any of the above-mentioned workpiece imprint size measurement method embodiments, and obtain the spatial size information of the imprint of the workpiece to be tested.

[0019] Fourthly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in any of the above embodiments of the workpiece imprint size measurement method.

[0020] Fifthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in any of the above embodiments of the workpiece imprint size measurement method.

[0021] Sixthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps in any of the above embodiments of the workpiece imprint size measurement method.

[0022] The aforementioned workpiece imprint size measurement method, apparatus, computer equipment, computer-readable storage medium, and computer program product, firstly, compared to related technologies that obtain two-dimensional imprint information through grayscale or color images, acquires a laser luminance image of the workpiece to be measured, and extracts sub-pixel edge points and internal pixels of the imprint based on the laser luminance image, obtaining a set of coordinates for the sub-pixel edge points and internal pixels. This helps reduce interference from ambient light and improves the accuracy of imprint-related information extraction. At the same time, by extracting the sub-pixel edge points of the imprint, the accuracy of edge detection is improved, and the edge of the imprint can be better represented, providing data support for precise size measurement. Secondly, compared to related technologies that measure imprint dimensions through projection or planar unfolding based on surface curve equation parameters, this method measures the imprint dimensions based on a set of sub-pixel edge point coordinates. This determines the imprint's two-dimensional size information. Based on the point cloud data of the workpiece to be measured, the two-dimensional coordinates of the imprint's pixels are transformed to obtain the point cloud coordinates corresponding to the sub-pixel edge points and the point cloud coordinates corresponding to the internal pixels. Then, the spatial dimensions of the imprint are measured based on the two-dimensional size information and the point cloud coordinates. This reduces the possibility of measurement deformation and inaccurate spatial dimension measurement caused by planar unfolding or projection along a specified direction. At the same time, it eliminates the need to use regular equations for fitting and obtaining surface curve parameters, thus adapting to the measurement of imprint dimensions on irregular workpieces and workpieces with multiple shapes, improving the accuracy and applicability of imprint spatial dimension measurement. Attached Figure Description

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

[0024] Figure 1 This is a diagram illustrating the application environment of a workpiece imprint size measurement method in one embodiment.

[0025] Figure 2 This is a flowchart illustrating a method for measuring the size of workpiece imprints in one embodiment;

[0026] Figure 3 This is a flowchart illustrating the method for measuring the size of workpiece imprints in another embodiment;

[0027] Figure 4 This is a flowchart illustrating the method for measuring the size of workpiece imprints in yet another embodiment;

[0028] Figure 5 This is a structural block diagram of a workpiece imprint size measurement system in one embodiment;

[0029] Figure 6 This is a schematic diagram illustrating the measurement of workpiece imprint dimensions in one embodiment;

[0030] Figure 7 This is a structural block diagram of a workpiece imprint size measuring device in one embodiment;

[0031] Figure 8 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0032] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0033] The workpiece imprint size measurement method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104, or it can be located in the cloud or on another network server.

[0034] Specifically, terminal 102 can upload the collected laser luminance image and point cloud data of the workpiece to be tested to server 104. Server 104 obtains the laser luminance image and point cloud data of the workpiece to be tested. Next, it extracts the coordinates of the sub-pixel edge points and the coordinates of the internal pixels of the imprint from the laser luminance image to obtain the sub-pixel edge point coordinate set and the internal pixel point coordinate set. Based on the sub-pixel edge point coordinate set, it determines the two-dimensional size information of the imprint. Then, based on the point cloud data, it determines the point cloud coordinates corresponding to the sub-pixel edge points and the point cloud coordinates corresponding to the internal pixels to obtain the sub-pixel edge point cloud coordinate set and the internal pixel point cloud coordinate set. Finally, based on the two-dimensional size information, the sub-pixel edge point cloud coordinate set and the internal pixel point cloud coordinate set, it determines the spatial size information of the imprint.

[0035] The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle systems, and projection equipment. Portable wearable devices can include smartwatches and smart bracelets. The server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0036] In one exemplary embodiment, such as Figure 2As shown, a method for measuring the size of workpiece imprints is provided, which can be applied to... Figure 1 Taking server 104 as an example, the explanation includes the following steps (hereinafter referred to as S): S100 to S500. Wherein:

[0037] S100 acquires the laser luminance image and point cloud data of the workpiece under test.

[0038] The workpiece to be tested can be a workpiece with marks on its surface. These marks can be various traces caused by friction from machining tools during the processing of the workpiece, including but not limited to pry marks, scratch marks, shear marks, saw marks, and cutting marks. In this embodiment, the surface of the workpiece to be tested includes, but is not limited to, surfaces composed of elementary analytical surfaces such as planes, cylindrical surfaces, conical surfaces, and spherical surfaces; surfaces composed of free-form surfaces that change freely in complex ways; and surfaces composed of multiple shapes fitted together. A free-form surface refers to a surface whose shape cannot be continuously processed and has the arbitrary characteristics of traditional machining.

[0039] The point cloud data can include the point cloud coordinates of each point on the surface of the workpiece under test. The laser luminance image can include the intensity of reflected light at each point on the surface of the workpiece under test. The laser luminance image is used to reflect the reflection characteristics of the surface of the workpiece under test, such as shape, color, and texture.

[0040] In one example, the laser grayscale image and point cloud data of the workpiece under test can be acquired through laser scanning or laser imaging technology. Specifically, a laser scanning camera can emit a laser beam onto the surface of the workpiece under test through a laser emitter. The time or phase change of the laser's round trip is measured based on the reflected light, the distance to each point on the surface of the workpiece under test is calculated, the three-dimensional coordinate data of each point on the surface of the workpiece under test is obtained, and the intensity of the reflected light at each point is recorded to form a laser luminance image.

[0041] In one example, the point cloud data of the workpiece under test can also be obtained by acquiring an image of the workpiece under test using a depth camera, obtaining a depth image, and then converting the depth image into a point cloud to obtain point cloud data.

[0042] In practical implementation, taking the surface of the workpiece to be tested as a free-form surface as an example, a specific space can be pre-defined in the factory as the detection area. The workpiece to be tested is placed on the detection platform, and the server controls the laser scanning camera in the detection area to acquire the laser luminance image G of the surface of the workpiece to be tested. m Point cloud data P m The laser scanning camera will generate a laser grayscale image G. m Point cloud data P m Uploaded to the server.

[0043] S200 extracts the coordinates of the sub-pixel edge points and the coordinates of the internal pixels of the imprint from the laser luminance image, thus obtaining the sub-pixel edge point coordinate set and the internal pixel point coordinate set.

[0044] In this context, subpixels refer to virtual points that lie between physical pixels, meaning their resolution exceeds the sensor's physical pixel limit. Subpixel edge points are the edge points of the imprint with subpixel precision, representing finer features. Inner pixels are pixels located within the region enclosed by subpixel edge points. The subpixel edge point coordinate set includes the coordinates of each subpixel edge point, and the inner pixel point coordinate set includes the coordinates of each inner pixel.

[0045] In practical applications, the server can use edge detection methods to detect the laser luminance image, identify the edge position of the imprint, and estimate the position of the sub-pixel edge point by using the values ​​of surrounding pixels through linear interpolation and other methods. This yields the coordinates of the sub-pixel edge point of the imprint with sub-pixel precision. Based on the coordinate set of the sub-pixel edge point, the region where the imprint is located is determined from the laser luminance image. The pixels inside the imprint region are then identified as internal pixels, and their coordinates are obtained.

[0046] In one embodiment, the ROI (Region of Interest) can be pre-defined based on the size of the workpiece to be tested. Continuing the example above, the workpiece is placed on a testing platform for inspection. The ROI can be pre-defined based on the minimum rectangle of the workpiece surface, or the ROI can be set to a specific area of ​​the workpiece surface according to the inspection requirements. Understandably, the ROI is smaller than the workpiece surface size but larger than the imprint area to eliminate interference. Thus, the coordinates of the sub-pixel edge points and internal pixels of the imprint are extracted from the laser luminance image, resulting in a set of sub-pixel edge point coordinates and an internal pixel coordinate set; that is, the laser luminance image within the ROI region is extracted.

[0047] In practice, the operator can pre-set the ROI area and the imprint index number of the workpiece to be tested, and construct a set [name, pt i ] represents the ROI region of each imprint, where name is the imprint number name. For example, let the imprint number name of the workpiece to be tested be A, pt i Let pt be a series of pixels that surround the area around imprint A. i The area enclosed by the image is called the Region of Interest (ROI). The server retrieves the laser luminance image G... m Laser luminance image G segmented from ROI region m-roi Laser luminance image G m-roi As shown in the following formula:

[0048]

[0049] For laser luminance image G m-roi Edge detection is performed to identify edge points. Sub-pixel edge point positions are determined using methods such as linear interpolation based on the values ​​of surrounding pixels, resulting in the sub-pixel precision sub-pixel edge point coordinate set E for imprint A. i [u i , v i Based on the coordinate set of sub-pixel edge points, pixels inside the imprint region are selected from the laser luminance image to obtain the internal pixel coordinate set I. i [u i , v i ].

[0050] S300 determines the two-dimensional size information of the imprint based on the sub-pixel edge point coordinate set.

[0051] Among them, the two-dimensional dimensional information is used to describe the size of the imprint in the plane, including but not limited to the length and width of the imprint.

[0052] In one example, the server can fit the sub-pixel edge point coordinates into a regular geometric shape model (such as a rectangle, ellipse, polygon, etc.) using a fitting method, and then use PCA principal component analysis to calculate the length and width of the imprint.

[0053] In other embodiments, the server may determine the two dimensions of the imprint based on the internal pixel coordinate set. Specifically, the length and width of the imprint are calculated using principal component analysis based on the internal pixel coordinate set.

[0054] S400, based on point cloud data, determines the point cloud coordinates corresponding to sub-pixel edge points and the point cloud coordinates corresponding to internal pixels, thus obtaining the sub-pixel edge point cloud coordinate set and the internal pixel point cloud coordinate set.

[0055] The sub-pixel edge point cloud coordinate set includes the point cloud coordinates corresponding to each sub-pixel edge point, and the internal pixel point cloud coordinate set includes the point cloud coordinate set corresponding to each internal pixel point.

[0056] In one example, the mapping relationship between the point cloud coordinates of each point in the point cloud data and the pixel points in the laser luminance image can be determined in advance based on the parameters of the laser scanning camera. Through the mapping relationship, the two-dimensional coordinates of the internal pixel points can be directly converted into point cloud coordinates to obtain the internal pixel point cloud coordinate set.

[0057] S500 determines the spatial size information of the imprint based on the two-dimensional size information, the sub-pixel edge point cloud coordinate set, and the internal pixel point cloud coordinate set.

[0058] The spatial dimensions of the imprint include, but are not limited to, spatial length and spatial width.

[0059] In practical applications, the spatial length of the imprint can be obtained by determining the distance between the point cloud coordinates of the endpoints along the two-dimensional length direction based on the sub-pixel edge point cloud coordinate set and the two-dimensional length and width information in the two-dimensional dimension information. Similarly, the spatial width of the imprint can be obtained by determining the distance between the point cloud coordinates of the endpoints along the two-dimensional width direction. In other implementations, the principal axis direction of the imprint can be determined through principal component analysis based on the sub-pixel edge point cloud coordinate set. The spatial length and width of the imprint can then be obtained based on the maximum distance between sub-pixel edge points along the principal axis direction.

[0060] In the above-mentioned method for measuring the size of workpiece imprints, firstly, compared with the related technologies that obtain two-dimensional information of imprints through grayscale or color images, this method obtains the laser luminance image of the workpiece to be measured, and extracts the sub-pixel edge points and internal pixels of the imprint based on the laser luminance image, obtaining the coordinate sets of the sub-pixel edge points and the coordinate sets of the internal pixels. This helps to reduce the interference of ambient light and improve the accuracy of imprint-related information extraction. At the same time, by extracting the sub-pixel edge points of the imprint, the accuracy of edge detection is improved, which can better represent the edge of the imprint and provide data support for accurate size measurement. Secondly, compared to related technologies that measure imprint dimensions through projection or planar unfolding based on surface curve equation parameters, this method measures the imprint dimensions based on a set of sub-pixel edge point coordinates. This determines the imprint's two-dimensional size information. Based on the point cloud data of the workpiece to be measured, the two-dimensional coordinates of the imprint's pixels are transformed to obtain the point cloud coordinates corresponding to the sub-pixel edge points and the point cloud coordinates corresponding to the internal pixels. Then, the spatial dimensions of the imprint are measured based on the two-dimensional size information and the point cloud coordinates. This reduces the possibility of measurement deformation and inaccurate spatial dimension measurement caused by planar unfolding or projection along a specified direction. At the same time, it eliminates the need to use regular equations for fitting and obtaining surface curve parameters, thus adapting to the measurement of imprint dimensions on irregular workpieces and workpieces with multiple shapes, improving the accuracy and applicability of imprint spatial dimension measurement.

[0061] In an exemplary embodiment, extracting the coordinates of sub-pixel edge points and internal pixel points of the imprint from the laser luminance image to obtain the sub-pixel edge point coordinate set and internal pixel point coordinate set includes steps S220 to S280. Wherein:

[0062] S220: Extract the contour from the laser luminance image to obtain a set of contour points. Extract the imprint area from the luminance image based on the set of contour points to obtain a set of imprint contour point coordinates.

[0063] Among them, the set of coordinates of the imprint contour points is the set of coordinates of the contour points of the imprint area.

[0064] In practical applications, contour detection of the laser luminance image can be performed based on binarization. Based on the detected contours, instance segmentation is performed to obtain the contour point set and contour order of each contour instance. Then, based on the contour order, the contour point sequence of the imprint is organized to determine the imprint region, obtaining the contour point coordinate set of the imprint region. Specifically, continuing from the above embodiment: First, the server performs threshold filtering binarization processing on the laser luminance image, setting pixels with luminance values ​​greater than a preset luminance threshold to 1, and others to 0. The laser luminance image G is then obtained using the following formula. m-roi Convert to binary image B mi :

[0065]

[0066] Subsequently, the binary image B was analyzed. m Perform classical connected component contour extraction, that is, extract the contours of the entire binarized image B. m A scan traversal is performed. If the scan point itself has a value of 1, an 8-directional surrounding connectivity search is performed to form a contour. If there are surrounding pixels with a value of 0, this scan point is marked as a boundary point. The contour order is changed and recorded according to the situation inside and outside the boundary where the current scan point is located, that is, the left and right or up and down situation of the scanned pixels where the surrounding pixels with a value of 0 are located, and the coordinates of the boundary point are recorded.

[0067] Then, iterate through B. m Then, the boundary points and their contour order set are obtained, and contour instances are segmented according to the contour order to obtain the edge point set of a single instance. Furthermore, the contour points are sorted according to the contour order to obtain the imprint contour point coordinate set X. i [u i , v i ] .

[0068] In other implementations, the outline points of the imprint can be extracted by detecting edges in the laser luminance image using edge detection operators, thus obtaining a set of outline point coordinates. Edge detection operators include Sobel, Laplacian, and Canny operators, among others.

[0069] S240, based on the set of coordinates of the imprint contour points, filters the imprint contour points in the laser luminance image.

[0070] The filtering process includes, but is not limited to, Gaussian filtering, mean filtering, and median filtering. For example, after obtaining the set of imprint contour point coordinates, the server applies the following formula to each imprint contour point in the laser luminance image for two-dimensional Gaussian filtering, where f(m, n) represents the luminance value at the imprint contour point coordinates (m, n), σ represents the Gaussian kernel size, and g... σ(m, n) represents the image after Gaussian filtering.

[0071]

[0072] S260, based on the set of coordinates of the imprint contour points, perform sub-pixel edge extraction on the filtered laser luminance image to obtain the set of coordinates of the sub-pixel edge points of the imprint.

[0073] In practical applications, the server can use interpolation methods to calculate the sub-pixel precision edge points (contour points) of the imprint between the actual luminance values ​​of each imprint contour point, thus obtaining the sub-pixel edge point coordinate set E. i [u i , v i ].

[0074] S280, based on the sub-pixel edge point coordinate set, filter out the internal pixel points of the imprint from the filtered laser luminance image to obtain the internal pixel point coordinate set.

[0075] In practical applications, following the above embodiments, the server bases its data on the sub-pixel edge set E. i [u i , v i ] For the brightness image G m-roi Perform region selection and traverse the luminance image G m-roi All pixels, filter those with coordinates belonging to E i The set of pixels inside is determined as the pixels inside the edge region of imprint A, thus obtaining the set of internal coordinates I. i [u i , v i ].

[0076] In this embodiment, contour extraction is performed on the laser luminance image, and the imprint region is segmented based on the contour points to obtain the set of contour point coordinates of the imprint region. Filtering the luminance image helps to improve the accuracy of extracting sub-pixel edge points.

[0077] In one exemplary embodiment, such as Figure 3 As shown, based on the set of coordinates of the imprint contour points, sub-pixel edge extraction is performed on the filtered laser luminance image to obtain the set of sub-pixel edge point coordinates of the imprint, including S262 to S268. Wherein:

[0078] S262, based on the edge detection operator, determines the gradient magnitude and gradient direction of each imprint contour point.

[0079] In practical applications, the server uses an edge detection operator to calculate the gradient magnitude and direction of each imprint contour point. For example, for the Gaussian-filtered image g... σFor each imprint contour point in (m, n), multiplying the imprint contour point by the Sobel operator yields the gradient values ​​g in the x and y directions of the imprint contour point. x (m, n), g y (m, n). The gradient magnitude G(m, n) and gradient direction θ(m, n) of the imprint contour points are obtained using the following formulas:

[0080]

[0081]

[0082] S264: For each imprint contour point, determine the pixel neighbor points in the gradient direction of the imprint contour point, and determine the gradient value of the pixel neighbor points through linear interpolation.

[0083] Among them, the neighboring points of a pixel are the adjacent points that are one pixel away from the pixel in the gradient direction of the imprint contour point.

[0084] In specific implementation, for g σ For each imprint contour point b(m, n) in (m, n), the gradient magnitude g of two adjacent points a and c (pixel-adjacent points) with a distance of one pixel along the direction θ(m, n) is calculated by interpolation. a g c The coordinates of the pixel neighbors g(j, k) of the imprint contour point can be calculated using the following formula:

[0085]

[0086] S266 determines the comprehensive gradient magnitude based on the gradient magnitudes of the imprint contour points and the individual gradient magnitudes of the pixel's adjacent points.

[0087] Among them, the comprehensive gradient magnitude is used to determine the sub-pixel edge points.

[0088] In practice, the gradient magnitude g of the imprint outline pixels is used as the basis for implementation. b Gradient magnitude g of adjacent pixels a g c The comprehensive gradient magnitude λ is determined by the following formula:

[0089]

[0090] S268: Based on the comprehensive gradient magnitude and the gradient direction of the imprint contour points, determine the coordinates of the sub-pixel edge points to obtain the sub-pixel edge point coordinate set.

[0091] In practical implementation, based on the comprehensive gradient magnitude λ and the gradient direction θ(m, n) of the imprint contour points, the coordinates C of the sub-pixel edge points are determined using the following formulas.x , C y This yields a set of sub-pixel edge point coordinates containing the coordinates of each sub-pixel edge point.

[0092]

[0093]

[0094] In this embodiment, the sub-pixel edge points of the imprint are extracted by edge detection and interpolation calculation, and the coordinate set of the sub-pixel edge points is obtained, which improves the accuracy of edge extraction and thus helps to improve the accuracy of imprint size measurement.

[0095] In one exemplary embodiment, the two-dimensional size information of the imprint is determined based on the sub-pixel edge point coordinate set, including S320 to S380:

[0096] In this embodiment, following the above embodiment, the sub-pixel coordinate set E of imprint A is used. i [u i , v i ] and internal pixel coordinate set I i [u i , v i Two-dimensional measurements are performed to obtain the two-dimensional dimension information K[C, L, W, S] of the imprint A, where C[u, v] is the coordinate of the sub-pixel center point of the imprint, L[length, l1[u, v], l2[u, v]] is the two-dimensional length, length endpoints l1[u, v] and l2[u, v], W[width, w1[u, v], w2[u, v]] is the two-dimensional width, width endpoints w1[u, v] and w2[u, v], and S is the two-dimensional area.

[0097] S320: Determine the weighted average of the horizontal and vertical coordinates of each sub-pixel edge point to obtain the coordinates of the sub-pixel center point of the imprint.

[0098] Among them, the subpixel center point is the subpixel-level center point of the imprint.

[0099] In practical applications, the sub-pixel center point can be obtained by the server traversing the sub-pixel coordinate set E. i [u i , v i The weighted summation of the x-coordinates of each sub-pixel edge point and the average value are used to obtain the x-coordinate u of the sub-pixel center point; the weighted summation of the y-coordinates of each sub-pixel edge point and the average value are used to obtain the y-coordinate v of the sub-pixel center point, thus obtaining the coordinates C[u, v] of the sub-pixel center point. The weights of the x-coordinates and y-coordinates are set empirically.

[0100] Understandably, in other embodiments, the average of the x and y coordinates of each sub-pixel edge point can be determined to obtain the coordinates of the sub-pixel center point of the imprint. Alternatively, the minimum bounding rectangle or minimum bounding circle of the imprint can be determined based on the set of sub-pixel edge point coordinates, and the coordinates of the center of the minimum bounding rectangle or minimum bounding circle can be determined as the coordinates of the sub-pixel center point. This application does not limit this.

[0101] S340, determine the distance between any two sub-pixel edge points in the sub-pixel edge point coordinate set, determine the two sub-pixel edge points corresponding to the maximum distance as the length endpoints, and determine the maximum distance as the two-dimensional length of the imprint.

[0102] In practical applications, the distance between every two sub-pixel edge points can be determined using distance algorithms, such as Euclidean distance and Manhattan distance. For example, the set of sub-pixel coordinates E of the edge of imprint A... i [u i ,v i Perform distance calculation.

[0103] Iterate through the pixels to obtain the two points l1[u, v] and l2[u, v] that are farthest apart by Euclidean distance, and take them as the endpoints of the pixel length. Then take the Euclidean distance between the endpoints as the two-dimensional length of the imprint.

[0104] S360 uses the vertical line connecting the length endpoints as the search direction, determines the two sub-pixel edge points corresponding to the maximum distance in the search direction as the width endpoints, and determines the maximum distance in the search direction as the two-dimensional width of the imprint.

[0105] In practical applications, the search direction is taken as the perpendicular line between the two length endpoints l1[u, v] and l2[u, v], and the sub-pixel edge point coordinate set E. i [u i , v i The algorithm iterates through the data and obtains the two points w1[u, v] and w2[u, v] that are farthest apart in the Euclidean distance along the search direction as the width endpoints. The Euclidean distance between the width endpoints is then taken as the two-dimensional width of the imprint.

[0106] S380 determines the two-dimensional area of ​​the imprint based on the distance between each pair of sub-pixel edge points.

[0107] In practical applications, it is possible to traverse the sub-pixel edge point coordinate set E along the vertical axis. i [u i , v iFor each column's sub-pixel endpoints (i.e., the topmost and bottommost sub-pixel edge points of that column), calculate the distance between the sub-pixel endpoints of that column. Add these distances together to obtain the two-dimensional area S of the imprint. Alternatively, one could iterate along the horizontal axis and add the distances of the sub-pixel endpoints of each row to obtain the two-dimensional area of ​​the imprint.

[0108] Two-dimensional dimensional information includes the coordinates of the subpixel center point, two-dimensional length, length endpoints, two-dimensional width, width endpoints, and two-dimensional area.

[0109] In this embodiment, the two-dimensional size information of the imprint is calculated by using the sub-pixel edge point coordinate set, which helps to improve the accuracy of the two-dimensional size information, thereby improving the accuracy of measuring the spatial size of the imprint.

[0110] In other embodiments, the two-dimensional dimensions of the imprint can be determined based on the coordinate set of internal pixels. Specifically, referring to the method of determining the two-dimensional dimensions of the imprint based on the coordinate set of sub-pixel edge points: The weighted average of the abscissa and ordinate of each internal pixel is determined to obtain the coordinates of the pixel center point of the imprint, where the pixel center point represents the pixel-level center point of the imprint. The distance between each pair of internal pixels in the coordinate set is determined, and the two internal pixels with the largest distance are identified as length endpoints, with the maximum distance being the two-dimensional length of the imprint. The two internal pixels with the largest distance in the vertical axis direction are identified as width endpoints, with the maximum distance in the vertical axis direction being the two-dimensional width of the imprint. The two-dimensional area of ​​the imprint is determined based on the proximity between each pair of internal pixels.

[0111] In an exemplary embodiment, determining the point cloud coordinates corresponding to sub-pixel edge points and the point cloud coordinates corresponding to internal pixels based on point cloud data includes:

[0112] Based on the point cloud data and the preset homography matrix, the point cloud coordinates corresponding to each pixel in the laser luminance image are determined.

[0113] The homography matrix is ​​used to map the coordinates of each point in the laser luminance image to the point cloud coordinate system. The homography matrix can be calculated based on known two-dimensional image points and their corresponding points in the point cloud coordinate system.

[0114] In practical applications, the following formula is used to calculate the homography matrix V based on the point cloud data. i Determine the two-dimensional coordinates of each pixel in the laser luminance image [u i , v i The corresponding point cloud coordinates t i [x i , y i , z i]:

[0115]

[0116] For each sub-pixel edge point, determine the neighboring points of the sub-pixel edge point, and determine the point cloud coordinates corresponding to the sub-pixel edge point based on the point cloud coordinates of the neighboring points.

[0117] The number of neighboring points for each sub-pixel edge point can be four, eight, or other numbers. For example, for each sub-pixel edge point E... i [u i , v i The four adjacent points E around ia [u ia , v ia ]、E ib [u ib , v ib ]、E ic [u ic ,v ic ]、E id [u id , v id Determine the point cloud coordinates t corresponding to adjacent points. ia [x ia , y ia , z ia ]、t ib [x ib , y ib , z ib ]、t ic [x ic , y ic , z ic ]、t id [x id , y id , z id The sub-pixel edge point E is determined by the following formula. i [u i , v i The corresponding point cloud coordinates EP i [x i , y i , z i ]:

[0118]

[0119] For each internal pixel, the point cloud coordinates of the internal pixel are determined based on the internal pixel's coordinates and a preset homography matrix.

[0120] In practical applications, for the internal pixel coordinate set I i [ui , v i The corresponding point cloud coordinates (IP) can be obtained by transforming a preset homography matrix. i [x i , y i , z i ].

[0121] In this embodiment, by determining the point cloud coordinates of the sub-pixel edge points and internal pixels of the imprint, it is beneficial to determine the spatial size information of the imprint based on the point cloud coordinates, thereby improving the accuracy of spatial size measurement.

[0122] In one exemplary embodiment, such as Figure 4 As shown, based on the two-dimensional size information, the sub-pixel edge point cloud coordinate set, and the internal pixel point cloud coordinate set, the spatial size information of the imprint is determined, including S510 to S570:

[0123] In this embodiment, following the above embodiment, based on the two-dimensional size information K[C, L, W, S] of the imprint A and the sub-pixel coordinate set E i [u i , v i ] and internal pixel coordinate set I i [u i , v i Perform spatial dimension measurement to obtain the spatial dimension information R[C', L', W', S'] of imprint A.

[0124] S510, determine the neighboring points of the sub-pixel center point, and determine the point cloud coordinates of the sub-pixel center point based on the point cloud coordinates of the neighboring points.

[0125] In practical applications, the point cloud coordinates C' corresponding to the sub-pixel center point C[u, v] are determined by formula, referring to the method of determining the point cloud coordinates corresponding to the sub-pixel edge points. This will not be elaborated further here.

[0126] S520, determine a first sub-pixel point on the straight line between the length endpoints and a second sub-pixel point on the straight line between the width endpoints.

[0127] The first sub-pixel is the sub-pixel on the straight line between the length endpoints, and the second sub-pixel is the sub-pixel on the straight line between the width endpoints.

[0128] In practical applications, the equation of the straight line between length endpoints l1[u1, v1] and l2[u2, v2] is determined using the following formula:

[0129]

[0130] Traverse all first sub-pixel points in the linear equation according to either the x-coordinate or y-coordinate. The method for determining the second sub-pixel point is the same as that for determining the first sub-pixel point.

[0131] S530: For each first sub-pixel, determine the neighboring points of the first sub-pixel, and determine the first point cloud coordinates of the first sub-pixel based on the point cloud coordinates corresponding to the neighboring points.

[0132] Wherein, the first point cloud coordinates are the point cloud coordinates corresponding to the first sub-pixel.

[0133] In practical applications, for each first sub-pixel, the neighboring points of the first sub-pixel are determined, and the point cloud coordinates of the first sub-pixel are determined based on the point cloud coordinates of the neighboring points. Here, the method of determining the point cloud coordinates corresponding to the sub-pixel edge points in the above embodiment is referred to, and the first point cloud coordinates corresponding to the first sub-pixel are determined by formula, which will not be repeated here.

[0134] S540 determines the distance between each pair of adjacent first sub-pixels based on the cloud coordinates of each first point, and determines the spatial length of the imprint based on the distance between each pair of adjacent first pixels.

[0135] In practical applications, distance algorithms, such as Euclidean distance and Manhattan distance, are used to calculate the distance between adjacent first sub-pixel points on the straight line based on the cloud coordinates of each first point, and then sum them up to obtain the spatial length L' of the imprint.

[0136] S550: For each second sub-pixel, determine the neighboring points of the second sub-pixel, and determine the second point cloud coordinates of the second sub-pixel based on the point cloud coordinates corresponding to the neighboring points.

[0137] In practical applications, for each second sub-pixel, the neighboring points of the second sub-pixel are determined, and the point cloud coordinates of the second sub-pixel are determined based on the point cloud coordinates of the neighboring points. Here, the method of determining the point cloud coordinates corresponding to the sub-pixel edge points in the above embodiment is referred to, and the second point cloud coordinates corresponding to the second sub-pixel are determined by formula, which will not be repeated here.

[0138] S560 determines the distance between each pair of adjacent second sub-pixels based on the cloud coordinates of each second point, and determines the spatial width of the imprint based on the distance between each pair of adjacent second pixels.

[0139] In practical applications, distance algorithms, such as Euclidean distance and Manhattan distance, are used to calculate the distance between adjacent second sub-pixel points on the straight line based on the cloud coordinates of each second point, and then sum them up to obtain the spatial length W' of the imprint.

[0140] S570 defines each sub-pixel edge point and each internal pixel point as an imprint pixel point, determines the area of ​​the plane formed by three adjacent imprint pixels points, and determines the spatial area of ​​the imprint by summing the areas of each area. The spatial size information includes the point cloud coordinates of the sub-pixel center point, the spatial length, the spatial width, and the spatial area.

[0141] In practical applications, the point cloud coordinate set EP of the sub-pixel edge points of the merged imprint is used. i [x i , y i , z i The point cloud collection of internal pixels IP i [x i , y i , z i The point cloud coordinates of the imprint pixels are obtained. The area s' of three adjacent imprint pixels is calculated by iterating through them using the following formula. The sum of all areas is then used to obtain the spatial area S' of the imprint:

[0142]

[0143] In this embodiment, the spatial dimensions of the imprint are directly measured using two-dimensional size information and point cloud data of the imprint, without the need for measurement through planar unfolding or projection along a specified direction. This reduces the possibility of measurement deformation and inaccurate spatial dimension measurement, and improves the accuracy of imprint spatial dimension measurement.

[0144] In one exemplary embodiment, the method further includes: integrating the spatial dimension information of the imprint to generate a measurement report.

[0145] In practical applications, spatial dimensions of imprints on multiple workpieces can be measured to obtain spatial dimension information corresponding to different imprints. Spatial dimension information from different imprints can be integrated to generate a measurement report. In other embodiments, the measurement report can also be pushed to a terminal. Methods for pushing the measurement report may include displaying the report on a screen, providing prompts through specific sound or vibration patterns, or providing visual prompts through flashing indicator lights. It is understood that the method for pushing the measurement report can be any one of the aforementioned methods or any combination of multiple methods.

[0146] In this embodiment, generating and pushing measurement reports helps to adjust the parameters generated during workpiece processing, thereby improving workpiece quality and reducing the possibility of imprints.

[0147] To provide a clearer explanation of the workpiece imprint size measurement method provided in this application, a specific embodiment is described below, which includes the following steps:

[0148] S1, acquire the laser luminance image and point cloud data of the workpiece to be tested.

[0149] S2, extract the contour of the laser luminance image to obtain a set of contour points, extract the imprint area from the luminance image based on the set of contour points to obtain the set of coordinates of the imprint contour points, and filter the imprint contour points in the laser luminance image based on the set of coordinates of the imprint contour points.

[0150] S3. Based on the edge detection operator, determine the gradient magnitude and gradient direction of each imprint contour point. For each imprint contour point, determine the pixel neighbor points in the gradient direction of the imprint contour point. Determine the gradient magnitude of the pixel neighbor points through linear interpolation. Based on the gradient magnitudes of the imprint contour point and the pixel neighbor points, determine the comprehensive gradient magnitude. Based on the comprehensive gradient magnitude and the gradient direction of the imprint contour point, determine the coordinates of the sub-pixel edge points to obtain the sub-pixel edge point coordinate set.

[0151] S4. Based on the sub-pixel edge point coordinate set, filter out the internal pixel points of the imprint from the filtered laser luminance image to obtain the internal pixel point coordinate set.

[0152] S5, determine the weighted average of the horizontal and vertical coordinates of each sub-pixel edge point to obtain the coordinates of the sub-pixel center point of the imprint, determine the distance between each pair of sub-pixel edge points in the sub-pixel edge point coordinate set, determine the two sub-pixel edge points corresponding to the maximum distance as the length endpoints, and determine the maximum distance as the two-dimensional length of the imprint.

[0153] S6, taking the perpendicular line of the connecting line of the length endpoints as the search direction, determine the two sub-pixel edge points corresponding to the maximum distance in the search direction as the width endpoints, determine the maximum distance in the search direction as the two-dimensional width of the imprint, and determine the two-dimensional area of ​​the imprint based on the distance between the two sub-pixel edge points. The two-dimensional size information includes the coordinates of the sub-pixel center point, the two-dimensional length, the length endpoints, the two-dimensional width, the width endpoints, and the two-dimensional area.

[0154] S7. Based on the point cloud data and a preset homography matrix, determine the point cloud coordinates corresponding to each pixel in the laser luminance image. For each sub-pixel edge point, determine the adjacent points of the sub-pixel edge point. Based on the point cloud coordinates corresponding to the adjacent points, determine the point cloud coordinates corresponding to the sub-pixel edge point. For each internal pixel, determine the point cloud coordinates of the internal pixel based on the coordinates of the internal pixel and the preset homography matrix.

[0155] S8, determine the neighboring points of the sub-pixel center point, determine the point cloud coordinates of the sub-pixel center point based on the point cloud coordinates of the neighboring points, determine the first sub-pixel point on the straight line between the length endpoints and the second sub-pixel point on the straight line between the width endpoints, for each first sub-pixel point, determine the neighboring points of the first sub-pixel point, determine the first point cloud coordinates of the first sub-pixel point based on the point cloud coordinates corresponding to the neighboring points, determine the distance between each pair of adjacent first sub-pixel points based on each first point cloud coordinate, and determine the spatial length of the imprint based on the distance between each pair of adjacent first pixel points.

[0156] S9, for each second sub-pixel, determine the adjacent points of the second sub-pixel, determine the second point cloud coordinates of the second sub-pixel based on the point cloud coordinates corresponding to the adjacent points, determine the distance between each pair of adjacent second sub-pixels based on each second point cloud coordinate, determine the spatial width of the imprint based on the distance between each pair of adjacent second pixels, determine each sub-pixel edge point and each internal pixel point as imprint pixels, determine the area of ​​the plane formed by three adjacent imprint pixels, and determine the sum of the areas of each plane as the spatial area of ​​the imprint. The spatial size information includes the point cloud coordinates of the sub-pixel center point, the spatial length, the spatial width, and the spatial area.

[0157] S10, integrate the spatial dimension information of the imprint and generate a measurement report.

[0158] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0159] Based on the same inventive concept, in an exemplary embodiment, such as Figure 5 As shown, a workpiece imprint size measurement system is provided, including a laser scanning module 120 and a processor 140:

[0160] The laser scanning module 120 is used to respond to the scanning information sent by the processor 140, emit a laser beam to the workpiece to be measured, generate a laser brightness image and point cloud data of the workpiece to be measured based on the reflected beam, and send the laser brightness image and point cloud data to the processor 140.

[0161] The processor 140 is used to send scanning information to the laser scanning module 120, acquire the laser luminance image and point cloud data of the workpiece to be tested sent by the laser scanning module 120, and execute the steps as described in any of the above embodiments of the workpiece imprint size measurement method to obtain the spatial size information of the imprint of the workpiece to be tested.

[0162] like Figure 5 As described, 120 is the laser scanning module, 140 is the processor, and the workpiece to be measured (not numbered in the figure) is located below the laser scanning module. Figure 6 Specifically, 6-1 is the laser luminance image, 6-2 is the two-dimensional sub-pixel edge points and internal pixels of the imprint, 6-3 is the point cloud data of the imprint, and 6-4 is the spatial size information of the imprint.

[0163] In practical applications, the processor 140 sends a scanning signal to the laser scanning module 120. After receiving the scanning information, the laser scanning module 120 acquires the point cloud data and laser luminance image of the surface of the workpiece under test within its field of view and transmits them back to the processor 140. Subsequently, the processor 140 extracts sub-pixel edge points and internal pixel points 6-2 from the laser luminance image 6-1, and performs two-dimensional size measurement to obtain the size measurement guidance information (two-dimensional size information) of the imprint. Further, through the point cloud data 6-3, it acquires the point cloud data corresponding to the sub-pixel edge points and internal pixel points 6-2. Then, through the two-dimensional size measurement guidance information and the point cloud data corresponding to the sub-pixel edge points and internal pixel points 6-2, it obtains the spatial size information 6-4 of each imprint and generates an imprint measurement report. The steps in any of the above embodiments of the workpiece imprint size measurement method are referenced here and will not be repeated here.

[0164] In one exemplary embodiment, such as Figure 7 As shown, a workpiece imprint size measuring device 600 is provided, including: a data acquisition module 610, a pixel extraction module 620, a two-dimensional size measurement module 630, a coordinate transformation module 640, and a spatial size measurement module 650, wherein:

[0165] The data acquisition module 610 is used to acquire the laser luminance image and point cloud data of the workpiece under test.

[0166] The pixel extraction module 620 is used to extract the coordinates of the sub-pixel edge points and the coordinates of the internal pixels of the imprint from the laser brightness image, so as to obtain the sub-pixel edge point coordinate set and the internal pixel point coordinate set.

[0167] The two-dimensional size measurement module 630 is used to determine the two-dimensional size information of the imprint based on the sub-pixel edge point coordinate set.

[0168] The coordinate transformation module 640 is used to determine the point cloud coordinates corresponding to sub-pixel edge points and the point cloud coordinates corresponding to internal pixels based on point cloud data, so as to obtain the sub-pixel edge point cloud coordinate set and the internal pixel point cloud coordinate set.

[0169] The spatial dimension measurement module 650 is used to determine the spatial dimension information of the imprint based on the two-dimensional dimension information, the sub-pixel edge point cloud coordinate set, and the internal pixel point cloud coordinate set.

[0170] In an exemplary embodiment, the pixel extraction module 620 is further configured to extract contours from the laser luminance image to obtain a set of contour points, extract the imprint region from the luminance image based on the set of contour points to obtain a set of imprint contour point coordinates, filter the imprint contour points in the laser luminance image based on the set of imprint contour point coordinates, extract sub-pixel edges from the filtered laser luminance image based on the set of imprint contour point coordinates to obtain a set of sub-pixel edge point coordinates of the imprint, and filter out the internal pixels of the imprint from the filtered laser luminance image based on the set of sub-pixel edge point coordinates to obtain a set of internal pixel point coordinates.

[0171] In an exemplary embodiment, the pixel extraction module 620 is further configured to determine the gradient magnitude and gradient direction of each imprint contour point based on the edge detection operator, determine the pixel neighbor points in the gradient direction of each imprint contour point, determine the gradient magnitude of the pixel neighbor points by linear interpolation, determine the comprehensive gradient magnitude based on the gradient magnitude of the imprint contour point and the pixel neighbor points, and determine the coordinates of the sub-pixel edge points according to the comprehensive gradient magnitude and the gradient direction of the imprint contour point, thereby obtaining the sub-pixel edge point coordinate set.

[0172] In an exemplary embodiment, the two-dimensional size measurement module 630 is further configured to determine the weighted average of the horizontal and vertical coordinates of each sub-pixel edge point to obtain the coordinates of the sub-pixel center point of the imprint, determine the distance between any two sub-pixel edge points in the sub-pixel edge point coordinate set, determine the two sub-pixel edge points corresponding to the maximum distance as length endpoints, determine the maximum distance as the two-dimensional length of the imprint, take the perpendicular line of the connecting line of the length endpoints as the search direction, determine the two sub-pixel edge points corresponding to the maximum distance in the search direction as width endpoints, determine the maximum distance in the search direction as the two-dimensional width of the imprint, and determine the two-dimensional area of ​​the imprint based on the distance between any two sub-pixel edge points. The two-dimensional size information includes the coordinates of the sub-pixel center point, the two-dimensional length, the length endpoints, the two-dimensional width, the width endpoints, and the two-dimensional area.

[0173] In an exemplary embodiment, the coordinate transformation module 640 is further configured to determine the point cloud coordinates corresponding to each pixel in the laser luminance image based on the point cloud data and a preset homography matrix; for each sub-pixel edge point, determine the adjacent points of the sub-pixel edge point; determine the point cloud coordinates corresponding to the sub-pixel edge point based on the point cloud coordinates corresponding to the adjacent points; and for each internal pixel point, determine the point cloud coordinates of the internal pixel point based on the coordinates of the internal pixel point and the preset homography matrix.

[0174] In an exemplary embodiment, the spatial size measurement module 650 is further configured to determine adjacent points of the sub-pixel center point, determine the point cloud coordinates of the sub-pixel center point based on the point cloud coordinates of the adjacent points, determine a first sub-pixel point on a straight line between the length endpoints, and a second sub-pixel point on a straight line between the width endpoints; for each first sub-pixel point, determine adjacent points of the first sub-pixel point, determine the first point cloud coordinates of the first sub-pixel point based on the point cloud coordinates corresponding to the adjacent points; determine the distance between each pair of adjacent first sub-pixel points based on each first point cloud coordinate, and determine the space of the imprint based on the distance between each pair of adjacent first pixel points. Length; For each second sub-pixel, determine the adjacent points of the second sub-pixel, and determine the second point cloud coordinates of the second sub-pixel based on the point cloud coordinates corresponding to the adjacent points; determine the distance between each pair of adjacent second sub-pixels based on the second point cloud coordinates, and determine the spatial width of the imprint based on the distance between each pair of adjacent second sub-pixels; determine each sub-pixel edge point and each internal pixel point as imprint pixels, determine the area of ​​the plane formed by three adjacent imprint pixels, and determine the spatial area of ​​the imprint by summing the areas of each plane; the spatial size information includes the point cloud coordinates of the sub-pixel center point, spatial length, spatial width, and spatial area.

[0175] In one exemplary embodiment, the workpiece imprint size measuring device 600 further includes a measurement report generation module 660 for integrating the spatial size information of the imprint and generating a measurement report.

[0176] In one exemplary embodiment, the measurement report generation module 660 is also used to push measurement reports.

[0177] Each module in the aforementioned workpiece imprint size measuring device 600 can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0178] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 8As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network. When executed by the processor, the computer program implements a method for measuring the dimensions of workpiece imprints.

[0179] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0180] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in any of the above embodiments of the workpiece imprint size measurement method.

[0181] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in any of the above embodiments of the workpiece imprint size measurement method.

[0182] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in any of the above embodiments of the workpiece imprint size measurement method.

[0183] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0184] 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, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0185] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0186] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A method for measuring the size of workpiece imprints, characterized in that, The method includes: Acquire laser luminance images and point cloud data of the workpiece under test; The coordinates of the sub-pixel edge points and the coordinates of the internal pixels of the imprint are extracted from the laser luminance image to obtain the sub-pixel edge point coordinate set and the internal pixel point coordinate set. Based on the sub-pixel edge point coordinate set, the two-dimensional size information of the imprint is determined; Based on the point cloud data, the point cloud coordinates corresponding to the sub-pixel edge points and the point cloud coordinates corresponding to the internal pixels are determined to obtain the sub-pixel edge point cloud coordinate set and the internal pixel point cloud coordinate set. The spatial size information of the imprint is determined based on the two-dimensional size information, the sub-pixel edge point cloud coordinate set, and the internal pixel point cloud coordinate set.

2. The method according to claim 1, characterized in that, The step of extracting the coordinates of the sub-pixel edge points and the coordinates of the internal pixels of the imprint from the laser luminance image to obtain the sub-pixel edge point coordinate set and the internal pixel point coordinate set includes: Contour extraction is performed on the laser luminance image to obtain a set of contour points. Based on the set of contour points, the imprint region is extracted from the luminance image to obtain the set of coordinates of the imprint contour points. Based on the set of coordinates of the imprint contour points, the imprint contour points in the laser luminance image are filtered; Based on the set of coordinates of the imprint contour points, sub-pixel edge extraction is performed on the filtered laser luminance image to obtain the set of coordinates of the sub-pixel edge points of the imprint. Based on the sub-pixel edge point coordinate set, the internal pixel points of the imprint are selected from the filtered laser luminance image to obtain the internal pixel point coordinate set.

3. The method according to claim 2, characterized in that, The step of extracting sub-pixel edges from the filtered laser luminance image based on the set of imprint contour point coordinates to obtain the set of sub-pixel edge point coordinates of the imprint includes: Based on the edge detection operator, the gradient magnitude and gradient direction of each imprint contour point are determined; For each imprint contour point, determine the pixel neighbor points in the gradient direction of the imprint contour point, and determine the gradient magnitude of the pixel neighbor points by linear interpolation. The comprehensive gradient magnitude is determined based on the gradient magnitude of the imprint contour points and the gradient magnitude of each pixel's adjacent points; Based on the comprehensive gradient magnitude and the gradient direction of the imprint contour points, the coordinates of the sub-pixel edge points are determined, and the sub-pixel edge point coordinate set is obtained.

4. The method according to claim 2, characterized in that, Determining the two-dimensional size information of the imprint based on the sub-pixel edge point coordinate set includes: The weighted average of the horizontal and vertical coordinates of each sub-pixel edge point is determined to obtain the coordinates of the sub-pixel center point of the imprint. Determine the distance between any two sub-pixel edge points in the sub-pixel edge point coordinate set, identify the two sub-pixel edge points corresponding to the maximum distance as length endpoints, and determine the maximum distance as the two-dimensional length of the imprint; Using the vertical line connecting the length endpoints as the search direction, the two sub-pixel edge points corresponding to the maximum distance in the search direction are determined as the width endpoints, and the maximum distance in the search direction is determined as the two-dimensional width of the imprint. The two-dimensional area of ​​the imprint is determined based on the distance between each pair of sub-pixel edge points; The two-dimensional size information includes the coordinates of the subpixel center point, the two-dimensional length, the length endpoint, the two-dimensional width, the width endpoint, and the two-dimensional area.

5. The method according to claim 4, characterized in that, The step of determining the point cloud coordinates corresponding to the sub-pixel edge points and the point cloud coordinates corresponding to the internal pixels based on the point cloud data includes: Based on the point cloud data and the preset homography matrix, the point cloud coordinates corresponding to each pixel in the laser luminance image are determined; For each sub-pixel edge point, determine the neighboring points of the sub-pixel edge point, and determine the point cloud coordinates corresponding to the sub-pixel edge point based on the point cloud coordinates corresponding to the neighboring points. For each internal pixel, the point cloud coordinates of the internal pixel are determined based on the coordinates of the internal pixel and the preset homography matrix.

6. The method according to claim 5, characterized in that, Determining the spatial size information of the imprint based on the two-dimensional size information, the sub-pixel edge point cloud coordinate set, and the internal pixel point cloud coordinate set includes: Determine the neighboring points of the sub-pixel center point, and determine the point cloud coordinates of the sub-pixel center point based on the point cloud coordinates of the neighboring points; Determine a first sub-pixel point on the straight line between the length endpoints and a second sub-pixel point on the straight line between the width endpoints; For each first sub-pixel, determine the neighboring points of the first sub-pixel, and determine the first point cloud coordinates of the first sub-pixel based on the point cloud coordinates corresponding to the neighboring points. Based on the cloud coordinates of each first point, the distance between each pair of adjacent first sub-pixels is determined, and based on the distance between each pair of adjacent first pixels, the spatial length of the imprint is determined; For each second sub-pixel, determine the neighboring points of the second sub-pixel, and determine the second point cloud coordinates of the second sub-pixel based on the point cloud coordinates corresponding to the neighboring points; Based on the cloud coordinates of each second point, the distance between each pair of adjacent second sub-pixels is determined, and based on the distance between each pair of adjacent second pixels, the spatial width of the imprint is determined; Each sub-pixel edge point and each internal pixel point is defined as an imprint pixel point. The area of ​​the plane formed by three adjacent imprint pixels points is determined, and the sum of the areas of each plane is defined as the spatial area of ​​the imprint. The spatial dimension information includes the point cloud coordinates of the sub-pixel center point, the spatial length, the spatial width, and the spatial area.

7. The method according to any one of claims 1 to 6, characterized in that, After determining the spatial dimensions of the imprint, the method further includes: Integrate the spatial dimension information of the imprint to generate a measurement report.

8. A device for measuring the size of workpiece imprints, characterized in that, The device includes: The data acquisition module is used to acquire the laser luminance image and point cloud data of the workpiece under test; The pixel extraction module is used to extract the coordinates of the sub-pixel edge points and the coordinates of the internal pixels of the imprint from the laser luminance image, so as to obtain the sub-pixel edge point coordinate set and the internal pixel point coordinate set. A two-dimensional size measurement module is used to determine the two-dimensional size information of the imprint based on the sub-pixel edge point coordinate set; The coordinate transformation module is used to determine the point cloud coordinates corresponding to the sub-pixel edge points and the point cloud coordinates corresponding to the internal pixels based on the point cloud data, so as to obtain the sub-pixel edge point cloud coordinate set and the internal pixel point cloud coordinate set. The spatial dimension measurement module is used to determine the spatial dimension information of the imprint based on the two-dimensional dimension information, the sub-pixel edge point cloud coordinate set, and the internal pixel point cloud coordinate set.

9. A workpiece imprint size measurement system, characterized in that, The system includes a processor and a laser scanning module: The laser scanning module is used to respond to the scanning information sent by the processor, emit a laser beam to the workpiece to be tested, generate a laser luminance image and point cloud data of the workpiece to be tested based on the reflected beam, and send the laser luminance image and the point cloud data to the processor. The processor is used to send scanning information to the laser scanning module, acquire the laser luminance image and point cloud data of the workpiece to be tested sent by the laser scanning module, and execute the workpiece imprint size measurement method as described in any one of claims 1 to 7 to obtain the spatial size information of the imprint of the workpiece to be tested.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Workpiece size detection method and device, computer equipment and storage medium

    CN116580022A

  • Workpiece size visual measurement method for complex machining environment

    CN117011282A

  • Mark point identification method, computer storage medium and terminal equipment

    CN117115242A

  • Calibration method for a device having a scan function

    US20140009604A1