Method for identifying two-dimensional information of droplets

By using image processing technology in anti-counterfeiting labels, including grayscale conversion, binarization and morphological operations, the identification difficulties caused by droplet reflection are solved, and efficient and accurate droplet information recognition is achieved, which is suitable for industrial production.

CN114997202BActive Publication Date: 2024-12-24SHANDONG LVXINSIYUAN ANTI-COUNTERFEITING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110802378.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-15
Publication Date
2024-12-24
Estimated Expiration
2041-07-15

AI Technical Summary

Technical Problem

The problem of droplet reflection in existing anti-counterfeiting labels leads to difficulty in identifying information, affecting recognition accuracy and efficiency.

Method used

Define the calculation template through the original design size data of the small hole matrix, collect the image and perform grayscale conversion, binarization processing, morphological expansion and corrosion operations. Combined with perspective transformation and median filtering, accurately locate the droplet position to achieve two Identification of dimension information.

Benefits of technology

The recognition efficiency and accuracy of anti-counterfeiting label information are improved, the recognition accuracy reaches 100%, the calculation complexity is low, and the work efficiency is high.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114997202B_ABST
    Figure CN114997202B_ABST
Patent Text Reader

Abstract

The present invention relates to a method for identifying two-dimensional information of a droplet, which is characterized by comprising: defining a calculation template, collecting an image of a matrix carrying a droplet, converting it into a grayscale image, obtaining a binarization threshold T, and performing binarization processing on I1; performing a morphological expansion operation to eliminate noise, using morphological corrosion to fill in the incompleteness as much as possible, performing horizontal and vertical projection operations, obtaining a set of four corner points of ROI, and constructing a set of four corner points of a rectangle R according to the Template. t , calculate R0 to R t Perspective transformation matrix, and perform perspective transformation according to the transformation matrix. According to Template, construct the horizontal coordinate set and vertical coordinate set of all matrix points, combine the width and height of the image with the width and height of Template, and calculate the horizontal and vertical scale factors F respectively. x and F y , the matrix point coordinate set of all droplet positions of I5 is calculated; by processing the droplet information, the recognition efficiency and accuracy of the label information on the anti-counterfeiting label can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image recognition technology, and in particular to a method for identifying two-dimensional information of droplets by using image recognition to recognize two-dimensional information content of droplets, thereby realizing reading anti-counterfeiting data on anti-counterfeiting labels. Background Art

[0002] Chinese patent CN104966463B discloses an anti-counterfeiting label. This patented product uses a unique anti-counterfeiting ink composition to form an anti-counterfeiting pattern in an ink sac array on a bottom plate with a thickness of 0.2-2.0mm. In order to ensure the effectiveness of the anti-counterfeiting pattern, the anti-counterfeiting ink needs to be filled into the ink sacs in the ink sac array. The depth of the ink sacs is 0.0019-1.99mm in a microporous shape, and the anti-counterfeiting ink is in a flowing state. The product formed based on the above-mentioned prior patent finally has at least four groups of ink sac dot arrays arranged equidistantly in an area of ​​7x18mm. Each group of ink sac dot arrays is provided with 24 ink sacs arranged equidistantly, and the distance between adjacent ink sacs is less than 0.5mm. In actual application, ensuring that the anti-counterfeiting pattern carried by the anti-counterfeiting label can be quickly and accurately identified during the color development period is the key to achieving the anti-counterfeiting effect.

[0003] However, after the ink bag in the anti-counterfeiting label is filled with liquid, the droplets will reflect light, which makes it difficult to identify the information. Summary of the invention

[0004] In view of the difficulties existing in the prior art, the present invention proposes a method for identifying two-dimensional information of droplets of an anti-counterfeiting pattern composed of droplets, which can quickly and accurately identify the two-dimensional information of droplets during the color development period of anti-counterfeiting ink.

[0005] The present invention is achieved by the following measures:

[0006] A method for identifying two-dimensional information of a droplet, characterized by comprising the following steps:

[0007] Step 1: Based on the original design size data of the small hole matrix, define the calculation template Template for subsequent identification, define the position with droplets as 1, otherwise as 0;

[0008] Step 2: Capture the image I0 of the droplet matrix through the camera.

[0009] Step 3: Convert I0 into grayscale image I1,

[0010] Step 4: Use the minimum cross entropy image segmentation algorithm to obtain the binarization threshold T.

[0011] Step 5: Use the threshold T to binarize I1 to obtain image I2;

[0012] Step 6: Perform morphological dilation operation on image I2 to eliminate noise and obtain image I3.

[0013] I3=Dilate(I2,kernel=5x5,iterations=2)

[0014] Due to the particularity of the physical form of the droplets, reflections will occur, resulting in incomplete and incomplete black spot images at some image locations containing droplets, which will affect the subsequent recognition accuracy. Morphological corrosion is used to fill in the gaps as much as possible to obtain image I 4,

[0015] I4=Erode(I3,kernel=3x3,iterations=3);

