A method, device and related equipment for extracting workpiece projection contour

Through posture correction and PCA dimensionality reduction processing, the efficiency and accuracy of workpiece projection contour feature extraction are improved, the problems of poor extraction effect and small scope of application in the existing technology are solved, and efficient target recognition performance is achieved.

CN115100425BActive Publication Date: 2024-10-22FOSHAN LINGXI IND DESIGN CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210720153.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-23
Publication Date
2024-10-22
Estimated Expiration
2042-06-23

AI Technical Summary

Technical Problem

The existing three-dimensional point cloud projection contour feature extraction method results in poor workpiece contour feature extraction, low computational efficiency, poor target recognition performance, and a small scope of application under the condition of noise and point cloud resolution changes.

Method used

By obtaining the three-dimensional attitude data of the workpiece, using the projection contour feature extraction algorithm to generate a feature matrix after correcting the attitude, and performing dimensionality reduction processing through the PCA algorithm, a feature vector matrix is ​​obtained, which solves the problem of high dimensionality of the projected profile feature and large redundant information. problem.

Benefits of technology

It improves the computational efficiency of workpiece projection contour extraction and the integrity of feature information, enhances the performance of target recognition, and expands the scope of application.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115100425B_ABST
    Figure CN115100425B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device and related equipment for extracting the projection contour of a workpiece, comprising the following steps: obtaining the three-dimensional posture data of the workpiece target, and presetting the initial posture three-dimensional point cloud according to the three-dimensional posture data; correcting the posture of the workpiece target by using a three-dimensional rotation transformation, and obtaining a corrected three-dimensional point cloud after correction according to the initial posture three-dimensional point cloud; extracting the projection contour of the workpiece by a projection contour feature extraction algorithm according to the corrected three-dimensional point cloud, and generating a feature sample matrix of the feature matrix; performing dimensionality reduction processing on the feature matrix extracted from the projection contour by a PCA algorithm, and obtaining a feature vector matrix; being able to achieve maximum preservation of the global features of the workpiece, having high computational efficiency, and being able to ensure that the integrity of the workpiece feature information is high, effectively reducing the redundant information in the feature matrix, and having great significance for improving the performance of target recognition. The present invention has good contour feature extraction effect, high computational efficiency, high target recognition performance, and a wide range of applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of contour extraction, and in particular to a method, device, computer equipment and computer-readable storage medium for extracting a workpiece projection contour. Background Art

[0002] At present, modern industrial production usually involves various inspection, testing and part recognition applications. In computer vision, low-level visual features such as object contours, corners, and textures are often used in high-level perception tasks. In scenes such as robot cutting, welding, and grinding, object contours can be used as a key basis for object recognition, pose estimation, and robot trajectory generation. Compared with 2D images, 3D point clouds describe the spatial information of objects more comprehensively, and point cloud contour extraction has become an important description method for visual features in the three-dimensional world.

[0003] Existing 3D point cloud feature extraction methods include: local feature extraction and global feature extraction. Local feature extraction requires finding the target feature points of the workpiece, and then using a fixed-size area near the feature points as a support domain. Therefore, the selection of target feature points and the scope of the domain will affect the extraction of local features, and when the target is affected by external environmental factors such as detection distance and noise, the ability of the extracted local features to reflect the target characteristics may decrease. Global feature extraction processes all the extracted target points. Global feature extraction has a strong ability to express the overall information of the target, has a small amount of calculation, and can fully reflect the overall structural information of the target.

[0004] However, the workpiece projection features obtained by projecting the workpiece 3D point cloud onto a 2D plane include projection contour features and projection distribution features. The projection distribution feature extracts the point distribution structure of the target 3D point cloud projection image, while the projection contour feature analyzes the contour edge of the workpiece target 3D point cloud projection image. When there is noise and changes in point cloud resolution, the effectiveness of the projection distribution feature information will be reduced, resulting in poor workpiece contour feature extraction, low computational efficiency, poor target recognition performance, and a small scope of application. Summary of the invention

[0005] In view of the deficiencies of the above related technologies, the present invention proposes a workpiece projection contour extraction method, device, computer equipment and computer-readable storage medium with good contour feature extraction effect, high calculation efficiency and improved target recognition performance.

[0006] In order to solve the above technical problems, in a first aspect, an embodiment of the present invention provides a method for extracting a projection contour of a workpiece, comprising the following steps:

[0007] Acquire three-dimensional posture data of the workpiece target, and preset an initial posture three-dimensional point cloud according to the three-dimensional posture data;

[0008] Performing posture correction on the workpiece target by using a three-dimensional rotation transformation, and obtaining a corrected three-dimensional point cloud after correction according to the initial posture three-dimensional point cloud;

[0009] Extract the projection contour of the workpiece using a projection contour feature extraction algorithm according to the corrected three-dimensional point cloud to generate a feature sample matrix of the feature matrix;

[0010] The feature matrix extracted from the projection profile is subjected to dimension reduction processing by the PCA algorithm to obtain a feature vector matrix.

[0011] Preferably, the step of acquiring the three-dimensional posture data of the workpiece target and presetting the initial posture three-dimensional point cloud according to the three-dimensional posture data specifically includes the following sub-steps:

[0012] The PEMSPNC algorithm is used to calculate the three-dimensional posture angle (α, β, θ) of the workpiece target, and the initial posture three-dimensional point cloud P is preset according to the three-dimensional posture angle.

[0013] Preferably, the step of correcting the posture of the workpiece target by using a three-dimensional rotation transformation to obtain a corrected three-dimensional point cloud after correction according to the initial posture three-dimensional point cloud specifically includes the following sub-steps:

[0014] Use three-dimensional rotation transformation to correct the workpiece target's posture around the X m Axis rotation - α angle, Y m Axis rotation - β angle, Z m The axis rotates by -θ angle, and the correction is performed so that the three-dimensional posture angle of the detected workpiece is 0°. After posture correction is performed according to the initial posture three-dimensional point cloud P, a corrected three-dimensional point cloud P′ is obtained.

[0015] Preferably, extracting the projection contour of the workpiece by using a projection contour feature extraction algorithm according to the corrected three-dimensional point cloud to generate a feature sample matrix of the feature matrix specifically comprises the following sub-steps:

[0016] The corrected three-dimensional point cloud P′ is projected onto the XY coordinate plane, and the projection image is recorded as P XY ;

[0017] Calculate the projection image P XY The centroids of XY ;

[0018] With the O XY The ray along the positive direction of the X axis is the polar axis, and the projection image P is calculated by XY Any point p i With O XY The distance r i and the angle θ between the polar axes i , remember pi The coordinates are (r i ,θ i ), where θ i ∈[-π,π]);

[0019] Take O XY As the starting point, the angle interval is divided into angle intervals in the range of [-π,π] with the angle Δ as the interval. The number of divided angle intervals is K, where the range of Δ is (0.5°, 5°);

[0020] Statistics fall on θ k The point inside and the O XY The distances are arranged in descending order, and the maximum distance value max is obtained as the kth value of the projection contour vector. The specific formula (1) is as follows:

[0021]

[0022] Preferably, the step of performing dimensionality reduction processing on the feature matrix extracted from the projection profile by the PCA algorithm to obtain a feature vector matrix specifically comprises the following sub-steps:

[0023] For the feature matrix X MN Perform centralization and calculate the feature matrix X MN The covariance matrix C MN ;

[0024] Decomposition of the covariance matrix C by SVD MN Get the eigenvector e i and the corresponding eigenvalue λ i , and the calculated λ i Sort in descending order, where i = 1, 2, 3...N;

[0025] According to the calculated λ i Calculate the covariance matrix C MN The contribution rate of each variable in i and the cumulative contribution rate Θ r , where i = 1, 2, 3…N;

[0026] According to the set cumulative contribution rate limit and the cumulative contribution rate θ of the first r columns of the covariance matrix obtained r , select the dimension r of the eigenvector matrix; where r≤N;

[0027] Select lambda in descending order i e corresponding to the first r eigenvalues i Combined into the target projection matrix Z Nr Multiply to obtain the eigenvector matrix Y after dimensionality reduction Mr , where i=1,2,3…N.

[0028] In a second aspect, an embodiment of the present invention further provides a workpiece projection contour extraction device, comprising:

[0029] An acquisition module is used to acquire three-dimensional posture data of a workpiece target and preset an initial posture three-dimensional point cloud according to the three-dimensional posture data;

