A method and device for spraying a QR code on a rust-proof bottle cap

By segmenting and meshing the thermal image of the anti-rust bottle cap, controlling the movement speed and flow of the spray gun, the problem of coating slippage during spraying is solved, the balance and consistency of the QR code is achieved, and the recognition rate is improved. .

CN116809345BInactive Publication Date: 2024-12-13ZH NEW SPRING PACKGING & CONTAINER CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202310756123.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-26
Publication Date
2024-12-13
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, when spraying the QR code to the anti-rust bottle cap, the paint slips due to the surface curve and temperature difference, resulting in unbalanced QR code patterns, making it difficult for users to read, reducing the user experience.

Method used

By collecting the thermal image of the anti-rust bottle cap to be sprayed, image segmentation and gridding, determining the time-delay weight coefficient vector, controlling the movement speed and spray gun flow of the QR code spray gun, ensuring uniform spraying of the paint.

Benefits of technology

Effectively prevent the paint from slipping, ensure the balance and consistency of the QR code pattern, and improve the recognition rate of users scanning the QR code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116809345B_ABST
    Figure CN116809345B_ABST
Patent Text Reader

Abstract

The present application provides a method and device for spraying a QR code on an anti-rust bottle cap, firstly collecting a thermal imaging image of the anti-rust bottle cap to be sprayed, then performing image segmentation on the thermal imaging image to obtain a sub-image to be sprayed, and then gridding the sub-image to be sprayed to obtain a grid macroblock set of the sub-image to be sprayed, and determining a time lag weight coefficient vector of the grid macroblock set, obtaining a standard time lag time of a QR code spray gun, and finally determining a time lag coefficient sequence according to the time lag weight coefficient vector and the standard time lag time, and controlling the QR code spray gun to spray the QR code on the anti-rust bottle cap to be sprayed by the time lag coefficient sequence, thereby realizing a method for controlling the movement speed and flow rate of the spray gun when spraying the QR code on the anti-rust bottle cap, preventing the QR code paint from sliding to the lower side of the surface of the anti-rust bottle cap, ensuring the balance and consistency of the QR code pattern, and improving the recognition rate when the user scans the QR code.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of anti-rust bottle cap spraying, and more specifically, to a method and device for spraying a QR code on an anti-rust bottle cap. Background Art

[0002] QR code is a new-age medium for information transmission and interaction. Spraying QR code on rust-proof bottle caps can provide beverage products with unique identification codes, so that each rust-proof bottle cap has a unique logo, helping merchants to trace and manage products, and when recall or quality control is required, it can more accurately locate and track related products and provide information exchange and interaction with consumers.

[0003] In the prior art, a QR code pattern is sprayed onto the surface of the rust-proof bottle cap by a spray gun. The moving speed and flow rate of the spray gun are usually unchanged during spraying. After the rust-proof bottle cap is coated with a thermoplastic anti-rust coating, the surface to be sprayed is a curved surface, and the area where the QR code needs to be sprayed also has a certain temperature difference, which will cause the QR code coating to slide to the lower side of the curved surface to varying degrees, destroying the balance and consistency of the QR code pattern. In severe cases, the QR code pattern may be difficult to read or fail to be read when scanned by a user, greatly reducing the user experience. Summary of the invention

[0004] The present application provides a method and device for spraying a QR code on an anti-rust bottle cap, which can control the movement speed and flow rate of the spray gun when spraying the QR code according to the thermal imaging image of the anti-rust bottle cap to be sprayed, thereby solving the technical problem of the QR code paint sliding to the lower side of the surface of the anti-rust bottle cap, ensuring the balance and consistency of the QR code pattern, and improving the recognition rate when the user scans the QR code.

[0005] In order to solve the above technical problems, this application adopts the following technical solutions:

[0006] In a first aspect, the present application provides a method for spraying a rust-proof bottle cap QR code, comprising the following steps:

[0007] Collect thermal imaging images of bottle caps to be sprayed with anti-rust paint;

[0008] Performing image segmentation on the thermal imaging image to obtain a sub-image to be sprayed;

[0009] Gridding the sub-image to be sprayed to obtain a grid macroblock set of the sub-image to be sprayed;

[0010] Determine the time lag weight coefficient vector of the grid macroblock set, obtain the standard time lag time of the two-dimensional code spray gun, determine the time lag coefficient sequence according to the time lag weight coefficient vector and the standard time lag time, and control the two-dimensional code spray gun to spray the two-dimensional code on the anti-rust bottle cap to be sprayed according to the time lag coefficient sequence.

[0011] In some embodiments, performing image segmentation on the thermal imaging image to obtain a sub-image to be sprayed specifically includes:

[0012] grayscale the thermal imaging image to obtain a grayscale image of the bottle cap;

[0013] Performing background detection on the bottle cap grayscale image to obtain a thermal imaging image of the object;

[0014] Determining bottle cap mark feature points in the thermal imaging image of the object;

[0015] According to the bottle cap mark feature points and the centroid of the object thermal imaging image, the image area to be sprayed in the object thermal imaging image is intercepted to obtain a sub-image to be sprayed.

[0016] In some embodiments, before determining the bottle cap mark feature point in the object thermal imaging image, the method further includes: determining the centroid of the object thermal imaging image.