[0016] Step 7: Perform horizontal and vertical projection operations on I4 to obtain the ROI of the droplet image, obtain the set of four corner points R0 of the ROI, and construct the set of four corner points R of the rectangle according to the Template. t , calculate R0 to R t The perspective transformation matrix is ​​obtained, and the image I4 is perspective transformed according to the transformation matrix to obtain the image I5;

[0017] Step 8: According to Template, construct the horizontal coordinate set P of all matrix points tx and the vertical coordinate set P ty , combined with the width and height of I5 and the width and height of Template, calculate the horizontal and vertical scale factors F respectively x and F y , calculate the matrix point coordinate set of all droplet positions (including small holes without droplets) of I5: horizontal coordinate set P ix =P tx *F x , vertical coordinate set P iy =P ty *F y , and calculate the droplet radius Radius = Min (Template.Radius * F x ,Template.Radius*F y ),

[0018] Combined with P ix and P iy The droplet point position can be located in turn, and whether there is a droplet at this position can be determined by obtaining whether the pixel value of the coordinate position is 255. If the value is 255, there is a droplet, which is encoded as 1. If the value is 0, there is no droplet, which is encoded as 0, thereby realizing the decoding and identification of the droplet information.

[0019] In the actual verification process of the present invention, it is found that small bubbles may be generated when the liquid droplets fall into the small hole. As of the above steps, in a given test set, the recognition accuracy cannot reach 100%. In view of this situation, the present invention also includes step 9: performing median filtering on I1 that has not been binarized to obtain image I6.

[0020] I6 = MedianBlur (I1, ksize = 5)

[0021] Combined with the P obtained in step 8 ix and P iy Determine the coordinates of the center point of the droplet matrix (including the small hole without droplets) for I6, and calculate the sum of the pixel values ​​within the radius Radius for each center point of the matrix to obtain the set S0;

[0022] Sorting S0 to get S1, and then calculating the discrete difference Diff of each element. Find the index i of the element with the largest difference. If the pixel value of the range corresponding to the matrix point is greater than S1[i], there is no droplet, which is encoded as 0. Otherwise, there is a droplet, which is encoded as 1, so as to realize the decoding and recognition of the droplet information. After processing in step 9, in the given test set, the recognition accuracy reaches 100%.

[0023] In step 6 of the present invention, a morphological dilation operation is performed on image I2 to eliminate noise. When image I3 is obtained, the morphological dilation operation is performed twice or more according to the image processing needs. Further, when morphological corrosion is used to fill the defect as much as possible to obtain image I4, the morphological corrosion process is performed twice or more according to the image processing needs.

[0024] The present invention can effectively improve the recognition efficiency and accuracy of label information on anti-counterfeiting labels by processing droplet information, and has significant advantages such as low computational complexity, high work efficiency, and high accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Attached Figure 1 It is a schematic diagram of forming an anti-counterfeiting pattern in an anti-counterfeiting label product according to the present invention.

[0026] Attached Figure 2 This is the image after binarization processing in Example 1.

[0027] Attached Figure 3 This is the image after two rounds of expansion in Example 1.

[0028] Attached Figure 4 This is the image after three rounds of corrosion in Example 1.

[0029] Figure numerals: anti-counterfeiting label base plate 1, ink sac 2, blank ink sac 3, ink sac filled with liquid droplets 4. DETAILED DESCRIPTION

[0030] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0031] Embodiment 1:

[0032] This example provides a method for identifying anti-counterfeiting information of a droplet on an anti-counterfeiting label, specifically:

[0033] According to the original design size data of the small hole matrix, a calculation template Template for subsequent identification is defined, and the position with a droplet is defined as 1, otherwise it is 0;

[0034] Capture an image I0 of the droplet matrix through a camera (mobile phone camera, digital camera, industrial camera, etc.); convert I0 into a grayscale image I1;

[0035] The minimum cross entropy image segmentation algorithm is used to obtain the binarization threshold T. Using the threshold T, I1 is binarized to obtain image I2. At this time, most of the noise pixels have been filtered out, but there are still some subtle noise pixels (mostly because some small holes without droplets will form heavier shadows during imaging) that need to be processed (such as Figure 2 );

[0036] Perform morphological dilation operation on image I2 to eliminate noise and obtain image I3, as shown in Figure 3 ;

[0037] I3=Dilate(I2,kernel=5x5,iterations=2)

[0038] Due to the particularity of the physical form of the droplets, reflections may occur, resulting in incomplete and incomplete black spot images at some locations containing droplets, which will affect the subsequent recognition accuracy. Morphological corrosion is used to fill in the gaps and obtain image I4, as shown in Figure 4 .

[0039] I4=Erode(I3,kernel=3x3,iterations=3)

[0040] Perform horizontal and vertical projection operations on I4 to obtain the ROI of the droplet image and obtain the set of four corner points R0 of the ROI;

[0041] According to Template, construct the set R of the four corner points of the rectangle t ;

[0042] Calculate R0 to R t The perspective transformation matrix is ​​obtained, and the image I4 is perspective transformed according to the transformation matrix to obtain the image I5;