[0030] A correction module, used for correcting the posture of the workpiece target by using a three-dimensional rotation transformation, and obtaining a corrected three-dimensional point cloud after correction according to the initial posture three-dimensional point cloud;

[0031] An extraction module, used for extracting the projection contour of the workpiece according to the corrected three-dimensional point cloud by using a projection contour feature extraction algorithm to generate a feature sample matrix of a feature matrix;

[0032] The processing module is used to perform dimension reduction processing on the feature matrix extracted from the projection profile by using a PCA algorithm to obtain a feature vector matrix.

[0033] Preferably, the acquisition module includes an acquisition unit;

[0034] The acquisition unit is used to calculate the three-dimensional posture angle (α, β, θ) of the workpiece target by using the PEMSPNC algorithm, and preset the initial posture three-dimensional point cloud P according to the three-dimensional posture angle.

[0035] Preferably, the correction module further comprises a correction unit;

[0036] The correction unit is used to correct the posture of the workpiece target by using a three-dimensional rotation transformation around the X m Axis rotation - α angle, Y m Axis rotation - β angle, Z m The axis rotates by -θ angle, and the correction is performed so that the three-dimensional posture angle of the detected workpiece is 0°. After posture correction is performed according to the initial posture three-dimensional point cloud P, a corrected three-dimensional point cloud P′ is obtained.

[0037] In a third aspect, an embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in any one of the above-mentioned workpiece projection contour extraction methods when executing the computer program.

[0038] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in any one of the above-mentioned methods for extracting the projection contour of a workpiece are implemented.

[0039] Compared with the prior art, the present invention obtains three-dimensional posture data of the workpiece target, and presets an initial posture three-dimensional point cloud according to the three-dimensional posture data; corrects the posture of the workpiece target by using a three-dimensional rotation transformation, and obtains a corrected three-dimensional point cloud after correction according to the initial posture three-dimensional point cloud; extracts the projection contour of the workpiece through a projection contour feature extraction algorithm according to the corrected three-dimensional point cloud, and generates a feature sample matrix of the feature matrix; performs dimensionality reduction processing on the feature matrix extracted by the projection contour through the PCA algorithm to obtain a feature vector matrix; this solves the problem of high dimension of projection contour features and large redundant information in the feature matrix. The use of the PCA algorithm for dimensionality reduction processing can achieve maximum preservation of the global features of the workpiece. The extraction method has high computational efficiency and can ensure high integrity of the workpiece feature information, effectively reduce redundant information in the feature matrix, and has great significance for improving the performance of target recognition and a wide range of applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The present invention will be described in detail below in conjunction with the accompanying drawings. The above and other aspects of the present invention will become clearer and easier to understand through the detailed description made in conjunction with the following drawings. In the accompanying drawings:

[0041] Figure 1 It is a flow chart of the workpiece projection contour extraction method of the present invention;

[0042] Figure 2 It is a module diagram of the workpiece projection contour extraction device of the present invention;

[0043] Figure 3 It is a module diagram of the computer device of the present invention.

[0044] In the figure, 200, workpiece projection contour extraction device, 21, acquisition module, 211, acquisition unit, 22, correction module, 221, correction unit, 23, extraction module, 24, processing module, 300, computer equipment, 301, memory, 302, processor. DETAILED DESCRIPTION

[0045] The specific implementation of the present invention will be described in detail below with reference to the accompanying drawings.

[0046] The specific implementation modes / embodiments recorded herein are specific implementation modes of the present invention, which are used to illustrate the concept of the present invention, are explanatory and exemplary, and should not be interpreted as limiting the implementation modes of the present invention and the scope of the present invention. In addition to the embodiments recorded herein, those skilled in the art can also adopt other obvious technical solutions based on the contents disclosed in the claims and the specification of this application, and these technical solutions include any obvious replacement and modification of the embodiments recorded herein, which are within the protection scope of the present invention.

[0047] Embodiment 1

[0048] Please refer to Figure 1 As shown, Figure 1 The figure is a flow chart of the workpiece projection contour extraction method of the present invention.

[0049] An embodiment of the present invention provides a method for extracting a projection contour of a workpiece, comprising the following steps:

[0050] S01. Acquire three-dimensional posture data of a workpiece target, and preset an initial posture three-dimensional point cloud according to the three-dimensional posture data.

[0051] The three-dimensional posture data may be spatial coordinates, three-dimensional posture angles, etc.

