A hot press workpiece edge detection correction method based on image data analysis

By combining image data and point cloud data, and employing algorithms such as the Sobel operator, Hough transform, and spline fitting, the problems of noise interference and insufficient accuracy in traditional hot press workpiece edge detection are solved, achieving high-precision edge alignment and reducing processing errors.

CN120070311BActive Publication Date: 2025-11-25SUZHOU JIACHUANG ELECTRONICS MATERIAL CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411965984.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-11-25
Estimated Expiration
2044-12-30

AI Technical Summary

Technical Problem

Traditional hot press workpiece edge detection methods are easily affected by noise when dealing with complex shapes and irregular edges, resulting in inaccurate edge extraction and failure to fully utilize the geometric information in point cloud data, leading to insufficient edge alignment accuracy.

Method used

By combining image data and point cloud data, edge detection and alignment are performed using algorithms such as Sobel operator, Hough transform and spline fitting. The baseline is obtained by using the least squares fitting method based on normal vector change and curvature calculation, and the edge alignment is performed by a robotic arm.

Benefits of technology

It improves the accuracy of workpiece edge detection in hot presses, overcomes the matching error problem in traditional methods, achieves a more stable and efficient edge alignment process, and reduces processing errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120070311B_ABST
    Figure CN120070311B_ABST
Patent Text Reader

Abstract

The application discloses a hot press workpiece edge detection alignment method based on image data analysis, and relates to the technical field of image processing, which comprises the following steps: collecting edge image data and point cloud data of a hot press workpiece and performing pretreatment; calculating the gradient of the pretreated edge image data by using a Sobel operator to obtain an edge image point set of the hot press workpiece; analyzing the geometric characteristics of the edge image point set by using Hough transformation and spline fitting to obtain a feature point set; analyzing the pretreated point cloud data by using normal vector change analysis and curvature calculation to obtain an edge point cloud of the hot press workpiece; processing the edge point cloud of the hot press workpiece to obtain a reference line; calculating the offset of the hot press workpiece by using the feature point set and the reference line respectively, obtaining image mode offset and point cloud mode offset and fusing them to obtain fused offset. The application improves the accuracy of edge detection and alignment by combining image data and point cloud data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method for edge detection and correction of hot press workpieces based on image data analysis. Background Technology

[0002] Traditional methods for edge detection and correction of hot press workpieces mainly rely on image processing techniques, typically using edge detection algorithms such as Canny edge detection. However, these methods have some shortcomings in practical applications. First, traditional methods are easily affected by noise when dealing with complex shapes and irregular edges, leading to inaccurate edge extraction. Even with denoising techniques such as Gaussian filtering, it is still difficult to effectively distinguish edge details, especially when the edges are blurred or occluded.

[0003] Traditional methods often fail to fully utilize the geometric information in point cloud data, ignoring the normal vectors and curvature variations of edge point clouds, resulting in insufficient edge alignment accuracy. How to effectively combine image data and point cloud data to improve the accuracy of edge detection and alignment has become a significant problem that traditional methods have not been able to solve. Summary of the Invention

[0004] In view of the aforementioned existing problems, the present invention is proposed.

[0005] Therefore, this invention provides a hot press workpiece edge detection and alignment method based on image data analysis to solve the problem that traditional methods do not effectively combine image data and point cloud data to improve the accuracy of edge detection and alignment.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0007] In a first aspect, the present invention provides a method for edge detection and correction of hot press workpieces based on image data analysis, which includes acquiring edge image data and point cloud data of hot press workpieces and performing preprocessing.

[0008] The gradient of the preprocessed edge image data is calculated using the Sobel operator to obtain the edge image point set of the hot press workpiece;

[0009] The geometric properties of the edge image point set are analyzed by Hough transform and spline fitting to obtain the feature point set;

[0010] The preprocessed point cloud data is analyzed by normal vector change analysis and curvature calculation to obtain the edge point cloud of the hot press workpiece;

[0011] The least squares fitting method is used to process the edge point cloud of the hot press workpiece to obtain the baseline.

[0012] The offset of the hot press workpiece is calculated using the feature point set and the baseline, respectively. The image mode offset and the point cloud mode offset are obtained and fused to obtain the fused offset.

[0013] Using fusion offset and robotic arm, edge alignment of hot press workpieces is performed.

[0014] As a preferred embodiment of the hot press workpiece edge detection and alignment method based on image data analysis described in this invention, the preprocessing includes: denoising the edge image data using a Gaussian filter, grayscale conversion and contrast enhancement of the edge image data, denoising the point cloud data using statistics, filtering, downsampling, and alignment.

