Search

CN-122023276-A - Workpiece positioning method and device, electronic equipment, storage medium and program product

CN122023276ACN 122023276 ACN122023276 ACN 122023276ACN-122023276-A

Abstract

The embodiment of the application provides a workpiece positioning method and device, electronic equipment, storage medium and program product, and relates to the technical field of image detection, wherein the method comprises the steps of generating a workpiece image according to a two-dimensional picture taken from the axial upper side of a target workpiece in a vertical overhead view; the method comprises the steps of matching a feature matching template corresponding to a target workpiece with a workpiece image, marking an image reference position in the feature matching template, forming a region-of-interest template with a preset first relative position relation with the image reference position, positioning a region of interest in the workpiece image, enveloping at least part of the edge of interest of the target workpiece by the region-of-interest template, searching edge points in the region of interest, and positioning the edge of interest of the target workpiece according to the edge points. According to the embodiment of the application, the region of interest is positioned in the workpiece image based on the first relative position relation between the region of interest template and the image reference position, so that the positioning accuracy can be improved.

Inventors

  • ZHUANG SHUNXU
  • CHEN WENMIAO
  • MA CHANGHAI
  • YU QIANG
  • HOU XIAOSHUAI
  • ZHU YAOWEN
  • ZHAI QIANG

Assignees

  • 潍柴动力股份有限公司

Dates

Publication Date
20260512
Application Date
20260105

Claims (10)

  1. 1. A method of positioning a workpiece, comprising: Generating a workpiece image from a two-dimensional photograph taken from the axial upper side of the target workpiece in a vertical overhead view; Matching the feature matching template corresponding to the target workpiece with the workpiece image, wherein the feature matching template is marked with an image reference position; Positioning an interest region in the workpiece image according to an interest region template which forms a preset first relative position relation with the image reference position; And searching edge points in the region of interest, and positioning the edge of interest of the target workpiece according to the edge points.
  2. 2. The method of claim 1, wherein the target structure section of the target workpiece has a positioning feature, the real overhead profile of the target structure section is an actual profile of an ideal overhead profile forming a notch at a position corresponding to the positioning feature, the ideal overhead profile is a closed reference profile without the positioning feature, and the interesting edge is an edge of the ideal overhead profile; After locating the edge of interest of the target workpiece from the edge point, the method further comprises: Determining edge points which are not found in the region of interest on the edge of interest; and determining the offset of the positioning feature and the reference positioning feature in the workpiece image according to the boundary point position between the edge point found in the region of interest and the edge point not found in the region of interest, wherein the offset is the offset in the preset direction.
  3. 3. The method of claim 2, wherein the ideal overhead profile is a circle, the locating feature is a plurality of the locating features symmetrically distributed in a radial direction, the predetermined direction is a rotational direction, and the determining an offset of the locating feature from a reference locating feature in the workpiece image comprises: determining a line segment passing through the symmetry point of each notch and the circle center according to the boundary point position; And determining the rotation angle offset of the positioning feature in the rotation direction according to the angle difference value between the line segment and the reference line segment.
  4. 4. The method of claim 2, wherein the locating feature is an assembly locating feature, the method further comprising, after determining an offset of the locating feature from a reference locating feature in the workpiece image: controlling the assembly mechanism to move the offset in the preset direction; and after the movement is finished, controlling the assembly mechanism to be in butt joint with the assembly positioning feature, and fixing the degree of freedom in the preset direction.
  5. 5. The method of claim 1, wherein the feature matching template is obtained by identifying a plurality of two-dimensional reference features and the image reference position in a workpiece reference image, the plurality of two-dimensional reference features and the image reference position form a preset second relative positional relationship therebetween, and the matching the feature matching template corresponding to the target workpiece with the workpiece image comprises: Determining two-dimensional matching features in the workpiece image, which are matched with the plurality of two-dimensional reference features; And determining a position which forms the second relative position relation with the two-dimensional matching feature in the workpiece image, and obtaining the image reference position in the workpiece image.
  6. 6. The method of claim 1, wherein generating the workpiece image from a two-dimensional photograph taken from axially above the target workpiece at a vertical overhead view, comprises: performing brightness lifting processing on the two-dimensional photo to obtain a first image; and performing morphological processing operation of etching before expanding on the first image to obtain the workpiece image.
  7. 7. A workpiece positioning device, comprising: a generation module for generating a workpiece image from a two-dimensional photograph taken from an axial upper side of a target workpiece in a vertical overhead view; The matching module is used for matching the feature matching template corresponding to the target workpiece with the workpiece image, wherein the feature matching template is marked with an image reference position; The first positioning module is used for forming a region of interest template with a preset first relative position relation with the image reference position and positioning a region of interest in the workpiece image; and the second positioning module is used for searching edge points in the region of interest and positioning the edge of interest of the target workpiece according to the edge points.
  8. 8. An electronic device comprising a memory, a processor and a computer program stored on the memory, the processor implementing the method of any one of claims 1-6 when the computer program is executed.
  9. 9. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when executed by a processor, implements the method of any of claims 1-6.
  10. 10. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any of claims 1-6.