[0052] S02. Correcting the posture of the workpiece target by using a three-dimensional rotation transformation, and obtaining a corrected three-dimensional point cloud after correction according to the initial posture three-dimensional point cloud.

[0053] The posture of the workpiece target may be the coordinates, position, etc. of the workpiece, and the posture may be a front view posture, a back posture, an inclined posture, a rotation posture, etc.

[0054] S03, extracting the projection contour of the workpiece by using a projection contour feature extraction algorithm according to the corrected three-dimensional point cloud, and generating a feature sample matrix of the feature matrix.

[0055] Among them, the projection contour feature extraction algorithm (PCF) specifically includes the first step of obtaining a shadow image by rendering the entire scene; the second step of rendering the ground where the shadow is located, with the shadow part being black and the non-shadow part being white, thus forming a 2D texture image with only black and white; the black and white 2D texture obtained in the second step is processed by a blurring algorithm to blur the jagged edges of the shadow and obtain a blurred image; the fourth step of rendering the bottom surface normally, and using the blurred black and white texture image to process the shadow of the ground, so that the jagged edges of the ground shadow appear blurred.

[0056] S04. Performing dimensionality reduction processing on the feature matrix extracted from the projection profile by using a PCA algorithm to obtain a feature vector matrix.

[0057] Specifically, three-dimensional posture data of the workpiece target is obtained, and an initial posture three-dimensional point cloud is preset according to the three-dimensional posture data; the posture of the workpiece target is corrected by using a three-dimensional rotation transformation, and a corrected three-dimensional point cloud is obtained after correction according to the initial posture three-dimensional point cloud; the projection contour of the workpiece is extracted by a projection contour feature extraction algorithm according to the corrected three-dimensional point cloud, and a feature sample matrix of the feature matrix is ​​generated; the feature matrix extracted by the projection contour is reduced in dimension by a PCA algorithm to obtain a feature vector matrix; this solves the problem of high dimension of projection contour features and large redundant information in the feature matrix, and uses the PCA algorithm for dimensionality reduction processing to improve the accuracy and effectiveness of the feature matrix, laying a foundation for subsequent improvement of target recognition performance; it can achieve maximum preservation of the global features of the workpiece, the extraction method has high computational efficiency, and can ensure high integrity of the workpiece feature information, effectively reduce redundant information in the feature matrix, has great significance for improving the performance of target recognition, and has a wide range of applications.

[0058] In this embodiment, step S01 includes the following sub-steps: using the PEMSPNC algorithm to calculate the three-dimensional posture angle (α, β, θ) of the workpiece target, and presetting the initial posture three-dimensional point cloud P according to the three-dimensional posture angle.

[0059] Specifically, the three-dimensional attitude angle (α, β, θ) of the workpiece target is estimated by using the PEMSPNC algorithm, and the initial attitude three-dimensional point cloud P is preset according to the three-dimensional attitude angle. Among them, α is the rotation angle of the X-axis of the machining coordinate system, β is the rotation angle of the Y-axis of the machining coordinate system, and θ is the rotation angle of the Z-axis of the machining coordinate system. By calculating the coordinates of the workpiece in the X-axis, Y-axis and Z-axis of the machining coordinate system, it is convenient to extract the attitude information of the workpiece target, with high accuracy and wide adaptability.

[0060] In this embodiment, step S02 specifically includes the following sub-steps: using a three-dimensional rotation transformation to correct the posture of the workpiece target, rotating around the X in the MCS coordinates. m Axis rotation - α angle, Y m Axis rotation - β angle, Z m The axis rotates by -θ angle, and the correction is performed so that the three-dimensional posture angle of the detected workpiece is 0°. After posture correction is performed according to the initial posture three-dimensional point cloud P, a corrected three-dimensional point cloud P′ is obtained.

[0061] In this embodiment, step S03 specifically includes the following sub-steps:

[0062] The corrected three-dimensional point cloud P′ is projected onto the XY coordinate plane, and the projection image is recorded as P XY .

[0063] Calculate the projection image P XY The centroids of XY .

[0064] With the O XY The ray along the positive direction of the X axis is the polar axis, and the projection image P is calculated by XY Any point p i With O XY The distance r i and the angle θ between the polar axes i , remember p i The coordinates are (r i ,θ i ), where θ i ∈[-π,π]).