[0015] As a preferred embodiment of the hot press workpiece edge detection and alignment method based on image data analysis described in this invention, the following steps are taken: The gradient of the preprocessed edge image data is calculated using the Sobel operator to obtain the edge image point set of the hot press workpiece.

[0016] Initialize the horizontal and vertical convolution kernels of the Sobel operator to obtain the horizontal and vertical Sobel operators.

[0017] The Sobel operators in the horizontal and vertical directions are applied respectively to calculate the gradient values ​​of each pixel in the preprocessed edge image data in the horizontal and vertical directions, so as to obtain the gradient value of each pixel.

[0018] The gradient value of each pixel is calculated by modulo operation to obtain the gradient magnitude value of each pixel, which is represented as follows:

[0019]

[0020] Where M(x,y) is the gradient magnitude of each pixel (x,y), x is the horizontal coordinate of the pixel, y is the vertical coordinate of the pixel, Gx is the gradient in the horizontal direction of the pixel (x,y), and Gy is the gradient in the vertical direction of the pixel (x,y).

[0021] By using non-maximum suppression, the gradient magnitude values ​​of the current pixel and its two neighboring pixels along the gradient direction are compared to obtain a thinned edge image.

[0022] The Otsu thresholding method is used to perform thresholding on the thinned edge image to obtain a preliminary edge point set;

[0023] The initial edge point set retains all strong edge points, and weak edge points are connected through neighborhood connections to obtain the edge image point set.

[0024] As a preferred embodiment of the hot press workpiece edge detection and alignment method based on image data analysis described in this invention, the geometric characteristics of the edge image point set are analyzed through Hough transform and spline fitting to obtain a feature point set. The specific steps are as follows.

[0025] Apply Hough transform to the edge image point set to obtain the detected straight lines and their parameters, which are used as straight line features;

[0026] Using cubic splines and the least squares method, spline curves are obtained by fitting linear features with splines.

[0027] By analyzing the derivative and curvature of the spline curve, key feature points are extracted from the spline curve, represented as follows:

[0028]

[0029] Where C is the curvature value of the spline curve, and S ″ (z) is the second derivative of the spline curve, S'(z) is the derivative of the spline curve, and z is the x-coordinate of a point on the spline curve.

[0030] The key feature points are combined into a point set to obtain the feature point set.

[0031] As a preferred embodiment of the hot press workpiece edge detection and alignment method based on image data analysis described in this invention, the preprocessed point cloud data is analyzed through normal vector change analysis and curvature calculation to obtain the edge point cloud of the hot press workpiece. The specific steps are as follows.

[0032] By using the covariance matrix, the normal vector within the local neighborhood of each point in the point cloud data is calculated, and the normal vector of each point is obtained, represented as follows:

[0033]

[0034] Where V is the covariance matrix, k is the number of points in the local neighborhood, j is the index of the point in the local neighborhood, and P j Let j be the coordinates of the j-th point in the local neighborhood. The average coordinates of all points in the local neighborhood are given by T, where T is the matrix transpose.

[0035] The normal vector is obtained by calculating the eigenvector corresponding to the smallest eigenvalue of the covariance matrix through eigenvalue decomposition.

[0036] The curvature of each point is calculated by utilizing the change in the normal vector;

[0037] Set a curvature threshold, identify and mark points in high curvature areas, obtain edge points and combine them to obtain the edge point cloud of the hot press workpiece.

[0038] As a preferred embodiment of the hot press workpiece edge detection and alignment method based on image data analysis described in this invention, the following steps are taken: The least squares fitting method is used to process the edge point cloud of the hot press workpiece to obtain a baseline.

[0039] A cubic spline curve is used as the fitting model for the edge point cloud of the hot press workpiece, and the sum of squared errors is used as the objective function, which is expressed as follows:

[0040]

[0041] Where E is the sum of squared errors, n represents the number of data points in the edge point cloud, and y i Let S(x) be the y-coordinate of the i-th data point in the edge point cloud. i Let be the predicted value of the cubic spline curve at the i-th point in the point cloud data, where i is the index variable and x is the predicted value. i Let x be the x-coordinate of the i-th data point in the edge point cloud;

[0042] Initialize the control point positions of the spline curve using the edge point cloud;

[0043] The objective function is minimized using the least squares method, and the coefficients of the spline curve are solved to obtain the optimal spline curve control points and spline curve parameters.

[0044] The baseline is obtained by acquiring the horizontal range of the workpiece edge from the edge point cloud and combining it with spline curve parameters.