[0017] In some embodiments, before performing background detection on the bottle cap grayscale image to obtain the object thermal imaging image, the method further includes: performing mean noise filtering preprocessing on the bottle cap grayscale image.

[0018] In some embodiments, gridding the sub-image to be sprayed to obtain a grid macroblock set of the sub-image to be sprayed specifically includes:

[0019] Determining the camera deflection angle of the sub-image to be sprayed;

[0020] According to the camera deflection angle and sub-image feature points of the sub-image to be sprayed, the sub-image to be sprayed is mapped onto a standard bottle cap three-dimensional model to obtain a bottle cap model to be sprayed;

[0021] The bottle cap model to be sprayed is gridded using a preset gridding algorithm to obtain a grid macroblock set.

[0022] In some embodiments, controlling the two-dimensional code spray gun to spray the two-dimensional code on the anti-rust bottle cap to be sprayed according to the time lag coefficient sequence includes:

[0023] Obtain the grid macroblock corresponding to the spraying point of the two-dimensional code spray gun in the grid macroblock set;

[0024] According to the time lag coefficient corresponding to the grid macroblock in the time lag coefficient sequence, the movement speed of the two-dimensional code spray gun and the flow rate value of the spray gun at the spraying point are determined.

[0025] In some embodiments, an infrared camera is used to capture thermal imaging images of the bottle caps to be sprayed with anti-rust paint.

[0026] In a second aspect, the present application provides a device for spraying a two-dimensional code on a rust-proof bottle cap, the device comprising:

[0027] A thermal imaging image acquisition unit, used to acquire thermal imaging images of the bottle caps to be sprayed with anti-rust paint;

[0028] A thermal imaging image preprocessing unit, used for performing image segmentation on the thermal imaging image to obtain a sub-image to be sprayed;

[0029] A gridding unit for a sub-image to be sprayed, used for gridding the sub-image to be sprayed to obtain a grid macroblock set of the sub-image to be sprayed;

[0030] A two-dimensional code spraying control unit is used to determine the time delay weight coefficient vector of the grid macroblock set, obtain the standard time delay time of the two-dimensional code spray gun, determine the time delay coefficient sequence according to the time delay weight coefficient vector and the standard time delay time, and control the two-dimensional code spray gun to spray the two-dimensional code on the anti-rust bottle cap to be sprayed according to the time delay coefficient sequence.

[0031] In a third aspect, the present application provides a computer device, comprising a memory and a processor, wherein the memory stores a code, and the processor is configured to obtain the code and execute the above-mentioned method for spraying a QR code on an anti-rust bottle cap.

[0032] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned method for spraying a QR code on an anti-rust bottle cap is implemented.

[0033] The technical solution provided by the embodiments disclosed in this application has the following beneficial effects:

[0034] In the method and device for spraying QR codes on anti-rust bottle caps provided in the present application, a thermal imaging image of the anti-rust bottle cap to be sprayed is first collected, and then the thermal imaging image is segmented to obtain a sub-image to be sprayed, and then the sub-image to be sprayed is gridded to obtain a grid macroblock set of the sub-image to be sprayed, and the time lag weight coefficient vector of the grid macroblock set is determined to obtain the standard time lag time of the QR code spray gun, and finally the time lag coefficient sequence is determined according to the time lag weight coefficient vector and the standard time lag time, and the time lag coefficient sequence is used to control the QR code spray gun to spray the anti-rust bottle cap to be sprayed with the QR code, so that the spray gun movement speed and spray gun flow rate during QR code spraying can be controlled to prevent the QR code paint from sliding to the low side of the surface of the anti-rust bottle cap, thereby ensuring the balance and consistency of the QR code pattern and improving the recognition rate when the user scans the QR code. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1is an exemplary flow chart of a method for spraying a rust-proof bottle cap QR code according to some embodiments of the present application;

[0036] Figure 2 It is a schematic diagram of exemplary hardware and / or software of a spraying device for a rust-proof bottle cap QR code according to some embodiments of the present application;

[0037] Figure 3 It is a structural schematic diagram of a computer device for implementing a method for spraying a QR code on a rust-proof bottle cap according to some embodiments of the present application. DETAILED DESCRIPTION

[0038] The core of this application is to first collect the thermal imaging image of the anti-rust bottle cap to be sprayed, then perform image segmentation on the thermal imaging image to obtain the sub-image to be sprayed, and then grid the sub-image to be sprayed to obtain the grid macroblock set of the sub-image to be sprayed, and determine the time lag weight coefficient vector of the grid macroblock set, obtain the standard time lag time of the QR code spray gun, and finally determine the time lag coefficient sequence according to the time lag weight coefficient vector and the standard time lag time, and control the QR code spray gun to spray the anti-rust bottle cap to be sprayed with the time lag coefficient sequence, thereby realizing a method for spraying the QR code of the anti-rust bottle cap that can control the movement speed and flow rate of the spray gun during the QR code spraying, preventing the QR code paint from sliding to the low side of the surface of the anti-rust bottle cap, ensuring the balance and consistency of the QR code pattern, and improving the recognition rate when the user scans the QR code.

[0039] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods. Figure 1 , which is an exemplary flow chart of a method for spraying a rust-proof bottle cap QR code according to some embodiments of the present application. The rust-proof bottle cap QR code spraying method 100 mainly includes the following steps:

[0040] In step S101, a thermal imaging image of a bottle cap to be sprayed with anti-rust paint is collected.

[0041] In some embodiments, an infrared camera can be used to capture thermal imaging images of the bottle caps to be sprayed with anti-rust paint. It should be noted that the infrared camera can be an infrared thermal imaging camera that can sense and capture infrared radiation from the bottle caps to be sprayed with anti-rust paint. In other embodiments, the device for capturing thermal imaging images of the bottle caps to be sprayed with anti-rust paint can also be other devices that can realize thermal imaging image capture, which is not limited here.

[0042] It should be noted that the infrared camera can be mounted on the spray gun of the infrared camera, or it can be mounted directly above the preset workpiece processing position where the anti-rust bottle cap to be sprayed arrives at the transport line. There is no limitation here. In some embodiments, the thermal imaging image is a surface infrared radiation image of the side of the anti-rust bottle cap to be sprayed (usually the upper surface of the anti-rust bottle cap).

[0043] In step S102, the thermal imaging image is segmented to obtain a sub-image to be sprayed.

[0044] It should be noted that the thermal imaging image contains the object part of the anti-rust bottle cap to be sprayed and the background part. Therefore, the thermal imaging image needs to be preprocessed to obtain a partial thermal imaging image (sub-image to be sprayed) containing only the area to be sprayed of the anti-rust bottle cap.

[0045] In some embodiments, the thermal imaging image is segmented to obtain the sub-image to be sprayed in the following manner, namely:

[0046] grayscale the thermal imaging image to obtain a grayscale image of the bottle cap;

[0047] Performing background detection on the grayscale image of the bottle cap to obtain a thermal imaging image of the object;

[0048] Determining bottle cap mark feature points in the thermal imaging image of the object;

[0049] Intercepting the image area to be sprayed in the thermal imaging image of the object according to the characteristic points of the bottle cap mark to obtain a sub-image to be sprayed;

[0050] In specific implementation, the thermal imaging image can be grayed out using existing technology. For example, the RGB (Red, Green, Blue - three primary colors) original value of each pixel in the image can be obtained based on the thermal imaging image. The original value represents the temperature at the pixel. Then, the average value of the RGB original value of one of the pixels is taken and mapped to a grayscale range of 0 to 255 to obtain a grayscale value. The grayscale value is used as the grayscale of the pixel, thereby obtaining a grayscale image pixel to replace the original pixel. The above steps are repeated for each pixel in the thermal imaging image to obtain a grayscale image of the bottle cap.

[0051] It should be noted that in some embodiments of the present application, background detection is performed on the bottle cap grayscale image, and mean noise filtering preprocessing may be performed on the bottle cap grayscale image before obtaining the object thermal imaging image, which will not be repeated here.

[0052] In a specific implementation, the pixels surrounding the target pixel in the grayscale image of the bottle cap can be used as a noise filtering template, and the grayscale average value of the pixels in the noise filtering template is used to update the grayscale of the target pixel. The target pixel is continuously selected in the grayscale image of the bottle cap and the above steps are repeated until the grayscales of all pixels in the grayscale image of the bottle cap are replaced, thereby realizing mean filtering preprocessing of the image, improving the smoothness of the grayscale image of the bottle cap and filtering out possible discrete noise in the image, so as to facilitate subsequent background detection of the grayscale image of the bottle cap.

[0053] In some embodiments, background detection is performed on the grayscale image of the bottle caps to obtain the thermal imaging image of the object in the following manner, namely, after binarizing the grayscale image of the bottle caps, edge detection is performed on the binarized image using the most widely used Sobel edge detection operator, thereby separating the background area and the object area in the bottle cap image, and then segmenting the thermal imaging image of the bottle caps to be sprayed with anti-rust paint according to the background area and the object area to obtain the thermal imaging image of the object.

[0054] In the specific implementation, first, the image is binarized. Threshold processing or other binarization methods can be used to divide the background and object in the image into two different pixel values, and the image is converted into a binary image containing only two grayscale values ​​of 0 and 255. Then, the Sobel operator is applied to calculate the grayscale value change around the pixel point, and an appropriate threshold is set according to the calculation result of the Sobel operator to extract the edge. Pixels exceeding the threshold will be regarded as edges and can be set to a specific pixel value, while pixels below the threshold can be set to another value, thereby determining the image edge position in the binary image. The edge position usually represents the boundary between the anti-rust bottle cap to be sprayed and the image background. Therefore, the thermal imaging image of the anti-rust bottle cap to be sprayed can be segmented according to the image edge position to separate the background area and the anti-rust bottle cap object area, and the partial thermal imaging image of the anti-rust bottle cap object area captured is the object thermal imaging image.

[0055] It should be noted that the bottle cap marking feature points are unique and distinguishing feature points preset on the bottle cap model, usually more than one in number, which are used to realize the positioning of the bottle cap image or the calibration of the camera. In some embodiments, the nearest neighbor matching algorithm can be used to match the feature points in the thermal imaging image of the object with the preset feature points in the standard bottle cap photo, so as to find the marking feature points. In other embodiments, since the surface of the bottle cap is approximately circular, the thermal imaging image of the object obtained after camera offset and distortion is usually an ellipse with a small difference between the major and minor axes. Therefore, the minimum circumscribed rectangle of the thermal imaging image of the object can also be directly found through the commonly used image recognition algorithm, and all the intersection points of the minimum circumscribed rectangle and the thermal imaging image of the object are used as the marking feature points.