[0065] Take O XY As the starting point, the angle interval is divided into [-π,π] intervals with an angle Δ as the interval, and the number of divided angle intervals is K, where the range of Δ is (0.5°, 5°).

[0066] Statistics fall on θ k The point inside and the O XY The distances are arranged in descending order, and the maximum distance value max is obtained as the kth value of the projection contour vector. The specific formula (1) is as follows:

[0067]

[0068] Specifically, the corrected three-dimensional point cloud P′ is projected onto the XY coordinate plane, and the projected image is recorded as P XY ; Calculate the projection image P XY The centroids of XY ; With the O XY The ray along the positive direction of the X axis is the polar axis, and the projection image P is calculated by XY Any point p i With O XY The distance r i and the angle θ between the polar axes i , remember p i The coordinates are (r i ,θ i ), where θ i ∈[-π,π]). XY As the starting point, the angle interval is divided into angle intervals in the range of [-π,π] with angle Δ as the interval. The number of angle intervals divided is K, where the range of Δ is (0.5°, 5°); the statistics fall on θ k The point inside and the O XYThe distances are arranged in descending order, and the maximum distance value max is taken as the kth value of the projection contour vector. The result is obtained according to the above formula (1). Using the PCA algorithm for dimensionality reduction processing can achieve the maximum preservation of the global features of the workpiece, ensure the high integrity of the workpiece feature information, reduce the redundant information in the feature matrix, and is of great significance to improving the performance of target recognition.

[0069] In this embodiment, step S04 specifically includes the following sub-steps:

[0070] For the feature matrix X MN Perform centralization and calculate the feature matrix X MN The covariance matrix C MN .

[0071] Decomposition of the covariance matrix C by SVD MN Get the eigenvector e i and the corresponding eigenvalue λ i , and the calculated λ i Sort in descending order, where i = 1, 2, 3…N.

[0072] According to the calculated λ i Calculate the covariance matrix C MN The contribution rate of each variable in i and the cumulative contribution rate Θ r , where i=1,2,3…N.

[0073] According to the set cumulative contribution rate limit and the cumulative contribution rate θ of the first r columns of the covariance matrix obtained r , select the dimension r of the eigenvector matrix; where r≤N.

[0074] Select lambda in descending order i e corresponding to the first r eigenvalues i Combined into the target projection matrix Z Nr Multiply to obtain the eigenvector matrix Y after dimensionality reduction Mr , where i=1,2,3…N.

[0075] Specifically, by the feature matrix X MN Perform centralization and calculate the feature matrix X MN The covariance matrix C MN . The covariance matrix C is decomposed by SVD MN Get the eigenvector e i and the corresponding eigenvalue λ i , and the calculated λ i Sort in descending order, where i = 1, 2, 3 ... N. According to the calculated λ i Calculate the covariance matrix CMN The contribution rate of each variable in i and the cumulative contribution rate Θ r , where i = 1, 2, 3 ... N. According to the set cumulative contribution rate limit and the cumulative contribution rate θ of the first r columns of the covariance matrix obtained r , select the dimension r of the eigenvector matrix; where r≤N. Select λ in descending order i e corresponding to the first r eigenvalues i Combined into the target projection matrix Z Nr Multiply to obtain the eigenvector matrix Y after dimensionality reduction Mr , where i = 1, 2, 3 ... N. This solves the problem of high feature dimension of projection profile and large redundant information in feature matrix. The PCA algorithm is used for dimensionality reduction processing, which can maximize the preservation of global features of workpieces. The extraction method has high computational efficiency and can ensure high integrity of workpiece feature information, effectively reducing redundant information in feature matrix, which is of great significance to improving target recognition performance and has a wide range of applications.

[0076] Embodiment 2

[0077] Please refer to Figure 2 As shown, Figure 1 : is a module diagram of a workpiece projection contour extraction device of the present invention; an embodiment of the present invention further provides a workpiece projection contour extraction device 200, comprising:

[0078] The acquisition module 21 is used to acquire the three-dimensional posture data of the workpiece target and preset the initial posture three-dimensional point cloud according to the three-dimensional posture data.

[0079] The correction module 22 is used to correct the posture of the workpiece target by using a three-dimensional rotation transformation, and obtain a corrected three-dimensional point cloud after correction according to the initial posture three-dimensional point cloud.