[0045] As a preferred embodiment of the hot press workpiece edge detection and alignment method based on image data analysis described in this invention, the following steps are taken: The offset of the hot press workpiece is calculated using feature point sets and a baseline, respectively, to obtain image mode offset and point cloud mode offset, which are then fused to obtain a fused offset.

[0046] Using the SIFT feature point matching algorithm, the offset of each feature point in the feature point set is calculated using Euclidean distance to obtain the offset of each feature point, and the workpiece with the largest total number of matches is selected as the reference workpiece.

[0047] The image pattern offset of the hot press workpiece is obtained by averaging the offset of each feature point.

[0048] The baseline of the reference workpiece is used as the reference baseline, and the baselines of other workpieces are compared with the reference baseline to obtain the point cloud pattern offset.

[0049] The image mode offset and the point cloud mode offset are weighted and averaged to obtain the fused offset.

[0050] As a preferred embodiment of the hot press workpiece edge detection and alignment method based on image data analysis described in this invention, the hot press workpiece is edge-aligned using a fused offset and a robotic arm, with the specific steps as follows:

[0051] Based on the fusion offset, calculate the translational and rotational adjustments that the robotic arm needs to make;

[0052] Based on the calculated adjustment amount, control commands for the robotic arm are generated and sent to the robotic arm.

[0053] After the robotic arm completes the adjustment, image data and point cloud data of the workpiece are re-acquired to verify the alignment of the workpiece's edges.

[0054] In a second aspect, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, wherein: when the computer program is executed by the processor, it implements any step of the hot press workpiece edge detection alignment method based on image data analysis as described in the first aspect of the present invention.

[0055] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the hot press workpiece edge detection alignment method based on image data analysis as described in the first aspect of the present invention.

[0056] The beneficial effects of this invention are as follows: The hot press workpiece edge detection and alignment method based on image data analysis can effectively improve the accuracy of hot press workpiece edge detection and alignment. By combining image data and point cloud data, it not only overcomes the shortcomings of traditional methods in detecting complex workpiece shapes and blurred edges, but also fully utilizes the normal vector and curvature information in the point cloud data, improving the accuracy of edge extraction. Advanced algorithms such as the Sobel operator, Hough transform, and spline fitting are used for edge feature extraction and analysis, enabling more precise capture of the geometric features of the workpiece edges. By fusing image pattern and point cloud pattern offsets, the matching error problem commonly encountered in traditional methods during edge alignment is solved, achieving a more stable and efficient alignment process. This method can significantly improve the accuracy of hot press workpiece alignment and reduce processing errors caused by inaccurate edge detection. Attached Figure Description

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

[0058] Figure 1This is a flowchart of the hot press workpiece edge detection and correction method based on image data analysis in Example 1.

[0059] Figure 2 This is a flowchart of obtaining the baseline in Example 1. Detailed Implementation

[0060] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0061] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0062] Secondly, the term "an embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places throughout this specification does not necessarily refer to the same embodiment, nor is it a single embodiment or an embodiment selectively excluded from other embodiments.

[0063] Example 1, referring to Figure 1 and Figure 2 This is the first embodiment of the present invention, which provides a method for edge detection and correction of hot press workpieces based on image data analysis, including the following steps:

[0064] S1. Acquire edge image data and point cloud data of the workpiece from the hot press, and perform preprocessing, including the following steps:

[0065] High-definition industrial cameras are used to photograph the workpieces in the hot press. During image acquisition, the workpiece should be kept stationary to avoid motion blur, and uniform lighting should be ensured to avoid the effects of shadows. High-resolution images are used to capture the edge areas of the workpiece, ensuring sufficient detail, especially in areas with complex workpiece contours.

[0066] 3D point cloud data of the hot press workpiece is acquired using a 3D laser scanner or structured light scanning equipment. The point cloud data should cover the entire surface of the workpiece and contain sufficiently dense points to ensure accurate description of the workpiece's shape and edge features. The point cloud data is sampled multiple times to ensure its integrity from different angles, thereby avoiding data loss or noise interference.

[0067] A Gaussian filter is used to denoise the image, reducing random noise, especially from uneven lighting or equipment noise that may occur during shooting. The standard deviation and window size of the Gaussian filter should be adjusted according to the noise characteristics of the image. The image is then converted to grayscale to facilitate subsequent edge detection. Contrast enhancement is performed on the grayscale image using histogram equalization or adaptive histogram equalization methods to make the contrast between edges and background more pronounced, thereby improving the accuracy of subsequent edge detection.