Description

Workpiece positioning method and device, electronic equipment, storage medium and program product Technical Field The present application relates to the field of image detection technologies, and in particular, to a workpiece positioning method and apparatus, an electronic device, a storage medium, and a program product. Background When workpieces such as a transmission shaft connecting piece of an engineering truck are assembled, high-precision positioning is usually realized through visual guidance. In the prior art, a 2D camera is used for photographing and combining a related algorithm for positioning, part of schemes depend on deep learning classification positioning, a large number of pictures need to be trained, the debugging period is long, and the hardware requirement is high. In addition, the scheme performs positioning calculation by extracting a plurality of features, has complex flow, has high requirements on the definition of the target features and is easily influenced by the field environment. In practical application, workpiece images are easily interfered by factors such as background clutter, insufficient illumination and the like, so that edge positioning is inaccurate, subsequent assembly precision is affected, and high-efficiency and accurate requirements of automatic production are difficult to meet. Disclosure of Invention Embodiments of the present application provide a workpiece positioning method and apparatus, an electronic device, a storage medium, and a program product, so as to alleviate or solve one or more technical problems in the prior art. In a first aspect, an embodiment of the present application provides a workpiece positioning method, including: Generating a workpiece image from a two-dimensional photograph taken from the axial upper side of the target workpiece in a vertical overhead view; Matching the feature matching template corresponding to the target workpiece with the workpiece image, wherein the feature matching template is marked with an image reference position; Positioning an interest region in the workpiece image according to an interest region template which forms a preset first relative position relation with the image reference position; And searching edge points in the region of interest, and positioning the edge of interest of the target workpiece according to the edge points. In some embodiments, the target structure section of the target workpiece is provided with a positioning feature, the real overhead profile of the target structure section is an actual profile of an ideal overhead profile forming a notch at a position corresponding to the positioning feature, the ideal overhead profile is a closed reference profile without the positioning feature, and the interesting edge is an edge of the ideal overhead profile; After locating the edge of interest of the target workpiece from the edge point, the method further comprises: Determining edge points which are not found in the region of interest on the edge of interest; and determining the offset of the positioning feature and the reference positioning feature in the workpiece image according to the boundary point position between the edge point found in the region of interest and the edge point not found in the region of interest, wherein the offset is the offset in the preset direction. In some embodiments, the ideal overhead profile is a circle, the locating feature is a plurality of locating features symmetrically distributed along a radial direction, the preset direction is a rotation direction, and the determining the offset of the locating feature from a reference locating feature in the workpiece image includes: determining a line segment passing through the symmetry point of each notch and the circle center according to the boundary point position; And determining the rotation angle offset of the positioning feature in the rotation direction according to the angle difference value between the line segment and the reference line segment. In some embodiments, the locating feature is an assembly locating feature, and after determining an offset of the locating feature from a reference locating feature in the workpiece image, the method further comprises: controlling the assembly mechanism to move the offset in the preset direction; and after the movement is finished, controlling the assembly mechanism to be in butt joint with the assembly positioning feature, and fixing the degree of freedom in the preset direction. In some embodiments, the feature matching template is obtained by identifying a plurality of two-dimensional reference features and the image reference positions in a workpiece reference image, a preset second relative positional relationship is formed between the plurality of two-dimensional reference features and the image reference positions, and the matching the feature matching template corresponding to the target workpiece with the workpiece image includes: Determining two-dim