Search

CN-121998918-A - Template matching-based glue width detection method and device, computer equipment and medium

CN121998918ACN 121998918 ACN121998918 ACN 121998918ACN-121998918-A

Abstract

The application relates to a template matching-based glue width detection method, a template matching-based glue width detection device, computer equipment and a medium. The method comprises the steps of respectively obtaining a first template image and a first detection image of the same product, wherein the first template image is a product image without glue, the first detection image is a product image with glue, respectively marking the first template image and the first detection image differently to obtain a second template image and a second detection image, processing the second detection image according to a preset deep learning model to obtain a first semantic segmentation result containing characteristic point information and a second semantic segmentation result containing glue information, determining a target characteristic line coordinate sequence according to the first semantic segmentation result and the second template image, and determining a target glue width according to the second semantic segmentation result and the target characteristic line coordinate sequence. By adopting the application, the accuracy of the glue width detection can be improved.

Inventors

  • WANG FAZHENG
  • LIU SHU

Assignees

  • 上海思谋科技有限公司

Dates

Publication Date
20260508
Application Date
20260108

Claims (10)

  1. 1. The template matching-based glue width detection method is characterized by comprising the following steps of: respectively acquiring a first template image and a first detection image of the same product, wherein the first template image is a product image without glue; Respectively marking the first template diagram and the first detection diagram differently to obtain a second template diagram and a second detection diagram; Processing the second detection graph according to a preset deep learning model to obtain a first semantic segmentation result containing characteristic point information and a second semantic segmentation result containing glue information; Determining a target characteristic line coordinate sequence according to the first semantic segmentation result and the second template diagram; and determining the target glue width according to the second semantic segmentation result and the target characteristic line coordinate sequence.
  2. 2. The method according to claim 1, wherein the marking the first template map and the first detection map differently to obtain a second template map and a second detection map includes: marking the characteristic points and the characteristic lines of the first template diagram to obtain a second template diagram; And marking the characteristic points and the glue contours of the first detection graph to obtain a second detection graph.
  3. 3. The method according to claim 2, wherein the performing feature point labeling and feature line labeling on the first template map to obtain a second template map includes: Acquiring coordinates of characteristic points of the product in the first template map to obtain template map characteristic point coordinates; Acquiring a coordinate sequence of a reference characteristic line associated with the characteristic point from the first template diagram to obtain a reference characteristic line coordinate sequence; and marking the characteristic points and the characteristic lines of the first template map based on the characteristic point coordinates of the template map and the reference characteristic line coordinate sequence to obtain a second template map.
  4. 4. A method according to claim 3, wherein said determining a target feature line coordinate sequence from said first semantic segmentation result and said second template map comprises: Determining the feature point coordinates of the detection map corresponding to the feature points of the product in the second detection map according to the first semantic segmentation result; calculating coordinate deviation between the feature point coordinates of the detection graph and the feature point coordinates of the template graph to obtain target coordinate deviation; And determining a target characteristic line coordinate sequence according to the target coordinate deviation and the reference characteristic line coordinate sequence.
  5. 5. The method of claim 4, wherein said determining a target feature line coordinate sequence from said target coordinate bias and said reference feature line coordinate sequence comprises: determining a horizontal coordinate deviation and a vertical coordinate deviation corresponding to the target coordinate deviation; and superposing the horizontal coordinate deviation and the vertical coordinate deviation on each pixel point coordinate in the reference characteristic line coordinate sequence to obtain a target characteristic line coordinate sequence.
  6. 6. The method according to any one of claims 1-5, wherein determining a target glue width from the second semantic segmentation result and the target feature line coordinate sequence comprises: determining a glue profile coordinate sequence corresponding to the glue profile in the second detection graph according to the second semantic segmentation result; Taking a midpoint coordinate corresponding to the target characteristic line coordinate sequence as a designated point coordinate; Performing linear fitting on the target characteristic line coordinate sequence to obtain a target linear equation; determining a target vertical line equation according to the target linear equation and the appointed point coordinates; Acquiring an intersection point coordinate between the target vertical line equation and the glue profile coordinate sequence to obtain a first intersection point coordinate and a second intersection point coordinate; and determining the target glue width according to the first intersection point coordinate and the second intersection point coordinate.
  7. 7. The method of claim 6, wherein determining a target glue width based on the first intersection point coordinate and the second intersection point coordinate comprises: calculating the pixel distance between the first intersection point coordinate and the second intersection point coordinate according to a preset distance calculation formula to obtain a target pixel distance; And determining the target glue width according to the preset pixel precision and the target pixel distance.
  8. 8. Glue width detection device based on template matching, characterized by comprising: The device comprises an acquisition module, a detection module and a display module, wherein the acquisition module is used for respectively acquiring a first template image and a first detection image of the same product, wherein the first template image is a product image without glue; The marking module is used for respectively marking the first template image and the first detection image differently to obtain a second template image and a second detection image; The processing module is used for processing the second detection graph according to a preset deep learning model to obtain a first semantic segmentation result containing characteristic point information and a second semantic segmentation result containing glue information; The determining module is used for determining a target characteristic line coordinate sequence according to the first semantic segmentation result and the second template diagram, and determining a target glue width according to the second semantic segmentation result and the target characteristic line coordinate sequence.
  9. 9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 7 when the computer program is executed.
  10. 10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.