[0068] Statistical filtering, mean filtering, or median filtering are used to denoise the point cloud data, removing outliers caused by measurement errors or environmental factors. Voxel meshing is used to downsample the point cloud. By adjusting the volume size, the density of the point cloud can be reduced while retaining necessary shape information. Since the point cloud data comes from scans at different angles, the ICP point cloud registration algorithm is used to align multiple point cloud data sets to the same coordinate system to ensure overall consistency.

[0069] S2. Calculate the gradient of the preprocessed edge image data using the Sobel operator to obtain the edge image point set of the hot press workpiece. This includes the following steps:

[0070] Initialize the horizontal and vertical convolution kernels of the Sobel operator, using the following Sobel convolution kernel:

[0071]

[0072] The Sobel operators in the horizontal and vertical directions are applied respectively to calculate the gradient values ​​of each pixel in the preprocessed edge image data in the horizontal and vertical directions, thus obtaining the gradient value of each pixel.

[0073] It should be noted that the structure and weight distribution of the Sobel operator convolution kernels Gx and Gy are based on the principle of discrete difference computation and are used to detect changes in image grayscale values. The horizontal convolution kernel Gx is designed to calculate edge changes in the vertical direction, and the vertical convolution kernel Gy is used to calculate edge changes in the horizontal direction.

[0074] The gradient value of each pixel is calculated by modulo operation to obtain the gradient magnitude value of each pixel, which is represented as follows:

[0075]

[0076] Where M(x,y) is the gradient magnitude of each pixel (x,y). The larger the gradient magnitude, the more drastic the change in grayscale value at that pixel, meaning that the pixel is more likely to be located at the edge of the image. x is the horizontal coordinate of the pixel used to locate each pixel in the image, ensuring that the gradient magnitude corresponds to the specific location. y is the vertical coordinate of the pixel used to locate each pixel in the image, ensuring that the gradient magnitude corresponds to the specific location. Gx is the gradient in the horizontal direction of the pixel (x,y), used to extract horizontal edge information in the image. Gy is the gradient in the vertical direction of the pixel (x,y), used to eliminate the negative influence of direction (because the gradient value may be positive or negative, and after squaring, it is always positive), while emphasizing the contribution of larger gradient values ​​to the results.

[0077] Non-maximum suppression (NMS) compares the gradient magnitude values ​​of the current pixel with those of its two neighboring pixels along the gradient direction to obtain a refined edge image. It should be noted that NMS is used to refine the gradient magnitude map, removing non-edge points and making the edges clearer and more pixel-like. Its core idea is to retain local maxima of the gradient magnitude (i.e., edge points) while suppressing non-local maxima (i.e., noise points or weak edge points).

[0078] The Otsu thresholding method (Tianjin thresholding method) is used to threshold the thinned edge image to obtain a preliminary edge point set. It should be noted that the Otsu thresholding method is used to binarize the thinned gradient magnitude map, classifying pixels into "edge points" and "non-edge points." It avoids the subjectivity of manually selecting the threshold by automatically calculating the globally optimal threshold.

[0079] The initial edge point set retains all strong edge points, and weak edge points are connected through neighborhood connections to obtain the edge image point set. Specifically, the eight-neighborhood connection rule is used to determine whether a weak edge point is connected to a strong edge point. If at least one strong edge point exists in the eight neighborhoods of a weak edge point, the weak edge point is retained; otherwise, it is discarded. It should be noted that strong edge points refer to pixels whose gradient magnitude exceeds a high threshold (the global threshold calculated by the Otsu method). These points are usually located in the main region of the edge and have high reliability. Weak edge points refer to pixels whose gradient magnitude is below the high threshold but above the low threshold. These points may be details of the edge or noise points. The processing rule is that strong edge points are directly retained; weak edge points need to be associated with strong edge points through neighborhood connections to be retained, otherwise they are considered noise points and discarded.

[0080] S3. Analyze the geometric properties of the edge image point set using Hough transform and spline fitting to obtain the feature point set, including the following steps:

[0081] The Hough transform is applied to the edge image point set to obtain the detected straight lines and their parameters, which serve as line features. It should be noted that the Hough transform is used to detect straight lines in an image and analyze the geometric properties of the edge point set. The Hough transform transforms the problem of detecting straight lines from the Cartesian coordinate system to the Hough space (polar coordinate system), converting it into a problem of curve intersection points in the parameter space.

[0082] Using cubic splines and the least squares method, spline curves are obtained by fitting linear features with splines. It should be noted that a set of homogeneous polynomial functions is used to smoothly fit the set of edge points, generating a continuous and differentiable spline curve, suitable for describing complex curve features. The least squares method is used to minimize the fitting error, ensuring that the fitted curve is as close as possible to the original set of edge points.

