Automobile glue coating detection method, device and storage medium
Machine vision technology is used to detect automobile glue coating, using image matching and correction, grayscale processing and three-dimensional reconstruction technology to solve the problem of inaccurate colloid detection in the existing technology and achieve accurate measurement of glue coating width and thickness. Improved detection efficiency and accuracy.
Patent Information
- Application Number
- CN201910920243.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-09-26
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2039-09-26
AI Technical Summary
Existing automobile glue detection methods have the disadvantages of inaccurate colloid detection and inability to estimate colloid thickness. They require complex robot systems and strict positioning requirements, and cannot accurately detect the width and thickness of glue under different lighting conditions.
A detection method based on machine vision is used to match the collected image of the target colloid with the reference image to determine the area where the colloid is located and perform image correction. Grayscale processing and edge detection operators are used to extract the contour of the colloid, combined with SFS three-dimensional reconstruction technology. Accurately measure the width and thickness of colloids.
It achieves accurate detection of automobile glue coating, reduces detection errors, and can accurately obtain colloid width and thickness information under different lighting conditions, improving detection efficiency and accuracy.
Smart Images

Figure CN112561850B
Abstract
Description
Technical Field
[0001] The present application relates to the field of automobile inspection, and in particular to an automobile glue coating inspection method, equipment and storage medium. Background Art
[0002] In the production of vehicles, there are many stations for gluing vehicles. In the manufacturing process of engines, windows, doors and other parts, there is a need for gluing. The gluing with a robot arm is fast and highly automated. After the gluing is completed, visual inspection of the gluing is also very important. However, if manual inspection is performed every time the robot arm gluing, the efficiency will inevitably be greatly reduced. Therefore, the use of machine vision to inspect automotive gluing is becoming more and more widespread.
[0003] The prior art generally uses the gluing quality detection to locate the gluing position and contour at the key points of the robot arm. This method estimates the position of the gluing gun during the shooting according to the motion trajectory points of the robot arm and the command time for sending image acquisition, and then extracts the edge according to the position and edge information to estimate the width of the gluing.
[0004] The second method is to manually select timed sampling points to take glue coating images according to the operation of the glue coating robot, and extract the contour of the colloid based on the existing images to estimate the width of the glue coating.
[0005] Method 1 requires the three-dimensional coordinates of the glue gun of the robot system and converts them to the plane of the target imaging. The development requires deep information fusion with the glue-coating robot, which is complex to integrate and requires a lot of debugging work. When using edge information to extract the colloid, the edge information on other backgrounds on the parts may cause inaccurate colloid width, and the thickness information of the glue coating cannot be obtained.
[0006] Method 2 has strict requirements on the fixed position of the glue-coated parts. The movement of the parts may cause inaccurate colloid detection. In addition, the contour obtained by comparison is easily affected by the inconsistent lighting of different parts during shooting. At the same time, this detection method cannot obtain the thickness information of the colloid. Summary of the invention
[0007] In view of this, one of the technical problems solved by the embodiments of the present application is to provide a method for detecting glue coating based on machine vision, so as to overcome the defects of inaccurate colloid detection and inability to estimate the thickness of the colloid.
[0008] In a first aspect, an embodiment of the present application provides a vehicle glue coating detection method, the method comprising:
[0009] Matching the collected image of the target colloid with the reference image to determine the area where the target colloid is located in the collected image, and obtaining a mask image of the target colloid;
[0010] determining at least one edge of the target colloid according to the mask image;
[0011] determining a contour of a target colloid according to at least one edge of the target colloid;
[0012] The width and / or thickness of the target colloid is determined according to the contour of the target colloid.
[0013] Optionally, in one embodiment of the present application, the method further includes: determining a position offset of the target colloid in the mask image according to the position of the colloid in the reference image, and performing image correction on the mask image according to the position offset.
[0014] Optionally, in one embodiment of the present application, determining at least one edge of the target colloid according to the mask image includes: performing grayscale processing on the corrected mask image to obtain a grayscale image of the target colloid; and performing edge detection on the grayscale image of the target colloid according to at least one edge detection operator to obtain at least one edge.
[0015] Optionally, in one embodiment of the present application, grayscale processing is performed on the mask image to obtain a grayscale image of the target colloid, including: using a watershed algorithm to grayscale process the corrected mask image, and performing region division to obtain a grayscale image of the target colloid.
[0016] Optionally, in one embodiment of the present application, determining the contour of the target colloid according to at least one edge of the target colloid includes: determining a longest edge on both sides of the central axis of the corrected target colloid as two main edges of the target colloid; determining at least one extended edge among the remaining edges according to a preset edge gray value range; and merging the determined two main edges with the at least one extended edge to determine the contour of the target colloid.
[0017] Optionally, in one embodiment of the present application, determining the width and / or thickness of the target colloid according to the determined profile of the target colloid includes:
[0018] According to the principle of SFS three-dimensional reconstruction technology, the three-dimensional information of the corrected target colloid is determined, and the coating thickness of the target colloid is determined.
[0019] In a second aspect, an embodiment of the present application provides a detection device, including: a correction module, an image processing module and a calculation module;
[0020] An image correction module is used to match the collected image of the target colloid with the reference image to determine the area where the target colloid is located in the collected image, and obtain a mask image of the target colloid;
[0021] An image processing module, used to determine at least one edge of the target colloid according to the mask image; and determine the contour of the target colloid according to at least one edge of the target colloid;
[0022] The calculation module is used to determine the width and / or thickness of the target colloid according to the contour of the target colloid.
[0023] Optionally, in one embodiment of the present application, the correction module is further used to determine the position offset of the target colloid in the mask image according to the position of the colloid in the reference image, and perform image correction on the mask image according to the position offset.
[0024] Optionally, in one embodiment of the present application, the image processing module is further used to perform grayscale processing on the mask image to obtain a grayscale image of the target colloid; and perform edge detection on the grayscale image according to at least one edge detection operator to obtain at least one edge.
[0025] Optionally, in one embodiment of the present application, the image processing module is further used to perform grayscale processing on the mask image using a watershed algorithm and perform region division to obtain a grayscale image of the target colloid.
[0026] Optionally, in one embodiment of the present application, the image processing module is further used to determine, in at least one edge, a longest edge on both sides of the central axis of the target colloid as two main edges of the target colloid; determine at least one extended edge in the remaining edges according to a preset edge grayscale range; merge the two main edges with the at least one extended edge, and determine the outline of the target colloid.
[0027] Optionally, in one embodiment of the present application, the calculation module determines the width of the target colloid using the contour of the target colloid, and determines the three-dimensional information of the target colloid according to the principle of SFS three-dimensional reconstruction technology, thereby determining the thickness of the target colloid.
[0028] In a third aspect, an embodiment of the present application provides a storage medium having a computer program stored thereon. When a processor executes the computer program stored on the storage medium, the method described in the first aspect or any one of the embodiments of the first aspect is implemented.
[0029] In the embodiment of the present application, the captured image of the target colloid is matched with the reference image to determine the region where the target colloid is located in the captured image, and a mask image of the target colloid is obtained; at least one edge of the target colloid is determined based on the mask image, and the contour of the target colloid is determined; the width and / or thickness of the target colloid is determined based on the contour of the target colloid. The method of matching between the reference image and the captured image can more accurately determine the region where the target colloid is located, and further obtain the mask image, thereby reducing the interference of the image content outside the region where the target colloid is located on the detection of the target colloid, and the detection of the width and thickness of the target colloid is more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Hereinafter, some specific embodiments of the present application will be described in detail in an exemplary and non-limiting manner with reference to the accompanying drawings. The same reference numerals in the accompanying drawings indicate the same or similar components or parts. It should be understood by those skilled in the art that these drawings are not necessarily drawn to scale. In the accompanying drawings:
[0031] Figure 1 A flow chart of a method for detecting glue coating provided in an embodiment of the present application;
[0032] Figure 2 A schematic diagram of estimating the target colloid thickness provided in an embodiment of the present application;
[0033] Figure 3 A structural diagram of a glue coating detection device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] The specific implementation of the embodiment of the present invention is further described below in conjunction with the accompanying drawings of the embodiment of the present invention.
[0035] Embodiment 1
[0036] Embodiment 1 of the present application provides a method for detecting glue coating, such as Figure 1 As shown, Figure 1 A flow chart of a method for detecting glue coating provided in an embodiment of the present application. The method for detecting glue coating comprises the following steps:
[0037] Step 101, matching the collected image of the target colloid with the reference image to determine the area where the target colloid is located in the collected image, and obtaining a mask image of the target colloid;
[0038] In this application, the term "target" is used in the singular and is not used for any limitation. For example, the target colloid may be any section of the colloid. The region where the target colloid is located may be the region of the colloid in the image; and the reference image may be an image of the colloid with correct glue coating.
[0039] In an application scenario, the image of the target colloid can be captured by fixed-point shooting to obtain the target image of the target colloid. Each shooting point has a reference image with correct glue coating, and there is no need to provide three-dimensional coordinates. The area where the target colloid is located in the captured image can be determined by directly matching the reference image with the captured image.
[0040] Optionally, the glue coating robot arm can be loosely coupled, and any point of the glue coating robot can be selected as a shooting point for fixed-point shooting.
[0041] In an application scenario of the present application, a correctly coated colloid image is used as a reference image, and a target image is masked using the reference image to determine the area of the target colloid in the target image, and a mask image of the target image is obtained.
[0042] Optionally, a certain width margin is extended on both sides of the colloid area in the correctly coated colloid image, and the target image is piecewise linearly masked using the reference image to obtain a mask image of the target image. If the target colloid overflows the mask image, it must be abnormal, and if the target colloid is within the area of the mask image, the target image can be processed according to the area and shape of the mask image.
[0043] Optionally, in one embodiment of the present application, the method further includes: determining a position offset of the target colloid in the mask image according to the position of the colloid in the reference image, and performing image correction on the mask image according to the position offset. After the mask image is corrected according to the position offset, the position of the target colloid in the captured image can correspond to the position of the target colloid in the reference image, and the region where the target colloid is located in the captured image can be determined more accurately.
[0044] Step 102: Determine at least one edge of the target colloid according to the mask image.
[0045] Optionally, in one embodiment of the present application, determining at least one edge of the target colloid according to the mask image includes: performing grayscale processing on the corrected mask image to obtain a grayscale image of the target colloid; and performing edge detection on the grayscale image of the target colloid according to at least one edge detection operator to obtain at least one edge.
[0046] In an application scenario of the present application, the mask image of the target colloid is gray-scaled to obtain a gray-scale image of the target colloid. The gray-scale image can better represent the brightness of the surface of the target colloid and is more conducive to accurately determining the contour of the target colloid.
[0047] When grayscale processing is performed on the mask image of the target colloid, the watershed algorithm can be used to grayscale the corrected mask image step by step using a smaller step size along the linear direction of the target colloid.
[0048] The use of the watershed algorithm can better reduce the impact of uneven illumination and gradual changes in the target image on the detection accuracy caused by the different positions of the target colloid and the different distances from the light source during the target image acquisition process.
[0049] When extracting at least one edge of the target colloid, at least one edge detection operator is used to perform edge detection on the grayscale image of the target colloid to obtain at least one edge.
[0050] Step 103: determining a contour of the target colloid according to at least one edge of the target colloid.
[0051] It should be noted that the contour of the target colloid can be determined according to one edge or two edges of the target colloid. For example, when the position of the target colloid is corrected, one side of the target colloid in the collected image can be aligned with one side of the target colloid in the reference image, then when determining the contour of the target colloid, only the edge of the other side of the target colloid is needed to determine the contour of the target colloid in the collected image. For another example, the contours on both sides of the target colloid can be determined respectively according to the two edges of the target colloid. Of course, this is only an exemplary description, and does not represent that the present application is limited to this.
[0052] Optionally, in one embodiment of the present application, determining the contour of the target colloid according to at least one edge of the target colloid includes: determining a longest edge on both sides of the central axis of the corrected target colloid as two main edges of the target colloid; determining at least one extended edge among the remaining edges according to a preset edge gray value range; and merging the determined two main edges with the at least one extended edge to determine the contour of the target colloid.
[0053] For example, edges of different scales can be obtained using edge detection operators of different sizes; in at least one edge, a longest edge is determined on both sides of the central axis of the colloid region in the target image as the main edge of the target colloid; at least one extended edge is determined in the remaining edges according to a preset edge gray value range; two main edges are merged with at least one extended edge to determine the outline of the target colloid.
[0054] Step 104: Determine the width and / or thickness of the target colloid according to the contour of the target colloid.
[0055] Optionally, in one embodiment of the present application, the three-dimensional information of the target colloid in the mask image may be determined according to the principle of the SFS three-dimensional reconstruction technology, and the thickness of the target colloid may be determined.
[0056] like Figure 2 As shown, Figure 2 A schematic diagram of colloid thickness estimation provided for the implementation of the present application is related to the size of the surface light source and the object distance. The smaller the object distance, the greater the reflection tendency of the surface light source after irradiating the colloid, and the higher the grayscale value in the grayscale image. According to the principle of SFS three-dimensional reconstruction technology, the three-dimensional information of the target colloid can be restored according to the shadow, thereby determining the thickness of the target colloid.
[0057] Embodiment 2
[0058] Based on the glue detection method described in the first embodiment, the present application embodiment provides a glue detection device, such as Figure 3 As shown, Figure 3A detection device provided in an embodiment of the present application includes: an image correction module 301, an image processing module 301 and a calculation module 303;
[0059] The image correction module 301 is used to determine the position offset of the target colloid in the mask image according to the position of the colloid in the reference image, and perform image correction on the mask image according to the position offset.
[0060] The image processing module 302 is used to perform grayscale processing on the corrected mask image, extract the edge of the target colloid, and determine the contour of the target colloid according to at least one edge of the target colloid.
[0061] The calculation module 303 is used to determine the width and / or thickness of the target colloid according to the contour of the colloid.
[0062] Optionally, in one embodiment of the present application, the image processing module 302 is further configured to perform edge detection on the grayscale image according to at least one edge detection operator to obtain at least one edge.
[0063] Optionally, in one embodiment of the present application, the image processing module 302 is further configured to use a watershed algorithm to perform grayscale processing on the mask image and perform region division to obtain a grayscale image of the target colloid.
[0064] Optionally, in one embodiment of the present application, the image processing module 302 is further used to determine, in at least one edge, a longest edge on both sides of the central axis of the target colloid as two main edges of the target colloid; determine at least one extended edge in the remaining edges according to a preset edge grayscale range; merge the two main edges with the at least one extended edge, and determine the outline of the target colloid.
[0065] Optionally, in one embodiment of the present application, the calculation module 303 is further used to determine the width of the target colloid using the contour of the target colloid, and determine the three-dimensional information of the target colloid according to the principle of SFS three-dimensional reconstruction technology, thereby determining the thickness of the target colloid.
[0066] Embodiment 3
[0067] The present application reasonably provides a storage medium on which a computer program is stored. When a processor executes the computer program stored on the storage medium, the method described in the first embodiment is implemented.
[0068] The glue coating detection device of the embodiment of the present application exists in various forms, including but not limited to:
[0069] (1) Mobile communication devices: These devices are characterized by their mobile communication functions and their main purpose is to provide voice and data communications. These terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.
[0070] (2) Ultra-mobile personal computer devices: These devices fall into the category of personal computers, have computing and processing capabilities, and generally also have mobile Internet access features. These terminals include: PDA, MID and UMPC devices, such as iPad.
[0071] (3) Portable entertainment devices: These devices can display and play multimedia content. They include audio and video players (such as iPods), handheld game consoles, e-books, smart toys, and portable car navigation devices.
[0072] (4) Other electronic devices with data interaction functions.
[0073] Thus far, specific embodiments of the subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims may be performed in a different order and still achieve the desired results. Additionally, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing may be advantageous.
[0074] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0075] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0076] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0077] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0078] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0079] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0080] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0081] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0082] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0083] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0084] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0085] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific transactions or implement specific abstract data types. The present application may also be practiced in distributed computing environments where transactions are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0086] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0087] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A vehicle glue coating detection method, characterized in that: include: Matching the collected image of the target colloid with the reference image to determine the area where the target colloid is located in the collected image, and obtaining a mask image of the target colloid; determining at least one edge of the target colloid according to the mask image; determining a contour of the target colloid according to at least one edge of the target colloid; Determining the width and / or thickness of the target colloid according to the profile of the target colloid; Wherein, determining at least one edge of the target colloid according to the mask image includes: determining a position offset of the target colloid in the mask image according to the position of the colloid in the reference image, and performing image correction on the mask image according to the position offset; using a watershed algorithm, along the linear direction of the target colloid, using a preset step size to perform grayscale processing on the corrected mask image step by step to obtain a grayscale image of the target colloid, and performing edge detection on the grayscale image according to at least one edge detection operator to obtain the at least one edge.
2. The method according to claim 1, characterized in that Determining a contour of the target colloid according to at least one edge of the target colloid comprises: Among the at least one edge, a longest edge is respectively determined on both sides of the central axis of the target colloid as two main edges of the target colloid; Determining at least one extended edge from the remaining edges according to a preset edge grayscale range; The two main edges are merged with the at least one extended edge, and the outline of the target colloid is determined.
3. The method according to claim 1, characterized in that Determining the width and / or thickness of the target colloid according to the profile of the target colloid comprises: The three-dimensional information of the target colloid in the mask image is determined according to the SFS three-dimensional reconstruction technology principle, and the thickness of the target colloid is determined.
4. A detection device, characterized in that: include: Image correction module, image processing module, calculation module; The image correction module is used to match the collected image of the target colloid with the reference image to determine the area where the target colloid is located in the collected image, and obtain a mask image of the target colloid; The image processing module is used to determine at least one edge of the target colloid according to the mask image; and determine the contour of the target colloid according to at least one edge of the target colloid; The calculation module is used to determine the width and / or thickness of the target colloid according to the profile of the target colloid; Among them, the image correction module is also used to determine the position offset of the target colloid in the mask image according to the position of the colloid in the reference image, and perform image correction on the mask image according to the position offset; correspondingly, the image processing module is also used to use a watershed algorithm to perform grayscale processing on the corrected mask image step by step along the linear direction of the target colloid using a preset step size to obtain a grayscale image of the target colloid, and perform edge detection on the grayscale image according to at least one edge detection operator to obtain the at least one edge.
5. The device according to claim 4, characterized in that The image processing module is further used to determine, among the at least one edge, a longest edge on both sides of the central axis of the target colloid as two main edges of the target colloid; determine at least one extended edge among the remaining edges according to a preset edge grayscale range; merge the two main edges with the at least one extended edge, and determine the outline of the target colloid.
6. The device according to claim 4, characterized in that The calculation module determines the width of the target colloid using the contour of the target colloid, and determines the three-dimensional information of the target colloid according to the principle of SFS three-dimensional reconstruction technology, thereby determining the thickness of the target colloid.
7. A storage medium, characterized in that: The storage medium stores a computer program, and when the processor executes the computer program stored in the storage medium, the method according to any one of claims 1 to 3 is implemented.