[0056] In addition, in some embodiments of the present application, before determining the bottle cap mark feature points in the thermal imaging image of the object, it is also necessary to first determine the centroid of the thermal imaging image of the object, which will not be repeated here.

[0057] It should be noted that the centroid of the object thermal imaging image is the pixel position of the center point of the rust-proof bottle cap in the object thermal imaging image. In specific implementation, the centroid of the object thermal imaging image can be determined by the following formula, namely:

[0058]

[0059] Among them, p o is the coordinate value of the centroid in the object’s thermal imaging image, x o is the horizontal coordinate of the centroid in the object thermal imaging image, y o is the ordinate of the centroid in the object thermal imaging image, k is the intermediate variable of the summation, n is the number of pixels in the object thermal imaging image, p kx is the horizontal coordinate of the kth pixel in the thermal imaging image of the object, p ky is the ordinate of the kth pixel in the thermal imaging image of the object. It should be noted that the kth pixel is based on the row arrangement order of the pixels in the thermal imaging image of the object.

[0060] After determining the centroid of the thermal imaging image of the object, the image area in the thermal imaging image of the object that needs to be sprayed with the two-dimensional code can be intercepted according to the characteristic points of the bottle cap mark to obtain the sub-image to be sprayed. In specific implementation, the thermal imaging image of the object can be partially intercepted in combination with the spraying area required by the two-dimensional code to obtain the sub-image to be sprayed. For example, a rectangle centered on the centroid can be intercepted as the sub-image to be sprayed, and the length and width of the rectangle are respectively half of the maximum horizontal coordinate difference and the maximum vertical coordinate difference in the characteristic points of the mark of the thermal imaging image of the object.

[0061] In step S103, the sub-image to be sprayed is gridded to obtain a grid macroblock set of the sub-image to be sprayed.

[0062] It should be noted that since the surface of the anti-rust bottle cap to be sprayed is irregular, it is easy to cause uneven paint thickness during spraying, resulting in the sprayed QR code paint sliding sideways to the lower anti-rust bottle cap surface before solidification, and then causing the sprayed QR code to be distorted in shape and unable to be recognized. Therefore, it is necessary to grid the sub-image to be sprayed to obtain a gridded image composed of locally regular grid macroblocks, so as to complete the QR code spraying according to the locally approximate anti-rust bottle cap surface conditions.

[0063] In some embodiments, the sub-image to be sprayed is gridded to obtain a grid macroblock set of the sub-image to be sprayed in the following manner, namely:

[0064] Determining the camera deflection angle of the sub-image to be sprayed;

[0065] According to the camera deflection angle and sub-image feature points of the sub-image to be sprayed, the sub-image to be sprayed is mapped onto a standard bottle cap three-dimensional model to obtain a bottle cap model to be sprayed;

[0066] The bottle cap model to be sprayed is gridded using a preset gridding algorithm to obtain a grid macroblock set.

[0067] It should be noted that the camera deflection angle is the angle between the central axis of the photographed anti-rust bottle cap workpiece and the central axis of the camera when the infrared camera is shooting. In some embodiments of the present application, a method for facilitating the acquisition of the camera deflection angle of the sub-image to be sprayed is provided, that is, due to the angle between the central axis of the anti-rust bottle cap workpiece and the central axis of the camera when the camera is shooting, the camera photo will be deflected. The larger the deflection angle is, the greater the area shrinkage will be relative to the photo taken without the deflection angle. The anti-rust bottle cap object itself and the area to be sprayed are both simple geometric shapes. Therefore, the ratio between the area of ​​the sub-image to be sprayed and the area of ​​the QR code actually required to be sprayed can be calculated first, and then the camera deflection angle can be determined according to the ratio between the two. In other embodiments, the camera deflection angle can also be determined by the following formula, that is:

[0068]

[0069] in, is the camera deflection angle, k is the distance correction coefficient, λ1 and λ2 are the calibration weight coefficients, the sum of the weight coefficients is one, S z is the area of ​​the sub-image to be sprayed, S e is the area of ​​the QR code to be sprayed, S J is the area of ​​the maximum circumscribed rectangle of the object’s thermal imaging image, S p is the surface area of ​​the anti-rust bottle cap to be sprayed, and π is the natural pi.

[0070] The distance correction coefficient is used to correct the image scaling caused by the distance between the camera and the anti-rust bottle cap to be sprayed, and is related to the distance between the lens and the surface of the anti-rust bottle cap to be sprayed when the thermal imaging image is taken. In specific implementation, when the thermal imaging image is taken, the farther the distance between the lens and the surface of the anti-rust bottle cap to be sprayed, the greater the distance correction coefficient.