[0083] The cubic spline representation is as follows:

[0084] S(z) = az³ + bz² + cz + d;

[0085] Where S(z) is the predicted value of the cubic spline curve in the point cloud data, a is the coefficient of the cubic term, b is the coefficient of the quadratic term, c is the coefficient of the linear term, d is the offset, and z is the x-coordinate of a point on the spline curve.

[0086] By analyzing the derivative and curvature of the spline curve, key feature points are extracted from the spline curve, represented as follows:

[0087]

[0088] Where C is the curvature value of the spline curve, used to represent the degree of curvature of the spline curve at a certain point, and S... ″ (z) is the second derivative of the spline curve, representing the slope or rate of change of the spline curve at a certain point, that is, the slope of the tangent line of the curve at the independent variable z. S'(z) is the derivative of the spline curve, representing the rate of change of the curvature of the spline curve at a certain point, that is, the degree of curvature of the curve. x is the abscissa of a certain point on the spline curve, representing the independent variable of the spline curve.

[0089] Key feature points are combined into a point set to obtain a feature point set. It should be noted that the feature point set is a high-level abstraction of the geometric characteristics of the edge image, containing contour information, curvature information, inflection point (or turning point) information, and global geometric distribution.

[0090] S4. Analyze the preprocessed point cloud data through normal vector change analysis and curvature calculation to obtain the edge point cloud of the hot press workpiece, including the following steps.

[0091] By using the covariance matrix, the normal vector within the local neighborhood of each point in the point cloud data is calculated, and the normal vector of each point is obtained, represented as follows:

[0092]

[0093] Where V is the covariance matrix, representing the covariance of the point cloud distribution within the local neighborhood of the current point. The eigenvector corresponding to the smallest eigenvalue of the covariance matrix is ​​the normal vector direction of that point. k is the number of points in the local neighborhood, representing the number of points in the local neighborhood participating in the calculation. j is the index of a point in the local neighborhood, used to calculate the covariance matrix of the current point point by point. P j Let be the coordinates of the j-th point in the local neighborhood. Its function is to participate in the calculation of the covariance matrix, reflecting the point's position in three-dimensional space. The average coordinates of all points in the local neighborhood are used to normalize the coordinates of local points to a coordinate system relative to the centroid, which facilitates the analysis of the distribution characteristics of the points. T is the matrix transpose symbol.

[0094] The normal vector is obtained by calculating the eigenvector corresponding to the smallest eigenvalue of the covariance matrix through eigenvalue decomposition. It should be noted that the normal vector is obtained by decomposing the covariance matrix and calculating its eigenvalues ​​and eigenvectors. The principle is that the eigenvalues ​​and eigenvectors of the covariance matrix reflect the local geometric characteristics of the point cloud. Furthermore, the eigenvector of the largest eigenvalue represents the principal direction of the point cloud distribution; the eigenvector of the smallest eigenvalue represents the direction of the normal vector (i.e., the point cloud changes least in that direction).

[0095] The curvature of each point is calculated by utilizing the change in the normal vector. It should be noted that curvature reflects the degree of bending of the point cloud in a local region, and is calculated using the rate of change of the normal vector or the eigenvalues ​​of the covariance matrix.

[0096] By setting a curvature threshold, points in high-curvature regions are identified and marked to obtain edge points, which are then combined to obtain the edge point cloud of the hot press workpiece. Specifically, based on the curvature distribution of the point cloud data, a curvature threshold is set. For each point, if the curvature value is greater than the curvature threshold, it is marked as a high-curvature point; otherwise, it is considered a low-curvature point. It should be noted that the edge point cloud is a key part of the point cloud data with geometric features, representing the edge or feature region of the target object.

[0097] S5. Using the least squares fitting method, process the edge point cloud of the hot press workpiece to obtain the baseline, including the following steps.

[0098] A cubic spline curve is used as the fitting model for the edge point cloud of the hot press workpiece, and the sum of squared errors is used as the objective function, which is expressed as follows:

[0099]

[0100] Where E is the sum of squared errors, representing the total error between the fitted curve and the actual data points, n represents the number of data points in the edge point cloud, and y i Let S(x) be the y-coordinate of the i-th data point in the edge point cloud. i Let be the predicted value of the cubic spline curve at the i-th point in the point cloud data, where i is the index variable of the data point, and x is the predicted value of the cubic spline curve at the i-th point. i Let x be the x-coordinate of the i-th data point in the edge point cloud.