[0080] The extraction module 23 is used to extract the projection contour of the workpiece according to the corrected three-dimensional point cloud by using a projection contour feature extraction algorithm to generate a feature sample matrix of the feature matrix.

[0081] The processing module 24 is used to perform dimensionality reduction processing on the feature matrix extracted from the projection profile by using a PCA algorithm to obtain a feature vector matrix.

[0082] Specifically, the acquisition module 21 is used to acquire the three-dimensional posture data of the workpiece target, and preset the initial posture three-dimensional point cloud according to the three-dimensional posture data; the correction module 22 is used to correct the posture of the workpiece target by using a three-dimensional rotation transformation, and obtain the corrected three-dimensional point cloud after correction according to the initial posture three-dimensional point cloud; the extraction module 23 is used to extract the projection contour of the workpiece through the projection contour feature extraction algorithm according to the corrected three-dimensional point cloud, and generate a feature sample matrix of the feature matrix; the processing module 24 is used to perform dimensionality reduction processing on the feature matrix extracted from the projection contour through the PCA algorithm to obtain a feature vector matrix. This solves the problem of high dimension of the projection contour feature and large redundant information in the feature matrix. The PCA algorithm is used for dimensionality reduction processing, which improves the accuracy and effectiveness of the feature matrix, and lays the foundation for subsequent improvement of target recognition performance; it can achieve maximum preservation of the global features of the workpiece, the extraction method has high computational efficiency, and can ensure high integrity of the workpiece feature information, effectively reduce redundant information in the feature matrix, and has great significance for improving the performance of target recognition, and has a wide range of applications.

[0083] In this embodiment, the acquisition module 21 includes an acquisition unit 211;

[0084] The acquisition unit 211 is used to calculate the three-dimensional posture angle (α, β, θ) of the workpiece target by using the PEMSPNC algorithm, and preset the initial posture three-dimensional point cloud P according to the three-dimensional posture angle.

[0085] In this embodiment, the correction module 22 further includes a correction unit 221;

[0086] The correction unit 221 is used to correct the posture of the workpiece target by using a three-dimensional rotation transformation around the X m Axis rotation - α angle, Y m Axis rotation - β angle, Z m The axis rotates by -θ angle, and the three-dimensional posture angle of the detected workpiece is corrected so that the three-dimensional posture angle is 0°. After posture correction is performed according to the initial posture three-dimensional point cloud P, a corrected three-dimensional point cloud p′ is obtained.

[0087] In this embodiment, the extraction module is also used for:

[0088] The corrected three-dimensional point cloud p′ is projected onto the XY coordinate plane, and the projected image is recorded as P XY .

[0089] Calculate the projection image P XY The centroids of XY .

[0090] With the O XY The ray along the positive direction of the X axis is the polar axis, and the projection image P is calculated byXY Any point p i With O XY The distance r i and the angle θ between the polar axes i , remember p i The coordinates are (r i ,θ i ), where θ i ∈[-π,π]).

[0091] Take O XY As the starting point, the angle interval is divided into [-π,π] intervals with an angle Δ as the interval, and the number of divided angle intervals is K, where the range of Δ is (0.5°, 5°).

[0092] Statistics fall on θ k The point inside and the O XY The distances are arranged in descending order, and the maximum distance value max is obtained as the kth value of the projection contour vector. The specific formula (1) is as follows:

[0093]

[0094] According to the results obtained by the above formula (1), the PCA algorithm is used for dimensionality reduction processing, which can maximize the preservation of the global features of the workpiece, ensure the high integrity of the workpiece feature information, and reduce the redundant information in the feature matrix, which is of great significance to improving the performance of target recognition.

[0095] In this embodiment, the processing module 24 is further used for:

[0096] For the feature matrix X MN Perform centralization and calculate the feature matrix X MN The covariance matrix C MN .

[0097] Decomposition of the covariance matrix C by SVD MN Get the eigenvector e i and the corresponding eigenvalue λ i , and the calculated λ i Sort in descending order, where i = 1, 2, 3…N.

[0098] According to the calculated λ i Calculate the covariance matrix C MN The contribution rate of each variable in i and the cumulative contribution rate Θ r , where i=1,2,3…N.