[0071] It should be noted that since the sub-image to be sprayed is a two-dimensional image of the area image that needs to be sprayed with a two-dimensional code captured in the thermal imaging image, it is necessary to determine the sub-image feature points of the sub-image to be sprayed, and match the feature points of all the sub-image feature points with the corresponding two-dimensional code area in the three-dimensional model of the standard bottle cap. By matching the feature points, the correspondence between the bottle cap surface image and the three-dimensional model of the standard bottle cap is found, and then the three-dimensional bottle cap model to be sprayed corresponding to the sub-image to be sprayed is determined according to the matched feature points. It should be noted that the sub-image feature points can be local features in the sub-image to be sprayed that are unique and distinguishable, such as corner points, edges, etc.

[0072] In a specific implementation, the edge points in the sub-image to be sprayed can be extracted as sub-image feature points and feature descriptors can be formed by using a scale-invariant feature transform (SIFT) algorithm commonly used in feature extraction, and then the feature descriptors can be compared with the feature descriptors of each point in the standard three-dimensional bottle cap model. For example, when the feature descriptors are in vector form, the length difference between the vectors is used as the distance between the two feature descriptors, and based on the distance between the feature descriptors, the nearest neighbor feature point of each feature point is used as a matching point to obtain a matching relationship between the sub-image feature points of the sub-image to be sprayed and the feature points in the standard three-dimensional bottle cap model. Then, according to the matching relationship between the feature points and the camera deflection angle, the camera can be calibrated by the Zhang Zhengyou calibration method, and then the coordinates of the pixel points of the sub-image to be sprayed are mapped to the world coordinate system of the standard three-dimensional bottle cap model, thereby realizing the transformation between the sub-image to be sprayed and the three-dimensional bottle cap model to be sprayed, and obtaining the bottle cap model to be sprayed.

[0073] The three-dimensional bottle cap model to be sprayed includes a series of pixel points located in the surface area of ​​the anti-rust bottle cap to be sprayed and point cloud data composed of the normal vector corresponding to each pixel point. In some embodiments, the Delaunay triangulation algorithm commonly used in gridding can be used as the preset gridding algorithm to divide all points in the bottle cap model to be sprayed into a series of adjacent triangular mesh macroblocks, so as to obtain the grid macroblock set of the sub-image to be sprayed, wherein all pixel points in each triangular mesh macroblock constitute the point set of the triangular mesh macroblock, and the normal vector corresponding to all pixel points in the point set, the normal vector with the smallest absolute value of the dot product with the camera center axis direction vector is used as the normal vector of the triangular mesh macroblock, and finally the set composed of all triangular mesh macroblocks is used as the grid macroblock set. In other embodiments, other gridding algorithms or image processing algorithms can also be used to perform other types of gridding on the bottle cap model to be sprayed, for example, all points in the bottle cap model to be sprayed are divided into a series of adjacent hexagonal mesh macroblocks to obtain a grid macroblock set.

[0074] It should be noted that the grid macroblock set is a set composed of grid macroblocks, and the grid macroblock can be a square or a triangle. In essence, it is a point set composed of pixel points in the sub-image to be sprayed, and the pixel points in the same point set have the same normal vector as the grid macroblock, so as to facilitate similar spraying treatment on the area on the surface of the anti-rust bottle cap where the curvature does not change much.

[0075] In some embodiments, before collecting the thermal imaging image of the anti-rust bottle cap to be sprayed, the anti-rust bottle cap can be scanned using professional equipment such as a 3D scanner or a structured light scanner, so as to quickly obtain the geometric shape and texture information of the object surface and generate a high-precision 3D model of the standard bottle cap. Then, the point cloud data of the surface of the anti-rust bottle cap is obtained based on the 3D model of the standard bottle cap, and the point cloud data of the standard bottle cap 3D model and the surface of the anti-rust bottle cap to be sprayed are pre-stored in a computer to facilitate the subsequent comparison and mapping of feature points of the sub-image to be sprayed and the 3D model of the standard bottle cap.

[0076] In step S104, the time lag weight coefficient vector of the grid macroblock set is determined, the standard time lag time of the QR code spray gun is obtained, the time lag coefficient sequence is determined according to the time lag weight coefficient vector and the standard time lag time, and the QR code spray gun is controlled according to the time lag coefficient sequence to perform QR code spraying on the anti-rust bottle cap to be sprayed.

[0077] It should be noted that the time-delay weight coefficient represents the weight occupied by the spraying time required by the corresponding grid macroblock set. For example, when the normal vector of the grid macroblock where the spraying point is located is greatly offset from the paint spraying direction of the spray gun, or the temperature at the spraying point is high, making it difficult for the paint to solidify quickly, it is necessary to adjust the spraying time of the QR code spray gun at the spraying point to have a greater weight. In specific implementation, the moving speed of the QR code spray gun can be adjusted to control the time the spray gun stays at the spraying point, thereby ensuring that a more consistent QR code pattern is obtained at this point.

[0078] The time lag weight coefficient vector includes multiple time lag weight coefficients. In some embodiments, the time lag weight coefficient has a one-to-one correspondence with each grid macroblock in the grid macroblock set, that is, each grid macroblock in the grid macroblock set can find a unique corresponding time lag weight coefficient in the time lag weight coefficient vector. For example, the first grid macroblock corresponds to the first time lag weight coefficient in the time lag weight coefficient vector. In specific implementation, the time lag weight coefficient in the time lag weight coefficient vector can be determined by the following formula, that is:

[0079]