[0101] The control point positions of the spline curve are initialized using the edge point cloud. Specifically, the x-coordinate of the edge point cloud is used as the node of the spline curve. Furthermore, certain key points in the edge point cloud are selected as nodes (control points) of the spline curve. These nodes are typically data points that are uniformly distributed in the horizontal direction, or points with significant curvature changes.

[0102] The least squares method is used to minimize the objective function and solve for the coefficients of the spline curve to obtain the optimal spline control points and spline parameters. Specifically, first, a matrix is ​​designed where each row corresponds to a single data point and contains the values ​​of the basis functions. Second, for a cubic spline curve, the basis functions include constant, linear, quadratic, and cubic terms. Next, the observation vector contains the actual y-coordinates of all data points. Then, the coefficients of the spline curve are found by solving a system of linear equations. The solution to this system of equations minimizes the sum of squared errors. Finally, the least squares method is used to find the coefficient values ​​that minimize the sum of squared errors. It should be noted that the least squares method is a commonly used data fitting method to find a curve or line that minimizes the sum of squared errors between the curve or line and given data points. This method is widely used in regression analysis, curve fitting, and other fields.

[0103] A baseline is obtained by acquiring the horizontal range of the workpiece edge from the edge point cloud and combining it with spline curve parameters. Specifically, the minimum and maximum values ​​of the x-coordinate are found from the edge point cloud. Within this range, a series of y-coordinates corresponding to the x-coordinates are generated using the fitted cubic spline curve, and the generated points form a smooth baseline.

[0104] S6. Calculate the offset of the hot press workpiece using the feature point set and baseline respectively, obtain the image mode offset and point cloud mode offset, and fuse them to obtain the fused offset. This includes the following steps.

[0105] Using the SIFT (Scale-Invariant Feature Transform) feature point matching algorithm, the offset of each feature point in the feature point set is calculated using Euclidean distance. The workpiece with the highest total number of matches is selected as the reference workpiece. It should be noted that the main characteristic of the SIFT feature point matching algorithm is its ability to detect key points in images under different scales, rotations, and lighting conditions, and to generate descriptors for these key points. Euclidean distance, used to calculate the distance between two vectors, is a commonly used metric in SIFT feature point matching to compare the similarity between descriptors.

[0106] The image pattern offset of the hot press workpiece is obtained by averaging the offset of each feature point, and is expressed as follows:

[0107]

[0108] Where ΔF represents the offset of each feature point, used to measure the displacement between two corresponding feature points in the image, x F Let x be the x-coordinate of a feature point in the feature point set. F' Let x and y be the x-coordinates of the corresponding feature points in the feature point set. F Let y be the y-coordinate of a feature point in the feature point set. F' Let y be the y-coordinate of the corresponding feature point in the feature point set.

[0109] The reference workpiece's baseline is used as a reference baseline, and the baselines of other workpieces are compared to this reference baseline to obtain the point cloud pattern offset. It should be noted that the reference workpiece's baseline (typically the standard or ideal geometry of the target workpiece) is used to measure the geometric offset of other workpieces. In industrial applications, the actual shape and size of workpieces may deviate due to errors, deformations, and other factors during the production process; therefore, the reference workpiece's baseline provides an ideal standard.

[0110] The fused offset is obtained by weighted averaging of the image mode offset and the point cloud mode offset. It should be noted that the purpose of weighted averaging of the image mode offset and the point cloud mode offset is to improve computational accuracy by leveraging the advantages of two different data sources. The image offset, based on two-dimensional image data, provides displacement information of the workpiece surface contour; while the point cloud offset, based on three-dimensional scan data, provides more comprehensive information on spatial position changes. By weighted averaging, the advantages of these two offsets can be combined, avoiding the errors and limitations that may arise from a single data source.

[0111] S7. Using the fusion offset and the robotic arm, perform edge correction on the hot press workpiece, including the following steps.

[0112] Based on the fusion offset, calculate the required translational and rotational adjustments for the robotic arm, expressed as follows:

[0113]

[0114] Where ΔT is the translation adjustment amount, ΔX is the translation adjustment amount of the workpiece on the horizontal axis, ΔY is the translation adjustment amount of the workpiece on the depth axis, ΔZ is the translation adjustment amount of the workpiece on the vertical axis, ΔR is the rotation adjustment amount, and Δθ is the rotation adjustment amount. x Δθ is the adjustment amount of the workpiece's rotation angle around the horizontal axis. y Δθ is the amount of rotation adjustment of the workpiece about the depth axis. z This is the adjustment amount of the workpiece's rotation angle around the vertical axis.

