A method and device for visually detecting defects in spray glue on soles
Through machine vision detection methods, template matching technology is used to automatically identify the defects of sole spraying, which solves the problems of large dependence and large errors in the prior art, and achieves more efficient and reliable detection results.
Patent Information
- Application Number
- CN202410748501.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2044-06-12
AI Technical Summary
In the prior art, the detection of sole spray defects depends on labor, and there are problems such as high labor costs, large dependence and large errors.
The machine vision detection method is adopted to automatically identify the spray defects of the sole through the production of templates and template matching technology, including the detection of the main gun spray area and the secondary gun spray area.
It achieves more reliable and efficient detection results, reduces manual investment, reduces detection errors, and improves detection accuracy.
Smart Images

Figure CN118334014B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of sole glue spraying detection, and in particular relates to a method and a device for visually detecting defects of sole glue spraying. Background Art
[0002] With the increasing automation of the shoemaking industry, the glue spraying operation of the soles is gradually being replaced by automated equipment instead of the original manual work. When using automated equipment to spray glue on the soles, the glue spraying track is first extracted, and the equipment then sprays glue according to the glue spraying track. In the shoemaking process, the quality of the glue spraying effect is an important factor in determining the quality of the shoes. Therefore, after the glue spraying is completed, the glue spraying effect needs to be tested, and the defective parts need to be sprayed again to ensure that the final shoe quality meets the standards.
[0003] In the prior art, experienced workers quickly inspect the glue-sprayed soles to identify the parts with glue spraying defects, and then process the defective parts again. However, this method is highly dependent on manual labor, has high labor costs, and has large manual inspection errors, making the results unreliable. Summary of the invention
[0004] The purpose of the present invention is to provide a method and device for visual inspection of sole glue spraying defects, which replaces manual inspection with machine vision inspection, and the inspection results are more reliable, the inspection efficiency is higher, and the labor input is smaller.
[0005] The present invention is achieved through the following technical solutions:
[0006] A method for visually inspecting shoe sole glue spraying defects, used for inspecting shoe soles having a main gun spraying area and a secondary gun spraying area, comprises the following steps:
[0007] Step S1, using a glue-sprayed sole without defects to make a template, the template having an initial outer edge contour and an initial inner edge contour, and setting a corresponding detection route according to the glue-spraying route of the area within the inner edge contour;
[0008] Step S2, photographing the sole to be tested from directly above the sole to be tested to obtain a sole image;
[0009] Step S3, scaling the template according to the shoe size of the sole image, performing template matching between the sole image and the scaled template, so as to obtain the actual outer edge contour of the sole image according to the initial outer edge contour of the template, shrinking the actual outer edge contour to obtain the actual inner edge contour, determining the area between the actual outer edge contour and the actual inner edge contour as the main gun spraying area, and determining the area included in the actual inner edge contour as the auxiliary gun spraying area;
[0010] Step S4, calculating the area covered by glue in the main gun spraying area, and comparing the area with the first threshold to determine whether the main gun spraying area is qualified, if not qualified, the number of unqualified is accumulated and saved; for the auxiliary gun spraying area, determining the area covered by glue on the detection route, and comparing the area with the second threshold to determine whether the auxiliary gun spraying area is qualified, if not qualified, the number of unqualified is accumulated and saved;
[0011] Step S5, record the ratio of the glue area in the main gun spraying area to the main gun spraying area area obtained in each detection process, and the matching ratio of glue spraying on the detection road in the auxiliary gun spraying area, and draw the main gun spraying ratio curve and the auxiliary gun spraying ratio curve according to the recorded data respectively.
[0012] Furthermore, the step S1 specifically includes the following steps:
[0013] Step S11, for different shoe styles, respectively select a sole with no defects in glue spraying as a template sole, and photograph the sole from directly above to obtain a template image;
[0014] Step S12, obtaining a rectangular frame covering the entire template sole, and obtaining an initial outer edge contour of the template sole according to a grayscale gradient change of the image within the rectangular frame;
[0015] Step S13, setting an inward shrinkage size parameter according to the shoe style corresponding to the template sole, shrinking the initial outer edge contour according to the inward shrinkage size parameter to obtain an initial inner edge contour;
[0016] Step S14: For the area included in the initial inner edge contour, a detection route that is the same as the glue spraying route is set.
[0017] Furthermore, in step S2, shooting is performed using a shooting device, which includes a workstation, a conveyor line passing through the workstation, a color camera arranged on the top of the workstation, and two ultraviolet lamps arranged on the top of the workstation and hanging downward. The color camera takes a picture when the sole is conveyed by the conveyor line to a shooting point directly below the color camera. The two ultraviolet lamps are arranged along the conveyor line and are located on both sides of the shooting point.
[0018] Furthermore, in step S3, the template matching adopts shape-based matching of the Halcon template, searches the sole image and the scaled template in a high-level pyramid, and then maps them to the bottom layer to obtain the actual outer edge contour of the sole image. During matching, the sole image is rotated, scaled and / or translated so that the sole image and the template almost overlap.
[0019] Furthermore, in step S4, the first threshold range is 0.8-1.0, and the second threshold range is 0.6-0.8.
[0020] Furthermore, in step S4, when calculating the glue coverage area, the sole image is split into three channels, and the blue channel is used as a grayscale image to identify glue coverage. The grayscale area of the spray glue solubility in the grayscale image is the glue coverage area.
[0021] Furthermore, in step S12, if the initial outer edge contour of the template sole is incomplete or exceeds the rectangular frame, the mean filter and dynamic threshold parameters are manually adjusted until the initial outer edge contour is complete and does not exceed the rectangular frame.
[0022] Furthermore, the detection route includes a straight line back and forth, a Z-shaped back and forth, or is obtained by shrinking the actual inner edge contour for multiple circles.
[0023] The present invention is also achieved through the following technical solutions:
[0024] A detection device based on the visual detection method for sole glue spraying defects as described in any one of the above items, comprising a shooting device and a control device, the shooting device comprising a workstation, a conveyor line arranged through the workstation, a color camera arranged on the top of the workstation, and two ultraviolet lamps arranged on the top of the workstation and hanging downward, the control device is connected to the color camera, when the sole is conveyed by the conveyor line to the shooting point directly below the color camera, the control device controls the color camera to shoot, the two ultraviolet lamps are arranged along the conveyor line direction and are located on both sides of the shooting point;
[0025] The control device also includes:
[0026] Template making module: used to make a template using a defect-free sole sprayed with glue, the template has an initial outer edge contour and an initial inner edge contour, and a corresponding detection route is set according to the glue spraying route of the area within the initial inner edge contour;
[0027] Matching module: used to scale the template according to the shoe size of the sole image, perform template matching between the sole image and the scaled template, so as to obtain the actual outer edge contour of the sole image according to the initial outer edge contour of the template, shrink the actual outer edge contour to obtain the actual inner edge contour, determine the area between the actual outer edge contour and the actual inner edge contour as the main gun spraying area, and determine the area contained in the actual inner edge contour as the auxiliary gun spraying area;
[0028] Judgment module: used to calculate the area covered by glue in the main gun spraying area, and judge whether the main gun spraying area is qualified by comparing the area with the first threshold. If it is unqualified, the number of unqualified is accumulated and saved; for the auxiliary gun spraying area, the area covered by glue on the detection route is judged, and the area is compared with the second threshold to judge whether the auxiliary gun spraying area is qualified. If it is unqualified, the number of unqualified is accumulated and saved;
[0029] Recording module: used to record the ratio of the glue area in the main gun spraying area to the main gun spraying area obtained during each detection process, as well as the matching ratio of glue spraying on the detection road in the auxiliary gun spraying area, and draw the main gun spraying ratio curve and the auxiliary gun spraying ratio curve according to the recorded data.
[0030] The present invention has the following beneficial effects:
[0031] 1. The present invention firstly uses the sole with no defects in glue spraying to make a template, and then matches the sole image taken in real time with the template to obtain the main gun spraying area full of glue and the auxiliary gun spraying area sprayed according to a specific route. For the spraying area full of glue, the qualification is determined by comparing the area covered by glue with a set first threshold. For the auxiliary gun spraying area, the qualification is determined by comparing the area covered by glue in the detection route with a set second threshold. In this way, the detection of glue spraying defects is realized, thereby replacing the manual detection in the prior art, greatly reducing the manual input, and the judgment error of machine vision is smaller and the accuracy is higher. , thereby greatly improving the reliability of the judgment results. Compared with manual judgment, the efficiency of machine judgment is also greatly improved; the data of each detection process are recorded, and the main gun spraying ratio curve and the auxiliary gun spraying ratio curve are drawn based on this. The staff can predict the spraying results according to the trend of the curve, so that they can adjust the main gun and spray gun status in time, thereby reducing the lack of glue caused by gun blockage; on the other hand, the real-time sole image is matched with the template to obtain the actual outer edge contour, which can improve the recognition accuracy of the actual outer edge contour. The actual outer edge contour affects the inner edge contour, which can further improve the judgment accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The present invention is further described in detail below with reference to the accompanying drawings.
[0033] Figure 1 It is a flow chart of the present invention.
[0034] Figure 2 Create a schematic diagram for the invention template.
[0035] Figure 3 It is a structural schematic diagram of the shooting device of the present invention.
[0036] Figure 4 This is a schematic diagram for determining the present invention.
[0037] Figure 5 It is a schematic diagram of the main gun spraying ratio curve and the auxiliary gun spraying ratio curve of the present invention.
[0038] Figure 6 It is a schematic diagram of a data report of the present invention.
[0039] Among them: 1. Workstation; 2. Color camera; 3. Ultraviolet light. DETAILED DESCRIPTION
[0040] like Figure 1 As shown, the visual inspection method for sole glue spraying defects is used to inspect the soles having a main gun spraying area and a secondary gun spraying area. The main gun spraying area is located at the edge of the sole and needs to be sprayed with glue as much as possible. The secondary gun spraying area is located inside the main gun spraying area. This area requires glue spraying according to a certain glue spraying route to avoid excessive glue. The specific steps include:
[0041] Step S1, using a glue-sprayed sole without defects to make a template, the template having an initial outer edge contour and an initial inner edge contour, and setting a corresponding detection route according to the glue-spraying route of the area within the initial inner edge contour;
[0042] Specifically, the following steps are included:
[0043] Step S11, for different shoe styles, respectively select a sole with no defects in glue spraying as a template sole, and photograph the sole from directly above to obtain a template image;
[0044] Step S12: Figure 2 As shown, a rectangular frame (blue frame in the figure) covering the entire template sole is manually selected, and the initial outer edge contour of the template sole is obtained according to the grayscale gradient change of the image in the rectangular frame. If the initial outer edge contour of the template sole is incomplete or exceeds the range of the rectangular frame, the mean filter and dynamic threshold parameters are manually adjusted until the initial outer edge contour is complete and does not exceed the range of the rectangular frame. More specifically, the adjustment method is: increase the mean filter value and decrease the dynamic threshold; wherein, adjusting the mean filter and dynamic threshold parameters so that the initial outer edge is complete and does not exceed the rectangular frame is an existing technology;
[0045] Step S13, setting an inward shrinkage size parameter according to the shoe style corresponding to the template sole, shrinking the initial outer edge contour according to the inward shrinkage size parameter to obtain an initial inner edge contour;
[0046] Step S14, for the area included in the initial inner edge contour, set a detection route that is the same as the glue spraying route, the detection route includes a "I"-shaped back and forth, a "Z"-shaped back and forth, or a detection route obtained by shrinking the initial inner edge contour for multiple circles;
[0047] For the soles of different shoe styles, templates need to be made and Figure 2 As shown, the template is stored in a template library;
[0048] Step S2, using a photographing device to photograph the sole to be tested from directly above the sole to be tested to obtain a sole image;
[0049] Specifically, Figure 3As shown, the shooting device includes a workstation 1, a conveyor line arranged through the workstation 1, a color camera 2 arranged on the top of the workstation 1, and two purple light lamps 3 arranged on the top of the workstation 1 and hanging downward. When the sole is conveyed by the conveyor line to the shooting point directly below the color camera 2, the color camera 2 shoots. The two purple light lamps 3 are arranged along the conveyor line direction and located on both sides of the shooting point. The conveyor line continuously conveys, and the shot sole image is detected in real time. A through-beam photoelectric sensor is arranged on the conveyor line to accurately detect whether the sole is located at the shooting point. This part of the structure and the detection process are prior art.
[0050] Step S3, selecting a corresponding template according to the shoe model corresponding to the captured sole image, and scaling the template according to the shoe size of the sole image so that the shoe size of the template is the same as that of the sole image, and then performing template matching between the sole image and the scaled template, so as to obtain the actual outer edge contour of the sole image according to the initial outer edge contour of the template, shrinking the actual outer edge contour according to the shrinking size corresponding to the shoe model (the shrinking size is a known quantity) to obtain the actual inner edge contour, determining the area between the actual outer edge contour and the actual inner edge contour as the main gun spraying area, and determining the area included in the actual inner edge contour as the auxiliary gun spraying area;
[0051] Among them, the template matching adopts the shape-based matching of the Halcon template, searches the sole image and the scaled template in the high-level pyramid, and then maps to the bottom layer to obtain the actual outer edge contour of the sole image. During the matching, the sole image is rotated, scaled and / or translated so that the sole image and the template are almost overlapped;
[0052] Step S4, calculate the area covered by glue in the main gun spraying area, and determine whether the main gun spraying area is qualified by comparing the area with the first threshold. When the area is greater than the first threshold, it is determined to be qualified (OK), otherwise, it is determined to be unqualified (NG). When it is unqualified, the number of unqualified is accumulated and saved; for the auxiliary gun spraying area, determine the area covered by glue on the detection route, and determine whether the auxiliary gun spraying area is qualified by comparing the area with the second threshold. When the area is greater than the second threshold, it is determined to be qualified (OK), otherwise, it is determined to be unqualified (NG). When it is unqualified, the number of unqualified is accumulated and saved; the determination image of this embodiment is as follows Figure 4 As shown; wherein the first threshold value range is set to 0.8-1.0, and the second threshold value range is set to 0.6-0.8;
[0053] More specifically, when calculating the glue coverage area, the sole image is split into three channels, and the blue channel is used as the grayscale image to identify the glue coverage. The grayscale area of the spray glue solubility in the grayscale image is the glue coverage area;
[0054] Step S5, record the ratio of the glue area of the main gun spraying area to the area of the main gun spraying area, and the matching ratio of the glue spraying on the detection road in the auxiliary gun spraying area obtained in each detection process, and draw the main gun spraying matching ratio curve and the auxiliary gun spraying matching ratio curve according to the recorded data, such as Figure 5 As shown, the green line represents the main gun spray matching ratio curve, and the red line represents the auxiliary gun spray matching ratio curve;
[0055] like Figure 6 The data shown is a data report obtained based on the number of stored unqualified products. The staff can accurately understand the inspection situation through the data report.
[0056] The visual inspection device for sole glue spraying defects includes a shooting device and a control device. The shooting device includes a workstation 1, a conveyor line arranged through the workstation 1, a color camera 2 arranged on the top of the workstation 1, and two purple light lamps 3 arranged on the top of the workstation 1 and hanging downward. The control device is connected to the color camera 2. When the sole is conveyed by the conveyor line to the shooting point directly below the color camera 2, the control device controls the color camera 2 to shoot. The two purple light lamps 3 are arranged along the conveyor line direction and are located on both sides of the shooting point.
[0057] The control device also includes:
[0058] Template making module: used to make a template using a defect-free sole sprayed with glue, the template has an initial outer edge contour and an initial inner edge contour, and a corresponding detection route is set according to the glue spraying route of the area within the initial inner edge contour;
[0059] Matching module: used to scale the template according to the shoe size of the sole image, perform template matching between the sole image and the scaled template, so as to obtain the actual outer edge contour of the sole image according to the initial outer edge contour of the template, shrink the actual outer edge contour to obtain the actual inner edge contour, determine the area between the actual outer edge contour and the actual inner edge contour as the main gun spraying area, and determine the area contained in the actual inner edge contour as the auxiliary gun spraying area;
[0060] Judgment module: used to calculate the area covered by glue in the main gun spraying area, and judge whether the main gun spraying area is qualified by comparing the area with the first threshold. If it is unqualified, the number of unqualified is accumulated and saved; for the auxiliary gun spraying area, the area covered by glue on the detection route is judged, and the area is compared with the second threshold to judge whether the auxiliary gun spraying area is qualified. If it is unqualified, the number of unqualified is accumulated and saved;
[0061] Recording module: used to record the ratio of the glue area in the main gun spraying area to the main gun spraying area obtained during each detection process, as well as the matching ratio of glue spraying on the detection road in the auxiliary gun spraying area, and draw the main gun spraying ratio curve and the auxiliary gun spraying ratio curve according to the recorded data.
[0062] In this embodiment, the control device is an industrial computer.
[0063] The above description is only a preferred embodiment of the present invention, and therefore cannot be used to limit the scope of implementation of the present invention. That is, equivalent changes and modifications made according to the scope of the patent application of the present invention and the contents of the specification should still fall within the scope covered by the patent of the present invention.
Claims
1. A method for visually inspecting shoe sole glue spraying defects, used to inspect shoe soles having a main gun spraying area and a secondary gun spraying area, characterized in that: The steps include: Step S1, using a glue-sprayed sole without defects to make a template, the template having an initial outer edge contour and an initial inner edge contour, and setting a corresponding detection route according to the glue-spraying route of the area within the inner edge contour; Step S2, photographing the sole to be tested from directly above the sole to be tested to obtain a sole image; Step S3, scaling the template according to the shoe size of the sole image, performing template matching between the sole image and the scaled template, so as to obtain the actual outer edge contour of the sole image according to the initial outer edge contour of the template, shrinking the actual outer edge contour to obtain the actual inner edge contour, determining the area between the actual outer edge contour and the actual inner edge contour as the main gun spraying area, and determining the area included in the actual inner edge contour as the auxiliary gun spraying area; Step S4, calculating the area covered by glue in the main gun spraying area, and comparing the area with the first threshold to determine whether the main gun spraying area is qualified, if not qualified, the number of unqualified is accumulated and saved; for the auxiliary gun spraying area, determining the area covered by glue on the detection route, and comparing the area with the second threshold to determine whether the auxiliary gun spraying area is qualified, if not qualified, the number of unqualified is accumulated and saved; Step S5, recording the ratio of the glue area of the main gun spraying area to the area of the main gun spraying area, and the matching ratio of the glue spraying on the detection road in the auxiliary gun spraying area obtained in each detection process, and drawing the main gun spraying ratio curve and the auxiliary gun spraying ratio curve according to the recorded data respectively; Step S11, for different shoe styles, respectively select a sole with no defects in glue spraying as a template sole, and photograph the sole from directly above to obtain a template image; Step S12, obtaining a rectangular frame covering the entire template sole, and obtaining an initial outer edge contour of the template sole according to a grayscale gradient change of the image within the rectangular frame; Step S13, setting an inward shrinkage size parameter according to the shoe style corresponding to the template sole, shrinking the initial outer edge contour according to the inward shrinkage size parameter to obtain an initial inner edge contour; Step S14: for the area included in the initial inner edge contour, set a detection route that is the same as the glue spraying route; In step S3, the template matching adopts shape-based matching of Halcon template, searches the sole image and the scaled template in the high-level pyramid, and then maps them to the bottom layer to obtain the actual outer edge contour of the sole image. During matching, the sole image is rotated, scaled and / or translated so that the sole image and the template are almost overlapped; In step S4, when calculating the glue coverage area, the sole image is split into three channels, and the blue channel is used as a grayscale image to identify the glue coverage. The grayscale area of the spray glue solubility in the grayscale image is the glue coverage area.
2. A method for visually detecting defects in spray glue on soles according to claim 1, characterized in that: In step S2, shooting is performed using a shooting device, which includes a workstation, a conveyor line passing through the workstation, a color camera disposed on the top of the workstation, and two ultraviolet lamps disposed on the top of the workstation and hanging downward. The color camera shoots when the sole is conveyed by the conveyor line to a shooting point directly below the color camera. The two ultraviolet lamps are arranged along the conveyor line and are located on both sides of the shooting point.
3. A method for visually detecting defects in spray glue on soles according to claim 1, characterized in that: In step S4, the first threshold range is 0.8-1.0, and the second threshold range is 0.6-0.
8.
4. A method for visually detecting defects in spray glue on soles according to claim 2, characterized in that: In step S12, if the initial outer edge contour of the template sole is incomplete or exceeds the rectangular frame, the mean filter and dynamic threshold parameters are manually adjusted until the initial outer edge contour is complete and does not exceed the rectangular frame.
5. The method for visually detecting adhesive spraying defects on a shoe sole according to claim 1, characterized in that: The detection route includes a "I"-shaped back and forth, a "Z"-shaped back and forth, or is obtained by shrinking the actual inner edge contour for multiple circles.
6. A detection device based on the visual detection method of sole glue spraying defects according to any one of claims 1 to 5, characterized in that: The apparatus comprises a shooting device and a control device. The shooting device comprises a workstation, a conveyor line arranged through the workstation, a color camera arranged on the top of the workstation, and two purple light lamps arranged on the top of the workstation and hanging downward. The control device is connected to the color camera. When the shoe sole is conveyed by the conveyor line to the shooting point directly below the color camera, the control device controls the color camera to shoot. The two purple light lamps are arranged along the conveyor line and located on both sides of the shooting point. The control device also includes: Template making module: used to make a template using a defect-free sole sprayed with glue, the template has an initial outer edge contour and an initial inner edge contour, and a corresponding detection route is set according to the glue spraying route of the area within the initial inner edge contour; Matching module: used to scale the template according to the shoe size of the sole image, perform template matching between the sole image and the scaled template, so as to obtain the actual outer edge contour of the sole image according to the initial outer edge contour of the template, shrink the actual outer edge contour to obtain the actual inner edge contour, determine the area between the actual outer edge contour and the actual inner edge contour as the main gun spraying area, and determine the area contained in the actual inner edge contour as the auxiliary gun spraying area; Judgment module: used to calculate the area covered by glue in the main gun spraying area, and judge whether the main gun spraying area is qualified by comparing the area with the first threshold. If it is unqualified, the number of unqualified is accumulated and saved; for the auxiliary gun spraying area, the area covered by glue on the detection route is judged, and the area is compared with the second threshold to judge whether the auxiliary gun spraying area is qualified. If it is unqualified, the number of unqualified is accumulated and saved; Recording module: used to record the ratio of the glue area in the main gun spraying area to the main gun spraying area obtained during each detection process, as well as the matching ratio of glue spraying on the detection road in the auxiliary gun spraying area, and draw the main gun spraying ratio curve and the auxiliary gun spraying ratio curve according to the recorded data.
Citation Information
Patent Citations
Shoe sole glue spraying system based on 3D scanning and visual deviation correction
CN110710759A
Glue line defect detection method based on machine vision
CN113340909A