[0080] Among them, δ n is the time lag weight coefficient corresponding to the nth grid macroblock in the grid macroblock set, is the normal vector of the nth grid macroblock, is a unit vector, is the direction vector of the camera axis, k is the number of pixels in the nth grid macroblock, ρ m is the gray value of the mth pixel in the normal vector of the nth grid macroblock, and m is the intermediate variable for summation.

[0081] The time lag weight coefficient corresponding to each grid macroblock in the grid macroblock set is obtained according to the above formula, and the time lag weight coefficient corresponding to each grid macroblock is used as a vector element to form a time lag weight coefficient vector, and then the time lag coefficient sequence can be obtained according to the time lag weight coefficient vector.

[0082] In some embodiments, the standard lag time of the two-dimensional code spray gun is preset according to the required coating thickness, and the standard lag time is used to perform a weighted operation with the lag weight coefficient. The lag coefficient sequence can be obtained by performing a weighted operation on the standard lag time of the two-dimensional code spray gun by the lag weight coefficient vector. In specific implementation, the lag coefficient sequence can also be determined by the following formula:

[0083] A=T0·B

[0084] Among them, A is the lag coefficient sequence, T0 is the standard lag time, and B is the lag weight coefficient vector.

[0085] It should be noted that the time lag coefficient sequence is obtained by multiplying the time lag weight coefficient vector by the standard time lag time point of the two-dimensional code spray gun. The time lag coefficient sequence is composed of multiple time lag coefficients and has the same dimension as the time lag weight coefficient vector. Therefore, the time lag coefficient sequence and each grid macroblock in the grid macroblock set also have a one-to-one correspondence, that is, each grid macroblock in the grid macroblock set can find a unique corresponding time lag coefficient in the time lag coefficient sequence, and then when the two-dimensional code spray gun is spraying the anti-rust bottle cap to be sprayed with a two-dimensional code, the spray gun movement speed and spray gun flow rate can be controlled according to the time lag coefficient corresponding to the grid macroblock where the current spray gun is spraying.

[0086] Preferably, in some embodiments, the following method can be adopted to control the two-dimensional code spray gun to spray the two-dimensional code on the anti-rust bottle cap to be sprayed according to the time lag coefficient sequence, namely:

[0087] Obtain the grid macroblock corresponding to the spraying point of the two-dimensional code spray gun in the grid macroblock set;

[0088] According to the time lag coefficient corresponding to the grid macroblock, the movement speed of the two-dimensional code spray gun and the spray gun flow value at the spraying point are determined.

[0089] It should be noted that a QR code spray gun is a device specially used for spraying QR codes on anti-rust bottle caps. It is usually composed of a nozzle and a paint supply system. It has high-speed spraying capability and precise spraying control to ensure the clarity and readability of the QR code pattern, and is used to quickly and automatically spray QR codes on large quantities of anti-rust bottle caps. However, when the QR code spray gun uses a fixed moving speed and spray gun flow value to spray the anti-rust bottle caps, the surface temperature of the anti-rust bottle caps is uneven after the thermoplasticization is completed, and there is a certain degree of curvature on the surface. Therefore, the QR code paint is prone to sideways sliding to the lower curved surface when it is not solidified, causing distortion of the QR code surface. Therefore, it is necessary to control the spray gun movement speed and spray gun flow value of the QR code spray gun according to the surface temperature of the spraying point and the corresponding gridded normal vector at the point, so as to ensure the consistency and integrity of the formed QR code pattern.

[0090] The spraying point is the point on the surface of the anti-rust bottle cap to be sprayed that the nozzle of the QR code spray gun is facing when the spray gun is working. The point has a corresponding pixel point in the thermal imaging image taken by the infrared camera, and the grayscale of the pixel point is positively correlated with the temperature at the point. It should be noted that since the sub-image to be sprayed is obtained by intercepting the surface area of ​​the anti-rust bottle cap that needs to be sprayed in the thermal imaging image, the spraying point of the QR code spray gun also has corresponding pixel point coordinates in the sub-image to be sprayed. The pixel point coordinates are then mapped to the world coordinate system of the bottle cap model to be sprayed, thereby determining the grid macroblock where the pixel point is located, and then obtaining the corresponding time lag coefficient based on the grid macroblock. The time lag coefficient is used to control the movement speed of the QR code spray gun at the spraying point and the spray gun flow value.

[0091] Preferably, in some embodiments, for example, when the spraying point is located at the first grid macroblock in the grid macroblock set, the spray gun moving speed can be determined by the following formula:

[0092]

[0093] Where V is the moving speed of the spray gun, a1 is the first time lag coefficient in the time lag coefficient sequence corresponding to the first grid macroblock set, x is a pre-calibrated unit distance value used to obtain the speed dimension, c is the number of pixels in the sub-image to be sprayed, ρ n is the gray value of the nth pixel in the sub-image to be sprayed.

[0094] In some embodiments, when the movement speed of the two-dimensional code spray gun is reduced, in order to ensure the uniformity of the coating on the two-dimensional code pattern, it is necessary to control the spray gun flow value of the two-dimensional code spray gun at the same time. In specific implementation, the spray gun flow value can be determined by the following formula:

[0095]