[0099] According to the set cumulative contribution rate limit and the cumulative contribution rate θ of the first r columns of the covariance matrix obtained r, select the dimension r of the eigenvector matrix; where r≤N.

[0100] Select lambda in descending order i e corresponding to the first r eigenvalues i Combined into the target projection matrix Z Nr Multiply to obtain the eigenvector matrix Y after dimensionality reduction Mr , where i=1,2,3…N.

[0101] Specifically, by the feature matrix X MN Perform centralization and calculate the feature matrix X MN The covariance matrix C MN . The covariance matrix C is decomposed by SVD MN Get the eigenvector e i and the corresponding eigenvalue λ i , and the calculated λ i Sort in descending order, where i = 1, 2, 3 ... N. According to the calculated λ i Calculate the covariance matrix C MN The contribution rate of each variable in i and the cumulative contribution rate Θ r , where i = 1, 2, 3 ... N. According to the set cumulative contribution rate limit and the cumulative contribution rate θ of the first r columns of the covariance matrix obtained r , select the dimension r of the eigenvector matrix; where r≤N. Select λ in descending order i e corresponding to the first r eigenvalues i Combined into the target projection matrix Z Nr Multiply to obtain the eigenvector matrix Y after dimensionality reduction Mr , where i = 1, 2, 3 ... N. This solves the problem of high feature dimension of projection profile and large redundant information in feature matrix. The PCA algorithm is used for dimensionality reduction processing, which can maximize the preservation of global features of workpieces. The extraction method has high computational efficiency and can ensure high integrity of workpiece feature information, effectively reducing redundant information in feature matrix, which is of great significance to improving target recognition performance and has a wide range of applications.

[0102] Embodiment 3

[0103] Please refer to Figure 3 As shown, Figure 3 The embodiment of the present invention further provides a computer device 300, comprising a memory 301, a processor 302, and a computer program stored in the memory 301 and executable on the processor 302, wherein the processor 302 implements the steps of the workpiece projection contour extraction method described in the first embodiment when executing the computer program.

[0104] Embodiment 4

[0105] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the workpiece projection contour extraction method described in the first embodiment are implemented.

[0106] Compared with the prior art, the present invention obtains three-dimensional posture data of the workpiece target, and presets an initial posture three-dimensional point cloud according to the three-dimensional posture data; corrects the posture of the workpiece target by using a three-dimensional rotation transformation, and obtains a corrected three-dimensional point cloud after correction according to the initial posture three-dimensional point cloud; extracts the projection contour of the workpiece through a projection contour feature extraction algorithm according to the corrected three-dimensional point cloud, and generates a feature sample matrix of the feature matrix; performs dimensionality reduction processing on the feature matrix extracted by the projection contour through the PCA algorithm to obtain a feature vector matrix; this solves the problem of high dimension of projection contour features and large redundant information in the feature matrix. The use of the PCA algorithm for dimensionality reduction processing can achieve maximum preservation of the global features of the workpiece. The extraction method has high computational efficiency and can ensure high integrity of the workpiece feature information, effectively reduce redundant information in the feature matrix, and has great significance for improving the performance of target recognition and a wide range of applications.

Claims

