CN-122023315-A - Intelligent visual positioning method for metal forging part based on intelligent robot
Abstract
The application relates to the technical field of image processing, in particular to an intelligent visual positioning method of a metal forging piece based on an intelligent robot, which comprises the steps of obtaining a surface image to be detected of the metal forging piece and a template image; extracting an ROI region, constructing characteristic contours for each edge line, calculating false evaluation values of each edge line to screen out a real edge line, generating connecting lines connecting upper end points of the real edge line, calculating connectable coefficients of the connecting lines, screening the connecting lines, searching optimal connecting paths of the two end points in the neighborhood of the connecting lines to repair broken edges in the ROI region, calculating shape feature of each edge pixel point, screening out feature points to calculate matching degree, judging the matching of the two images, extracting matching point pairs to solve the pose of a metal forging in a space in a surface image to be tested, and controlling a robot to perform positioning grabbing. The application improves the image matching precision, and enables the robot to accurately complete the positioning and grabbing task.
Inventors
- LIU SIJIN
Assignees
- 丰泰智控(惠州)科技有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260127
Claims (10)
- 1. The intelligent visual positioning method for the metal forging part based on the intelligent robot is characterized by comprising the following steps of: acquiring a surface image to be detected of the metal forging piece and a template image; extracting an ROI (region of interest) where the metal forging part is located in the surface image to be detected, constructing a characteristic contour for each edge line in the ROI based on the outer contour of the ROI, and calculating false evaluation values of each edge line through gradients of edge pixel points on the characteristic contour and gray level change conditions so as to screen out real edge lines; Aiming at the upper end points of each real edge line, analyzing the consistency of the local directions between the end points of the rest real edge lines to generate connecting lines for connecting the two end points, evaluating the gradient consistency of the pixel points and the end points on the connecting lines and false evaluation values to obtain connectable coefficients of the connecting lines, screening the connecting lines and searching the optimal connecting paths of the two end points in the neighborhood of the connecting lines to repair the broken edges in the ROI; aiming at the repaired ROI area, analyzing gradient change consistency and change intensity of adjacent edge pixel points, calculating shape feature degree of each edge pixel point, and screening feature points according to the shape feature degree; and calculating the matching degree of the surface image to be detected and the template image by combining the shape feature degree and the connectable coefficient corresponding to the edge where the feature point is positioned through the position distribution of the feature point and the degree of the gradient change deviating from the template image, judging the matching of the two images and extracting a matching point pair so as to calculate the pose of the metal forging in the space in the surface image to be detected, and controlling the robot to carry out positioning grabbing.
- 2. The intelligent visual positioning method of the metal forging based on the intelligent robot, as set forth in claim 1, wherein the step of constructing the characteristic contour for each edge line in the ROI area comprises the steps of marking a midpoint of each edge line as a center pixel point corresponding to the edge pixel point, and constructing a characteristic contour which is concentric with and identical in shape with the outer contour of the ROI area and passes through the center pixel point for each edge line based on the outer contour of the ROI area.
- 3. The intelligent visual positioning method for metal forging based on intelligent robot according to claim 2, wherein calculating false evaluation values of each edge line to screen out a true edge line comprises: Aiming at the edge pixel points distributed on the characteristic contour, calculating the difference of gray values between the center pixel point and other edge pixel points to be used as gray difference; the false evaluation value and the gray level difference are in positive correlation, and the false evaluation value and the gray level difference are in negative correlation; and marking edge lines with false evaluation values smaller than a preset first threshold value in the ROI area as real edge lines.
- 4. The intelligent visual positioning method of the metal forging based on the intelligent robot as set forth in claim 1, wherein the process of obtaining the connecting wire is as follows: Calculating the direction vector of any one end point on each real edge line pointing to the adjacent edge pixel point; selecting an endpoint closest to any endpoint from all endpoints of the rest real edge lines as an adjacent endpoint aiming at the any endpoint; calculating cosine value of the included angle between the direction vector of any endpoint and the direction vector of the adjacent endpoint; And otherwise, respectively taking the direction vectors of any endpoint and the adjacent endpoint as extension lines, determining the intersection point of the two extension lines as an edge inflection point, and sequentially connecting any endpoint with the edge inflection point and the adjacent endpoint as the connection line.
- 5. The intelligent visual positioning method for metal forging based on intelligent robot according to claim 4, wherein obtaining the connectable coefficient of the connecting wire comprises: aiming at any end point and the adjacent end points, calculating the correlation degree between the gray gradients of the two end points and the gray gradient of each pixel point on the connecting line respectively, and selecting the maximum value of the two correlation degrees corresponding to each pixel point on the connecting line; calculating the degree of dispersion of the degree of correlation between the two endpoints and all pixel points on the connecting line; The gradient approximation degree of the connecting line and the maximum value of all pixel points on the connecting line are in positive correlation, and the gradient approximation degree and the maximum value of all pixel points on the connecting line are in negative correlation; The connectable coefficient and false evaluation values of two real edge lines corresponding to the connecting lines are in negative correlation, and positive correlation with gradient approximation.
- 6. The intelligent visual positioning method for the metal forging based on the intelligent robot, as set forth in claim 5, is characterized in that the screening of the connecting lines and searching for an optimal connecting path of two end points in the neighborhood of the connecting lines comprises marking the connecting lines with the connectable coefficients larger than or equal to a preset second threshold as repairable edges, expanding a plurality of pixel points to two sides of the repairable edges along the normal direction of each pixel point on the repairable edges respectively, defining areas contained in all the pixel points and the expanded pixel points as edge searching areas, and optimizing paths of the connecting start points and the end points in the edge searching areas by using an intelligent optimization algorithm with the two end points corresponding to the repairable edges as starting points and end points to obtain the optimal connecting path.
- 7. The intelligent visual positioning method for metal forging based on intelligent robot as set forth in claim 6, wherein the calculating of the shape feature degree of each edge pixel point includes: The pixel points on the optimal connection path are marked as edge pixel points, and the correlation degree of gray gradients between the pixel points and two adjacent edge pixel points is calculated aiming at any edge pixel point in the repaired ROI area, and negative mapping is carried out on the pixel points; and the shape feature degree and the gradient strength are in positive correlation with the negative mapping result.
- 8. The intelligent visual positioning method for the metal forging based on the intelligent robot, as set forth in claim 1, is characterized in that the screening process of the feature points is to select edge pixel points with the shape feature degree larger than or equal to a preset third threshold value as feature points for the ROI area in the surface image to be detected.
- 9. The intelligent visual positioning method for metal forging based on intelligent robot according to claim 7, wherein the calculating the matching degree of the surface image to be measured and the template image comprises: Extracting feature points in the ROI region in the template image according to a calculation method of the shape feature degree of edge pixel points in the surface image to be measured, establishing a polar coordinate system by taking the midpoint of the ROI region as a pole, and acquiring the polar angle of each feature point in the polar coordinate system; Respectively calculating the differences of polar angle and gradient strength between each characteristic point in the surface image to be detected and each characteristic point in the template image to be detected, and respectively taking the differences as the polar angle differences and the gradient differences; Aiming at the surface image to be detected, when each feature point is positioned on an original real edge line, the edge confidence coefficient is assigned to be 1, and when the feature point is positioned on the repaired edge, the edge confidence coefficient is the connectable coefficient of the repairable edge; The matching degree is the result of forward fusion of the maximum similarity factor, the shape feature degree and the edge confidence degree of all feature points in the surface image to be detected.
- 10. The intelligent visual positioning method for the metal forging based on the intelligent robot, as set forth in claim 9, is characterized in that the step of judging the matching of the two images and extracting the matching point pairs includes that if the matching degree is greater than or equal to a preset fourth threshold, the matching is successful, otherwise, the matching is unsuccessful, and for each characteristic point in the surface image to be detected, the characteristic point corresponding to the characteristic point with the largest similarity factor in the template image is defined as the matching point pair.
Description
Intelligent visual positioning method for metal forging part based on intelligent robot Technical Field The application relates to the technical field of image processing, in particular to an intelligent visual positioning method for a metal forging part based on an intelligent robot. Background In industrial automation production, high-precision visual identification and positioning are performed on metal forged pieces, and the method is a key premise for realizing automatic grabbing, assembling or quality detection of robots. The workpiece positioning method based on traditional machine vision generally depends on a template matching technology, however, as the surface of a metal forging piece is generally smooth, strong and uneven specular reflection is easy to generate, a high-brightness reflection area can submerge a real physical edge, so that the real edge is blurred, a discontinuous or broken outline edge is formed, meanwhile, a bright spot or a light band formed by reflection can be misjudged as an edge, a large number of false edges which do not exist on the real workpiece are generated, and therefore, the quality of edge features extracted from images is low, the edge features are seriously deviated from the template features, finally, the matching success rate based on the traditional template matching technology is low, the accurate positioning of the metal forging piece is influenced, and further, the grasping failure, assembly dislocation or missed detection false detection of the metal forging piece by a robot are seriously restricted, so that the reliability and the efficiency of an automatic production line are seriously limited. Disclosure of Invention In order to solve the technical problems, an intelligent visual positioning method for the metal forging part based on an intelligent robot is provided to solve the existing problems. The application provides an intelligent visual positioning method for a metal forging part based on an intelligent robot, which comprises the following steps of: acquiring a surface image to be detected of the metal forging piece and a template image; extracting an ROI (region of interest) where the metal forging part is located in the surface image to be detected, constructing a characteristic contour for each edge line in the ROI based on the outer contour of the ROI, and calculating false evaluation values of each edge line through gradients of edge pixel points on the characteristic contour and gray level change conditions so as to screen out real edge lines; Aiming at the upper end points of each real edge line, analyzing the consistency of the local directions between the end points of the rest real edge lines to generate connecting lines for connecting the two end points, evaluating the gradient consistency of the pixel points and the end points on the connecting lines and false evaluation values to obtain connectable coefficients of the connecting lines, screening the connecting lines and searching the optimal connecting paths of the two end points in the neighborhood of the connecting lines to repair the broken edges in the ROI; aiming at the repaired ROI area, analyzing gradient change consistency and change intensity of adjacent edge pixel points, calculating shape feature degree of each edge pixel point, and screening feature points according to the shape feature degree; and calculating the matching degree of the surface image to be detected and the template image by combining the shape feature degree and the connectable coefficient corresponding to the edge where the feature point is positioned through the position distribution of the feature point and the degree of the gradient change deviating from the template image, judging the matching of the two images and extracting a matching point pair so as to calculate the pose of the metal forging in the space in the surface image to be detected, and controlling the robot to carry out positioning grabbing. Preferably, the construction of the characteristic contour for each edge line in the ROI comprises the steps of marking the midpoint of each edge line as a central pixel point corresponding to the edge pixel point, and constructing a characteristic contour which is concentric with the outline of the ROI and has the same shape and passes through the central pixel point for each edge line based on the outline of the ROI. Preferably, the calculating the false evaluation value of each edge line to screen out the real edge line includes: Aiming at the edge pixel points distributed on the characteristic contour, calculating the difference of gray values between the center pixel point and other edge pixel points to be used as gray difference; the false evaluation value and the gray level difference are in positive correlation, and the false evaluation value and the gray level difference are in negative correlation; and marking edge lines with false evaluation values smaller than a preset first threshold val