[0096] Among them, ε is the flow value of the spray gun, a1 is the first time lag coefficient corresponding to the first grid macroblock set in the time lag coefficient sequence, ε0 is the maximum flow value reached when the two-dimensional code spray gun is working, c is the number of pixels in the sub-image to be sprayed, ρ n is the gray value of the nth pixel in the sub-image to be sprayed.

[0097] It should be noted that, unless otherwise specified, the nth pixel point or the first grid macroblock set appearing in this application is based on the row arrangement order in the image in which it is located. In addition, in the specific implementation, the spray gun movement speed and spray gun flow value of the two-dimensional code spray gun can be adjusted in a variety of ways. The mechanical structure of the spray gun can be used to control it, or the control signal can be received through a programmable logic control chip to control the spray gun movement speed of the two-dimensional code spray gun. In addition, the opening of the paint flow valve in the two-dimensional code spray gun can also be controlled to control the spray gun flow value of the two-dimensional code spray gun, which will not be elaborated here.

[0098] In addition, in another aspect of the present application, in some embodiments, the present application provides a spraying device for a rust-proof bottle cap QR code, referring to Figure 2 , which is a schematic diagram of exemplary hardware and / or software of a spraying device for a rust-proof bottle cap QR code according to some embodiments of the present application. The spraying device 200 for a rust-proof bottle cap QR code includes: a thermal imaging image acquisition unit 201, a thermal imaging image preprocessing unit 202, a gridding unit 203 for a sub-image to be sprayed, and a QR code spraying control unit 204, which are respectively described as follows:

[0099] Thermal imaging image acquisition unit 201, in the present application, the thermal imaging image acquisition unit 201 is mainly used to acquire thermal imaging images of the bottle cap to be sprayed with anti-rust paint;

[0100] The thermal imaging image preprocessing unit 202, in the present application, is mainly used to segment the thermal imaging image to obtain a sub-image to be sprayed;

[0101] The gridding unit 203 of the sub-image to be sprayed is mainly used to grid the sub-image to be sprayed to obtain a grid macroblock set of the sub-image to be sprayed;

[0102] The QR code spraying control unit 204 in the present application is mainly used to determine the time delay weight coefficient vector of the grid macroblock set, obtain the standard time delay time of the QR code spray gun, determine the time delay coefficient sequence according to the time delay weight coefficient vector and the standard time delay time, and control the QR code spray gun to perform QR code spraying on the anti-rust bottle cap to be sprayed according to the time delay coefficient sequence.

[0103] In addition, the present application also provides a computer device, which includes a memory and a processor, the memory stores a code, and the processor is configured to obtain the code and execute the above-mentioned method for spraying the anti-rust bottle cap QR code.

[0104] In some embodiments, reference Figure 3 , which is a schematic diagram of the structure of a computer device according to some embodiments of the present application using a spraying method for a rust-proof bottle cap QR code. The spraying method for a rust-proof bottle cap QR code in the above embodiment can be performed by Figure 3 The computer device shown in the figure is implemented, and the computer device includes at least one processor 301, a communication bus 302, a memory 303 and at least one communication interface 304.

[0105] The processor 301 can be a general-purpose central processing unit (CPU), an application-specific integrated circuit (ASIC) or one or more for controlling the execution of the spraying method of the anti-rust bottle cap QR code in the present application.

[0106] Communication bus 302 may include a pathway for transmitting information between the above-mentioned components.

[0107] The memory 303 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a disk or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 303 may exist independently and be connected to the processor 301 via the communication bus 302. The memory 303 may also be integrated with the processor 301.

[0108] The memory 303 is used to store the program code for executing the solution of the present application, and the execution is controlled by the processor 301. The processor 301 is used to execute the program code stored in the memory 303. The program code may include one or more software modules. The determination of the lag weight coefficient in the above embodiment can be implemented by the processor 301 and one or more software modules in the program code in the memory 303.

[0109] The communication interface 304 uses any transceiver or other device for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc.

[0110] In a specific implementation, as an embodiment, a computer device may include multiple processors, each of which may be a single-CPU processor or a multi-CPU processor. The processor here may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0111] The above-mentioned computer device can be a general-purpose computer device or a special-purpose computer device. In a specific implementation, the computer device can be a desktop computer, a portable computer, a network server, a personal digital assistant (PDA), a mobile phone, a tablet computer, a wireless terminal device, a communication device or an embedded device. The embodiment of the present application does not limit the type of computer device.

[0112] In addition, the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned method for spraying the anti-rust bottle cap QR code is implemented.

[0113] In summary, in the method and device for spraying QR codes on rust-proof bottle caps disclosed in the embodiments of the present application, a thermal imaging image of the rust-proof bottle cap to be sprayed is first collected, and then the thermal imaging image is segmented to obtain a sub-image to be sprayed, and then the sub-image to be sprayed is gridded to obtain a grid macroblock set of the sub-image to be sprayed, and the time lag weight coefficient vector of the grid macroblock set is determined to obtain the standard time lag time of the QR code spray gun, and finally the time lag coefficient sequence is determined according to the time lag weight coefficient vector and the standard time lag time, and the time lag coefficient sequence is used to control the QR code spray gun to spray the rust-proof bottle cap to be sprayed. A method for spraying QR codes on rust-proof bottle caps that can control the movement speed and flow rate of the spray gun during QR code spraying is realized, thereby preventing the QR code paint from sliding toward the low side of the surface of the rust-proof bottle cap, ensuring the balance and consistency of the QR code pattern, and improving the recognition rate when the user scans the QR code.