[0043] According to Template, construct the horizontal coordinate set P of all matrix points tx and the vertical coordinate set P ty , combined with the width and height of I5 and the width and height of Template, calculate the horizontal and vertical scale factors F respectively x and F y , calculate the matrix point coordinate set of all droplet positions (including small holes without droplets) of I5: horizontal coordinate set P ix =P tx *F x , vertical coordinate set P iy =P ty *F y . And calculate the droplet radius Radius = Min (Template.Radius * F x ,Template.Radius*F y )

[0044] Combined with P ix and P iy The droplet point position can be located in turn, and whether there is a droplet at this position can be determined by obtaining whether the pixel value of the coordinate position is 255. If the value is 255, there is a droplet, which is encoded as 1. If the value is 0, there is no droplet, which is encoded as 0, thereby realizing the decoding and identification of the droplet information.

[0045] In the actual verification process, it was found that small bubbles may appear when the droplets fall into the small hole. As of the above steps, the recognition accuracy in the given test set cannot reach 100%. In view of this situation, the median filter is performed on I1 that has not been binarized to obtain image I6:

[0046] I6 = MedianBlur (I1, ksize = 5)

[0047] Combined with the obtained P ix and P iy Determine the coordinates of the center point of the droplet matrix (including the small hole without droplets) for I6, and calculate the sum of the pixel values ​​within the radius Radius for each center point of the matrix to obtain the set S0;

[0048] Sort S0 to get S1, then calculate the discrete difference Diff of each element, find the index i of the element with the largest difference, and if the pixel value of the range corresponding to the matrix point is greater than S1[i], there is no droplet and it is encoded as 0. Otherwise, there is a droplet and it is encoded as 1, so as to realize the decoding and recognition of the droplet information.

[0049] The recognition method proposed in the present invention has a recognition accuracy of 100% in a given test set, has significant advantages such as high efficiency and high accuracy, and is suitable for industrial production applications.

Claims

1. A method for identifying two-dimensional information of a droplet, characterized in that: The following steps are involved: Step 1: Based on the original design size data of the small hole matrix, define the calculation template Template for subsequent identification, define the position with droplets as 1, and otherwise as 0; Step 2: Capture the image I0 of the droplet matrix through the camera. Step 3: Convert I0 into grayscale image I1, Step 4: Use the minimum cross entropy image segmentation algorithm to obtain the binarization threshold T. Step 5: Use the threshold T to binarize I1 to obtain image I2; Step 6: Perform morphological dilation on image I2 to eliminate noise and obtain image I3, I3 = Dilate(I2, kernel=5x5, iterations=2). Due to the particularity of the physical form of the droplet, reflections will occur, resulting in incomplete and incomplete black spot images at some image locations containing droplets, which will affect the subsequent recognition accuracy. Use morphological corrosion to make up for the incompleteness as much as possible to obtain image I 4, I4 = Erode(I3, kernel=3x3, iterations=3); Step 7: Perform horizontal and vertical projection operations on I4 to obtain the ROI of the droplet image and obtain the set of four corner points R0 of the ROI. According to Template, construct the set R of the four corner points of the rectangle t , calculate R0 to R t The perspective transformation matrix is ​​obtained, and the image I4 is perspective transformed according to the transformation matrix to obtain the image I5; Step 8: According to Template, construct the horizontal coordinate set P of all matrix points tx and the vertical coordinate set P ty , combined with the width and height of I5 and the width and height of Template, calculate the horizontal and vertical scale factors F respectively x and F y , calculate the matrix point coordinate set of all droplet positions of I5: horizontal coordinate set P ix =P tx * F x , vertical coordinate set P iy =P ty * F y , and calculate the droplet radius Radius=Min(Template.Radius*F x , Template.Radius*F y ), combined with P ix and P iy The droplet point position can be located in turn, and whether there is a droplet at this position can be determined by obtaining whether the pixel value of the coordinate position is 255. If the value is 255, there is a droplet, which is encoded as 1. If the value is 0, there is no droplet, which is encoded as 0, thereby realizing the decoding and identification of the droplet information.

2. A method for identifying two-dimensional information of a droplet according to claim 1, characterized in that: The step also includes step 9: performing median filtering on I1 that has not been binarized to obtain image I6. I6=MedianBlur(I1, ksize=5) Combined with the P obtained in step 8 ix and P iy Determine the coordinates of the center point of the droplet matrix for I6, and calculate the sum of the pixel values ​​within the radius of each matrix center point to obtain the set S0; Sort S0 to get S1, then find the discrete difference Diff of each element, find the index i of the element with the largest difference, and the pixel value of the corresponding point in the matrix range is greater than S 1[i] If there is no droplet, it is coded as 0, otherwise there is a droplet, which is coded as 1, thereby realizing the decoding and identification of the droplet information.

3. The method for identifying two-dimensional information of a droplet according to claim 1, characterized in that: In the step 6, the image I2 is subjected to a morphological dilation operation to eliminate noise, and when the image I3 is obtained, the morphological dilation operation is performed twice or more according to the image processing requirements; when the image I4 is obtained by using morphological corrosion to fill the defect as much as possible, the morphological corrosion process is performed twice or more according to the image processing requirements.