[0115] Specifically, the adjustment amount of the robotic arm is determined based on the calculated fusion offset (i.e., the weighted average of the image pattern offset and the point cloud pattern offset). This adjustment amount includes changes in the workpiece position and orientation, specifically translation (displacement in the X, Y, and Z directions) and rotation (angular rotation around the X, Y, and Z axes).

[0116] Based on the calculated adjustment amounts, control commands for the robotic arm are generated and sent to it. It should be noted that after calculating the required translational and rotational adjustments, these adjustments need to be converted into control commands for the robotic arm. These commands instruct the high-speed robotic arm on how to operate its joints, how to move in various directions, or how to adjust its posture (rotation). Specifically, control commands include translation commands, specifying how far the end effector (e.g., gripper) needs to move along the X, Y, and Z axes, respectively. Rotation commands specify the rotation angle and axis. For example, if it is calculated that the workpiece needs to be rotated a certain angle to align with a reference line, the command will rotate the high-speed robotic arm by the specified angle.

[0117] After the robotic arm completes its adjustments, image and point cloud data of the workpiece are reacquired to verify the edge alignment. It should be noted that the new image and point cloud data will be compared with previous standards (reference workpiece or ideal condition) to ensure the effectiveness of the edge correction process. If offset is still found, further adjustments may be necessary until the workpiece's edge alignment accuracy meets the requirements.

[0118] This embodiment also provides a computer device applicable to the hot press workpiece edge detection and alignment method based on image data analysis, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to realize the hot press workpiece edge detection and alignment method based on image data analysis as proposed in the above embodiment.

[0119] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.

[0120] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements the hot press workpiece edge detection alignment method based on image data analysis as proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0121] In summary, this invention, by combining image data and point cloud data, not only overcomes the shortcomings of traditional methods in detecting complex workpiece shapes and blurred edges, but also fully utilizes the normal vector and curvature information in the point cloud data to improve the accuracy of edge extraction. Advanced algorithms such as the Sobel operator, Hough transform, and spline fitting are employed for edge feature extraction and analysis, resulting in more precise capture of the geometric features of the workpiece edges. By fusing image pattern and point cloud pattern offsets, the matching error problem commonly encountered in edge alignment processes in traditional methods is solved, achieving a more stable and efficient alignment process. This method can significantly improve the alignment accuracy of hot press workpieces and reduce processing errors caused by inaccurate edge detection.

[0122] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for edge detection and alignment of a hot press workpiece based on image data analysis, characterized in that: include, The edge image data and point cloud data of the hot press workpiece are collected and preprocessed. The gradient of the preprocessed edge image data is calculated using the Sobel operator to obtain the edge image point set of the hot press workpiece; The geometric properties of the edge image point set are analyzed by Hough transform and spline fitting to obtain the feature point set; The preprocessed point cloud data is analyzed by normal vector change analysis and curvature calculation to obtain the edge point cloud of the hot press workpiece; The least squares fitting method is used to process the edge point cloud of the hot press workpiece to obtain the baseline. The offset of the hot press workpiece is calculated using the feature point set and the baseline, respectively. The image mode offset and the point cloud mode offset are obtained and fused to obtain the fused offset. Using fusion offset and robotic arm, edge alignment of hot press workpieces is performed.

2. The hot press workpiece edge detection and alignment method based on image data analysis as described in claim 1, characterized in that: The preprocessing includes denoising the edge image data using a Gaussian filter, grayscale conversion and contrast enhancement of the edge image data, and denoising, filtering, downsampling and alignment of the point cloud data using statistics.

3. The hot press workpiece edge detection and alignment method based on image data analysis as described in claim 2, characterized in that: The gradient of the preprocessed edge image data is calculated using the Sobel operator to obtain the edge image point set of the hot press workpiece. The specific steps are as follows. Initialize the horizontal and vertical convolution kernels of the Sobel operator to obtain the horizontal and vertical Sobel operators. The Sobel operators in the horizontal and vertical directions are applied respectively to calculate the gradient values ​​of each pixel in the preprocessed edge image data in the horizontal and vertical directions, so as to obtain the gradient value of each pixel. The gradient value of each pixel is calculated by modulo operation to obtain the gradient magnitude value of each pixel, which is represented as follows: ; in, For each pixel The gradient magnitude value, Let be the horizontal coordinates of the pixel. These are the vertical coordinates of the pixel. For at pixel The gradient in the horizontal direction, For pixels The gradient in the vertical direction; By using non-maximum suppression, the gradient magnitude values ​​of the current pixel and its two neighboring pixels along the gradient direction are compared to obtain a thinned edge image. The Otsu thresholding method is used to perform thresholding on the thinned edge image to obtain a preliminary edge point set; The initial edge point set retains all strong edge points, and weak edge points are connected through neighborhood connections to obtain the edge image point set.