[0114] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0115] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for spraying a two-dimensional code on a rust-proof bottle cap, characterized in that: include: Collecting a thermal imaging image of the anti-rust bottle cap to be sprayed, wherein the thermal imaging image is a surface infrared radiation image of the side of the anti-rust bottle cap to be sprayed; Performing image segmentation on the thermal imaging image to obtain a sub-image to be sprayed; Gridding the sub-image to be sprayed to obtain a grid macroblock set of the sub-image to be sprayed; Determine the time lag weight coefficient vector of the grid macroblock set, obtain the standard time lag time of the two-dimensional code spray gun, determine the time lag coefficient sequence according to the time lag weight coefficient vector and the standard time lag time, and control the two-dimensional code spray gun to spray the two-dimensional code on the anti-rust bottle cap to be sprayed according to the time lag coefficient sequence; The time-delay weight coefficient is the weight occupied by the spraying time required by the corresponding grid macroblock set; the time-delay weight coefficient is determined by the following formula, namely: Among them, δ n is the time lag weight coefficient corresponding to the nth grid macroblock in the grid macroblock set, is the normal vector of the nth grid macroblock, is a unit vector, is the direction vector of the camera axis, k is the number of pixels in the nth grid macroblock, ρ m is the gray value of the mth pixel in the normal vector of the nth grid macroblock, and m is the intermediate variable for summation.

2. The method according to claim 1, characterized in that Performing image segmentation on the thermal imaging image to obtain a sub-image to be sprayed specifically includes: grayscale the thermal imaging image to obtain a grayscale image of the bottle cap; Performing background detection on the bottle cap grayscale image to obtain a thermal imaging image of the object; Determining bottle cap mark feature points in the thermal imaging image of the object; According to the bottle cap mark feature points and the centroid of the object thermal imaging image, the image area to be sprayed in the object thermal imaging image is intercepted to obtain a sub-image to be sprayed.

3. The method according to claim 2, characterized in that Before determining the bottle cap mark feature point in the object thermal imaging image, the method further includes: determining the centroid of the object thermal imaging image.

4. The method according to claim 1, characterized in that Before performing background detection on the bottle cap grayscale image to obtain the object thermal imaging image, the method further includes: performing mean noise filtering preprocessing on the bottle cap grayscale image.

5. The method according to claim 1, characterized in that Meshing the sub-image to be sprayed to obtain a grid macroblock set of the sub-image to be sprayed specifically includes: Determining the camera deflection angle of the sub-image to be sprayed; According to the camera deflection angle and sub-image feature points of the sub-image to be sprayed, the sub-image to be sprayed is mapped onto a standard bottle cap three-dimensional model to obtain a bottle cap model to be sprayed; The bottle cap model to be sprayed is gridded using a preset gridding algorithm to obtain a grid macroblock set.

6. The method according to claim 1, characterized in that Controlling the two-dimensional code spray gun to spray the two-dimensional code on the anti-rust bottle cap to be sprayed according to the time lag coefficient sequence specifically includes: Obtain the grid macroblock corresponding to the spraying point of the two-dimensional code spray gun in the grid macroblock set; According to the time lag coefficient corresponding to the grid macroblock in the time lag coefficient sequence, the movement speed of the two-dimensional code spray gun and the flow rate value of the spray gun at the spraying point are determined.

7. The method according to claim 1, characterized in that An infrared camera is used to collect thermal imaging images of the bottle caps to be sprayed with anti-rust paint.

8. A spraying device for a rust-proof bottle cap QR code, which is sprayed by the method of any one of claims 1 to 7, characterized in that: The spraying device of the rust-proof bottle cap QR code comprises: A thermal imaging image acquisition unit, used to acquire thermal imaging images of the bottle caps to be sprayed with anti-rust paint; A thermal imaging image preprocessing unit, used for performing image segmentation on the thermal imaging image to obtain a sub-image to be sprayed; A gridding unit for a sub-image to be sprayed, used for gridding the sub-image to be sprayed to obtain a grid macroblock set of the sub-image to be sprayed; A two-dimensional code spraying control unit is used to determine the time delay weight coefficient vector of the grid macroblock set, obtain the standard time delay time of the two-dimensional code spray gun, determine the time delay coefficient sequence according to the time delay weight coefficient vector and the standard time delay time, and control the two-dimensional code spray gun to spray the two-dimensional code on the anti-rust bottle cap to be sprayed according to the time delay coefficient sequence.

9. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a code, and the processor is configured to obtain the code and execute the method for spraying a two-dimensional code on an anti-rust bottle cap as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for spraying a two-dimensional code on an anti-rust bottle cap as described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Mobile robot automatic spraying device and mobile robot automatic spraying control system and method

    CN107908152A

  • Injection code detection method and device, production line, computer equipment and storage medium

    CN109543677A

  • Mixed-flow plate double-sided spraying method, device and system based on visual inspection and storage medium

    CN114146877A

  • Intelligent wall painting method, system and equipment based on image recognition and character recognition and storage medium

    CN114155314A

  • Spraying track simulation optimization method and device based on virtual reality

    CN115563732A