Description

Template matching-based glue width detection method and device, computer equipment and medium Technical Field The present application relates to the field of glue width detection technology, and in particular, to a method, an apparatus, a computer device, and a medium for detecting glue width based on template matching. Background With the continuous development of artificial intelligence technology, vision non-contact type automatic industrial detection has gradually replaced tedious manual detection. The industrial automatic detection technology taking the visual algorithm as the core is a key means for improving the productivity and reducing the labor cost in the industrial detection field by virtue of the advantages of high precision and high efficiency. However, in the industrial glue width detection scene, the traditional two-dimensional image detection method generally extracts the glue outline through image binarization and edge detection and then calculates the glue width, which is easily affected by industrial environment interference such as product surface color difference, illumination fluctuation and the like to cause edge outline distortion, and has poor adaptability to complex curve glue. Therefore, how to improve the accuracy of the glue width detection is a urgent problem to be solved. Disclosure of Invention Based on the above, it is necessary to provide a method, a device, a computer device and a medium for detecting a glue width based on template matching, which can improve the accuracy of glue width detection. In a first aspect, the present application provides a method for detecting a glue width based on template matching, including: respectively acquiring a first template image and a first detection image of the same product, wherein the first template image is a product image without glue; different labels are respectively carried out on the first template diagram and the first detection diagram, and a second template diagram and a second detection diagram are obtained; processing the second detection graph according to a preset deep learning model to obtain a first semantic segmentation result containing characteristic point information and a second semantic segmentation result containing glue information; determining a target characteristic line coordinate sequence according to the first semantic segmentation result and the second template diagram; And determining the target glue width according to the second semantic segmentation result and the target feature line coordinate sequence. In a second aspect, the present application provides a device for detecting a width of a glue based on template matching, including: The device comprises an acquisition module, a detection module and a display module, wherein the acquisition module is used for respectively acquiring a first template image and a first detection image of the same product, wherein the first template image is a product image without glue; the marking module is used for respectively marking the first template image and the first detection image differently to obtain a second template image and a second detection image; The processing module is used for processing the second detection graph according to a preset deep learning model to obtain a first semantic segmentation result containing characteristic point information and a second semantic segmentation result containing glue information; the determining module is used for determining a target characteristic line coordinate sequence according to the first semantic segmentation result and the second template diagram, and determining a target glue width according to the second semantic segmentation result and the target characteristic line coordinate sequence. In a third aspect, the application provides a computer device comprising a memory storing a computer program and a processor implementing the steps of the method described above when the processor executes the computer program. In a fourth aspect, the present application provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the method described above. In a fifth aspect, the application provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the method described above. According to the template matching-based glue width detection method, the template matching-based glue width detection device, the template matching-based glue width detection computer device and the template matching-based glue width detection medium, the template matching calibration and the deep learning semantic segmentation are combined, the template graph is used for establishing the reference features, the deep learning model is used for accurately extracting the semantic segmentation result of the detection graph, and finally the actual glue width is determined based on the semantic segme