4. The hot press workpiece edge detection and alignment method based on image data analysis as described in claim 3, characterized in that: The geometric properties of the edge image point set are analyzed using Hough transform and spline fitting to obtain the feature point set. The specific steps are as follows. Apply Hough transform to the edge image point set to obtain the detected straight lines and their parameters, which are used as straight line features; Using cubic splines and the least squares method, spline curves are obtained by fitting linear features with splines. By analyzing the derivative and curvature of the spline curve, key feature points are extracted from the spline curve, where the degree of curvature of the spline curve is expressed as... ; in, Let be the curvature value of the spline curve. The second derivative of the spline curve. The derivative of the spline curve. The x-coordinate of a point on the spline curve; The key feature points are combined into a point set to obtain the feature point set.

5. The hot press workpiece edge detection and alignment method based on image data analysis as described in claim 4, characterized in that: The preprocessed point cloud data was analyzed using normal vector change analysis and curvature calculation to obtain the edge point cloud of the hot press workpiece. The specific steps are as follows. The normal vector of each point in the point cloud data is calculated using the covariance matrix within its local neighborhood. The covariance matrix of the point cloud distribution within the local neighborhood of the current point is represented as follows: ; in, Let covariance matrix be the variance matrix. The number of points in the local neighborhood. For the index of a point within a local neighborhood, For the local neighborhood of the first The coordinates of the points The average coordinates of all points within the local neighborhood. This is the matrix transpose symbol; The normal vector is obtained by calculating the eigenvector corresponding to the smallest eigenvalue of the covariance matrix through eigenvalue decomposition. The curvature of each point is calculated by utilizing the change in the normal vector; Set a curvature threshold, identify and mark points in high curvature areas, obtain edge points and combine them to obtain the edge point cloud of the hot press workpiece.

6. The hot press workpiece edge detection and alignment method based on image data analysis as described in claim 5, characterized in that: The least squares fitting method was used to process the edge point cloud of the hot press workpiece to obtain the baseline. The specific steps are as follows. A cubic spline curve is used as the fitting model for the edge point cloud of the hot press workpiece, and the sum of squared errors is used as the objective function, which is expressed as follows: ; in, For the sum of squared errors, To represent the number of data points in the edge point cloud, For the edge point cloud data points coordinate, For the cubic spline curve in point cloud data Predicted value for each point, For index variables, For the edge point cloud data points coordinate; Initialize the control point positions of the spline curve using the edge point cloud; The objective function is minimized using the least squares method, and the coefficients of the spline curve are solved to obtain the optimal spline curve control points and spline curve parameters. The baseline is obtained by acquiring the horizontal range of the workpiece edge from the edge point cloud and combining it with spline curve parameters.

7. The hot press workpiece edge detection and alignment method based on image data analysis as described in claim 6, characterized in that: The offset of the hot press workpiece is calculated using feature point sets and baselines respectively, resulting in image mode offset and point cloud mode offset, which are then fused to obtain the fused offset. The specific steps are as follows. Using the SIFT feature point matching algorithm, the offset of each feature point in the feature point set is calculated using Euclidean distance to obtain the offset of each feature point, and the workpiece with the largest total number of matches is selected as the reference workpiece. The image pattern offset of the hot press workpiece is obtained by averaging the offset of each feature point. The baseline of the reference workpiece is used as the reference baseline, and the baselines of other workpieces are compared with the reference baseline to obtain the point cloud pattern offset. The image mode offset and the point cloud mode offset are weighted and averaged to obtain the fused offset.

8. The hot press workpiece edge detection and alignment method based on image data analysis as described in claim 7, characterized in that: Using a fusion offset and a robotic arm, the edges of the workpiece in the hot press are aligned. The specific steps are as follows. Based on the fusion offset, calculate the translational and rotational adjustments that the robotic arm needs to make; Based on the calculated adjustment amount, control commands for the robotic arm are generated and sent to the robotic arm. After the robotic arm completes the adjustment, image data and point cloud data of the workpiece are re-acquired to verify the alignment of the workpiece's edges.

9. 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 hot press workpiece edge detection and alignment method based on image data analysis as described in any one of claims 1 to 8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the hot press workpiece edge detection and alignment method based on image data analysis as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method for detecting edge of precise slice

    CN113838079A

  • Automatic hot press alignment method based on image processing

    CN118071784A