1. A method for extracting workpiece projection contour, It is characterized in that The following steps are involved: Acquire three-dimensional posture data of the workpiece target, and preset an initial posture three-dimensional point cloud according to the three-dimensional posture data; Performing posture correction on the workpiece target by using a three-dimensional rotation transformation, and obtaining a corrected three-dimensional point cloud after correction according to the initial posture three-dimensional point cloud; Extract the projection contour of the workpiece using a projection contour feature extraction algorithm according to the corrected three-dimensional point cloud to generate a feature sample matrix of the feature matrix; Performing dimensionality reduction processing on the feature matrix extracted from the projection profile by using a PCA algorithm to obtain a feature vector matrix; The step of acquiring the three-dimensional posture data of the workpiece target and presetting the initial posture three-dimensional point cloud according to the three-dimensional posture data specifically includes the following sub-steps: The three-dimensional posture angle (α, β, θ) of the workpiece target is calculated using the PEMSPNC algorithm, and the initial posture three-dimensional point cloud P is preset according to the three-dimensional posture angle; The method of correcting the posture of the workpiece target by using a three-dimensional rotation transformation to obtain a corrected three-dimensional point cloud after correcting the initial posture three-dimensional point cloud specifically includes the following sub-steps: Use three-dimensional rotation transformation to correct the workpiece target's posture around the MCS coordinates Axis rotation - α angle, Axis rotation - β angle, The axis rotates -θ angle to correct the three-dimensional posture angle of the detected workpiece. , after performing posture correction according to the initial posture three-dimensional point cloud P, a corrected three-dimensional point cloud is obtained ; The extracting of the workpiece projection contour by using the projection contour feature extraction algorithm according to the corrected three-dimensional point cloud to generate a feature sample matrix of the feature matrix specifically includes the following sub-steps: The corrected three-dimensional point cloud , projected onto the XY coordinate plane respectively, and the projected image is recorded as ; Calculate the projection image The centroids of ; As mentioned The ray along the positive direction of the X axis is the polar axis, and the projection image is calculated by Any point and Distance and the angle between the polar axes ,remember The coordinates of are ( ),in, ); by As the starting point, with an angle For interval The range is divided into angle intervals, and the number of angle intervals is K, where: ; Statistics fall on The points within the The distances are arranged in descending order, and the maximum distance value max is obtained as the kth value of the projection contour vector. The specific formula (1) is as follows: …(1)。 2. The workpiece projection contour extraction method according to claim 1, It is characterized in that The step of performing dimensionality reduction processing on the feature matrix extracted from the projection profile by the PCA algorithm to obtain a feature vector matrix specifically includes the following sub-steps: For the feature matrix Perform centralization and calculate the feature matrix The covariance matrix of ; Decomposition of the covariance matrix by SVD Get the feature vector and the corresponding eigenvalues , and the calculated Sort in descending order, where ; According to the calculated Calculate the covariance matrix The contribution rate of each variable in and cumulative contribution rate ,in, ; According to the set cumulative contribution rate limit and the cumulative contribution rate of the first r columns of the covariance matrix , select the dimension r of the eigenvector matrix; Select the descending order The first r eigenvalues ​​correspond to Combined into the target projection matrix Multiply to obtain the eigenvector matrix after dimensionality reduction ,in, .

3. A workpiece projection contour extraction device, It is characterized in that include: An acquisition module is used to acquire three-dimensional posture data of a workpiece target and preset an initial posture three-dimensional point cloud according to the three-dimensional posture data; A correction module, used for correcting the posture of the workpiece target by using a three-dimensional rotation transformation, and obtaining a corrected three-dimensional point cloud after correction according to the initial posture three-dimensional point cloud; An extraction module, used for extracting the projection contour of the workpiece according to the corrected three-dimensional point cloud by using a projection contour feature extraction algorithm to generate a feature sample matrix of a feature matrix; A processing module, used for performing dimensionality reduction processing on the feature matrix extracted from the projection profile by using a PCA algorithm to obtain a feature vector matrix; The acquisition module includes an acquisition unit; The acquisition unit is used to calculate the three-dimensional posture angle (α, β, θ) of the workpiece target by using the PEMSPNC algorithm, and preset the initial posture three-dimensional point cloud P according to the three-dimensional posture angle; The correction module also includes a correction unit; The correction unit is used to correct the posture of the workpiece target by using a three-dimensional rotation transformation around the MCS coordinates. Axis rotation - α angle, Axis rotation - β angle, The axis rotates -θ angle to correct the three-dimensional posture angle of the detected workpiece. , after performing posture correction according to the initial posture three-dimensional point cloud P, a corrected three-dimensional point cloud is obtained ; The extraction module is also used to correct the three-dimensional point cloud , projected onto the XY coordinate plane respectively, and the projected image is recorded as ; Calculate the projection image The centroids of ; As mentioned The ray along the positive direction of the X axis is the polar axis, and the projection image is calculated by Any point and Distance and the angle between the polar axes ,remember The coordinates of are ( ),in, ); by As the starting point, with an angle For interval The range is divided into angle intervals, and the number of angle intervals is K, where: ; Statistics fall on The points within the The distances are arranged in descending order, and the maximum distance value max is obtained as the kth value of the projection contour vector. The specific formula (1) is as follows: …(1)。 4. A computer device, It is characterized in that The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the workpiece projection contour extraction method as claimed in any one of claims 1 to 2 when executing the computer program.

5. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the workpiece projection contour extraction method according to any one of claims 1 to 2 are implemented.