A method and system for visual recognition of milk powder packaging labels

By calculating the degree of deformation and vertical deformation of the milk powder can, the pixel points matching weight is given, and the template matching is used to match the correlation coefficient, the problem of serious deformation of canned milk powder labels in two-dimensional images is solved, and the precise identification of the label is achieved.

CN118823397BActive Publication Date: 2024-11-19SHAANXI SHENGTANG DAIRY CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411289276.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-14
Publication Date
2024-11-19
Estimated Expiration
2044-09-14

AI Technical Summary

Technical Problem

Due to the shooting angle and cylindrical curved surface, the canned milk powder label deforms severely in the two-dimensional image, resulting in the inability to accurately identify.

Method used

By obtaining the grayscale image of the milk powder jar, dividing the connection domain, calculating the degree of deformation, determining the degree of deformation in the center line and vertical direction, giving the pixel points matching weight, and using the correlation coefficient to perform template matching, the visual recognition of the label is achieved.

Benefits of technology

It improves the precise recognition of milk powder can labels, can effectively deal with deformation problems caused by shooting angles, and enhances the position and shape recognition accuracy of labels.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118823397B_ABST
    Figure CN118823397B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of data processing technology, and in particular to a method and system for visual recognition of milk powder packaging labels, comprising: obtaining a grayscale image of a milk powder can and presetting a plurality of straight lines in the grayscale image of the milk powder can, collecting surface labels of milk powder cans of the same category as existing templates; obtaining the degree of deformation of the milk powder can along each straight line, and further obtaining the center line of the milk powder can; obtaining the degree of deformation of the milk powder can in the vertical direction along the center line; obtaining the matching weight of each pixel point in the grayscale image of the milk powder can according to the degree of deformation of the milk powder can along the center line and the degree of deformation of the milk powder can in the vertical direction along the center line, further obtaining the correlation coefficient of each pixel point, performing template matching between the grayscale image of the milk powder can and the existing template according to the correlation coefficient, and completing visual recognition of the milk powder can label. The present invention aims to improve the accuracy of recognition of labels on milk powder cans.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a method and system for visually identifying a milk powder packaging label. Background Art

[0002] In order to facilitate product differentiation, canned container-type products need to be attached with a cylindrical label displaying the product name. The quality of the cylindrical label is directly related to the quality and appearance of the product itself, so quality control of the cylindrical label of canned products is indispensable in production.

[0003] In the production process of canned milk powder, different formula milk powders are suitable for infants of different age groups. The most intuitive way for consumers to distinguish different products is to check the milk powder labels. However, due to the shooting angle and cylindrical surface, cylindrical labels will produce various deformations in two-dimensional images, so the labels on the milk powder cans cannot be accurately identified. Summary of the invention

[0004] The invention provides a milk powder packaging label visual recognition method and system to solve the existing problems.

[0005] A milk powder packaging label visual recognition method and system of the present invention adopts the following technical solutions:

[0006] An embodiment of the present invention provides a method for visually identifying a milk powder packaging label, the method comprising the following steps:

[0007] Obtain a grayscale image of a milk powder can and preset a number of straight lines in the grayscale image of the milk powder can, and collect surface labels of milk powder cans of the same category as existing templates;

[0008] According to different information areas in the grayscale image of the milk powder can, the grayscale image of the milk powder can is divided into different connected domains, and according to the grayscale changes of the pixels in all connected domains along different straight line directions, the deformation degree of the milk powder can along each straight line is obtained, and the center line of the milk powder can is further obtained;

[0009] According to each pixel point of the center line of the milk powder can, a number of vertical lines are constructed, and according to the grayscale change of the pixel points in each connected domain along the vertical line direction of the center line, the deformation degree of the milk powder can in the vertical direction along the center line is obtained;

[0010] According to the deformation degree of the milk powder can along the center line and the deformation degree of the milk powder can in the direction perpendicular to the center line, a matching weight of each pixel in the grayscale image of the milk powder can is obtained;

[0011] According to the matching weights of all pixels in the grayscale image of the milk powder can, the correlation coefficient of each pixel is obtained, and the grayscale image of the milk powder can is matched with the existing template according to the correlation coefficient to complete the visual recognition of the milk powder can label.

[0012] Furthermore, the obtaining of the grayscale image of the milk powder can and presetting a plurality of straight lines in the grayscale image of the milk powder can include:

[0013] Taking the central pixel point of the grayscale image of the milk powder can as a reference, a straight line is drawn through the central pixel point according to a preset interval angle to obtain a plurality of straight lines of the grayscale image of the milk powder can.

[0014] Further, obtaining the center line of the milk powder can includes:

[0015] The degree of deformation of the milk powder can along each straight line is obtained, and the straight line with the smallest degree of deformation of the milk powder can along each straight line is recorded as the center line of the milk powder can.

[0016] Furthermore, obtaining the deformation degree of the milk powder can along each straight line includes:

[0017] Milk powder cans along the The calculation formula for the deformation degree of a straight line is:

[0018]

[0019] in, Indicates that the milk powder can is along the The degree of deformation of a straight line; Indicates the The straight line The first connected domain The pixel point is the orthocenter, perpendicular to the A straight line passing through The grayscale mean of all pixels of pixels; Indicates the The straight line The first connected domain The pixel point is the orthocenter, perpendicular to the A straight line passing through The grayscale mean of all pixels of pixels; Indicates The straight line The number of pixels passed through in a connected domain; Indicates The number of connected domains that a straight line passes through in the grayscale image of the milk powder can; represents the linear normalization function.

[0020] Furthermore, the specific method of obtaining the connected domain is:

[0021] The depth-first algorithm is used to divide the grayscale image of the milk powder can into different connected domains.

[0022] Furthermore, obtaining the degree of deformation of the milk powder can in a vertical direction along the center line includes:

[0023] The center line of the milk powder can The calculation formula for the deformation degree of a vertical line is:

[0024]

[0025] in, Indicates the number of The degree of deformation of the vertical line; Indicates the center line The number of connected domains that the vertical lines pass through; Indicates the center line The vertical line passes through The number of pixel rows in a connected domain; Indicates the center line The vertical line passes through The first Grayscale mean of row pixels; Indicates the center line The vertical line passes through The first Grayscale mean of row pixels; represents the linear normalization function.

[0026] Furthermore, the specific method of obtaining the vertical line is:

[0027] The first The straight line with pixels and perpendicular to the center line is recorded as the center line Vertical lines.

[0028] Furthermore, obtaining the matching weight of each pixel in the grayscale image of the milk powder can includes:

[0029] For any pixel point in the grayscale image of the milk powder can, the square root of the sum of the squares of the deformation degree of the milk powder can along the center line and the deformation degree of the milk powder can in the direction perpendicular to the center line is recorded as the deformation degree of any pixel point on the grayscale image of the milk powder can;

[0030] On the grayscale image of the milk powder can, starting from the upper left corner, build a sliding window with each pixel as the center pixel, move pixel by pixel in the horizontal direction, and record the normalized result of the deformation degree of the center pixel in the sliding window as the matching weight of each center pixel, until the sliding window traverses the complete grayscale image of the milk powder can and obtains the matching weights of all pixels.

[0031] Furthermore, obtaining the correlation coefficient of each pixel point includes:

[0032] The product of the matching weight of each pixel in the grayscale image of the milk powder can and the normalized correlation coefficient matching function of each pixel in the existing template is recorded as the correlation coefficient of each pixel.

[0033] The present invention also proposes a milk powder package label visual recognition system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program stored in the memory to implement the steps of the aforementioned milk powder package label visual recognition method.

[0034] The beneficial effects of the technical solution of the present invention are as follows: obtaining a grayscale image of a milk powder can and presetting a number of straight lines in the grayscale image of the milk powder can, collecting surface labels of milk powder cans of the same category as existing templates, and providing a basis for subsequent template matching; obtaining the degree of deformation of the milk powder can along each straight line, measuring the degree of deformation of the milk powder can along the preset straight line to determine the overall shape of the milk powder can, and further obtaining the center line of the milk powder can, in order to solve the problem that the grayscale image of the milk powder can obtained may be tilted in a two-dimensional plane due to the shooting angle, and the center line of the milk powder can cannot be directly determined; obtaining the milk powder can The degree of deformation of the powder can along the vertical direction of the center line is helpful to understand the local expansion or contraction of the surface of the milk powder can, and improve the accurate recognition of the position and shape of the label on the surface of the milk powder can; according to the degree of deformation of the milk powder can along the center line and the degree of deformation of the milk powder can along the vertical direction of the center line, the matching weight of each pixel in the grayscale image of the milk powder can is obtained, and the correlation coefficient of each pixel is further obtained. Template matching is performed between the grayscale image of the milk powder can and the existing template according to the correlation coefficient to complete the visual recognition of the milk powder can label and improve the accurate recognition of the label on the milk powder can. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0036] Figure 1A flowchart of the steps of a method for visually identifying a milk powder packaging label according to the present invention;

[0037] Figure 2 is the rectangular coordinate system of the milk powder can. DETAILED DESCRIPTION

[0038] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of a method and system for visual recognition of milk powder packaging labels proposed by the present invention, its specific implementation, structure, features and effects, in conjunction with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0039] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0040] The specific scheme of the visual recognition method and system for milk powder packaging labels provided by the present invention is described in detail below with reference to the accompanying drawings.

[0041] See also Figure 1 , which shows a flowchart of a method for visually identifying a milk powder packaging label provided by an embodiment of the present invention, the method comprising the following steps:

[0042] Step S001: obtaining a grayscale image of a milk powder can and presetting a number of straight lines in the grayscale image of the milk powder can, and collecting surface labels of milk powder cans of the same category as existing templates.

[0043] The image of the milk powder can is obtained by a camera, and the milk powder can area in the milk powder can image is extracted by using neural network semantic segmentation. The milk powder can area is grayscaled to obtain a grayscale image of the milk powder can, wherein the neural network semantic segmentation is a well-known technology and the specific method is not introduced here.

[0044] Taking the central pixel point of the grayscale image of the milk powder can as a reference, a straight line is drawn through the central pixel point according to a preset interval angle to obtain a plurality of straight lines of the grayscale image of the milk powder can, each straight line being composed of pixel points in the grayscale image of the milk powder can. The preset interval angle of this embodiment is described by taking 22.5 degrees as an example, and other values ​​may be set in other implementations, which are not limited in this embodiment.

[0045] Collect the surface labels of milk powder cans of the same category as existing templates.

[0046] Step S002: Divide the grayscale image of the milk powder can into different connected domains according to different information areas in the grayscale image of the milk powder can, obtain the deformation degree of the milk powder can along each straight line according to the grayscale changes of the pixels in all connected domains along different straight line directions, and further obtain the center line of the milk powder can.

[0047] It should be noted that due to the shooting angle, the grayscale image of the milk powder can may be tilted in the two-dimensional plane. The vertical line in the grayscale image of the milk powder can cannot be used as the center line, and the center line of the grayscale image of the milk powder can itself needs to be detected. In three-dimensional space, several straight lines on the side of the milk powder can parallel to the central axis are parallel to each other, while in the two-dimensional plane image taken by the camera, due to the distance between the object and the lens and the shooting angle, several straight lines on the side of the milk powder can parallel to the central axis show the characteristics of being small near and large far away, and shrink in a trumpet shape along the extension direction of the lens in the grayscale image of the milk powder can. However, at any shooting angle on the side of the milk powder can, the overall deformation of the straight lines parallel to the central axis is the smallest.

[0048] It should be further explained that due to the image design of the milk powder can by the manufacturer, there are patterns, texts and designs on the surface of the milk powder can. Therefore, the grayscale image of the milk powder can can be divided into different areas. There is a significant difference in the grayscale distribution of each area, while the grayscale distribution within the area is relatively consistent.

[0049] Specifically, the depth-first algorithm is used to divide the grayscale image of the milk powder can into different connected domains. The grayscale and texture of the pixels in each connected domain are similar. According to the grayscale change of the pixels along the straight line in each connected domain, the deformation degree of the milk powder can along each straight line is obtained. The calculation formula for the deformation degree of a straight line is:

[0050]

[0051] in, Indicates that the milk powder can is along the The degree of deformation of a straight line; Indicates the The straight line The first connected domain The pixel point is the orthocenter, perpendicular to the A straight line passing through The grayscale mean of all pixels of pixels; Indicates the The straight line The first connected domain The pixel point is the orthocenter, perpendicular to the A straight line passing through The grayscale mean of all pixels of pixels; Indicates The straight line The number of pixels passed through in a connected domain; Indicates The number of connected domains that a straight line passes through in the grayscale image of the milk powder can; Represents a linear normalization function that normalizes the data value to Within the range.

[0052] It represents the difference between the grayscale means of two adjacent pixels, and is used to measure the grayscale change between adjacent pixels. The larger the value, the greater the difference between the grayscale means of adjacent pixels. Indicates along the The sum of the grayscale mean differences of all adjacent pixels along the straight line is used to measure the The cumulative grayscale changes of the straight line. The larger the value, the The cumulative grayscale change of the straight line is high, that is, the grayscale change is very drastic. The grayscale distribution of pixels in each connected domain has a high consistency. In the connected domain, the more uniform the grayscale distribution perpendicular to the straight line is, the smaller the grayscale value change caused by the deformation is. The smaller the value of is, the smaller the deformation is. The larger the value of , the greater the degree of deformation.

[0053] Similarly, the deformation degree of the milk powder can along each straight line is obtained according to the above method, and the straight line with the smallest deformation degree of the milk powder can along each straight line is recorded as the center line of the milk powder can.

[0054] Step S003: construct a number of vertical lines according to each pixel point of the center line of the milk powder can, and obtain the deformation degree of the milk powder can in the vertical direction along the center line according to the grayscale change of the pixel points in each connected domain along the vertical line direction of the center line.

[0055] It should be noted that the center line of the milk powder can obtained through the above steps needs to be traversed through the entire grayscale image of the milk powder can, and the corresponding deformation degree needs to be calculated from the extension direction on both sides of the center line, because the label recognition needs to be done in the grayscale image of the milk powder can. This is very important for label recognition and adjusting the template matching weight. Due to the geometric characteristics and symmetry of the milk powder can, the deformation degree around any pixel point on its center line should be symmetrical on both sides, and the deformation degree of the pixel point at the same distance along the extension direction on both sides should be symmetrical and the same.

[0056] Specifically, the first The straight line with pixels and perpendicular to the center line is recorded as the center line The vertical line along the center line of the milk powder can The calculation formula for the deformation degree of a vertical line is:

[0057]

[0058] in, Indicates the number of The degree of deformation of the vertical line; Indicates the center line The number of connected domains that the vertical lines pass through; Indicates the center line The vertical line passes through The number of pixel rows in a connected domain; Indicates the center line The vertical line passes through The first Grayscale mean of row pixels; Indicates the center line The vertical line passes through The first Grayscale mean of row pixels; Represents a linear normalization function that normalizes the data value to Within the range.

[0059] It represents the difference between the grayscale means of pixels in two adjacent rows. It is used to measure the grayscale change between pixels in adjacent rows. The larger the value, the greater the difference between the grayscale means of pixels in adjacent rows. Indicates along the The sum of the grayscale mean differences of all adjacent rows of pixels along the vertical line is used to measure the The cumulative grayscale changes of the vertical lines. The larger the value, the The grayscale changes of the vertical lines are accumulated to a high degree, that is, the grayscale changes are very drastic. The smaller the value, the closer the milk powder can is to the center line. The smaller the deformation of the vertical line; The larger the value is, the closer the milk powder can is to the center line. The greater the deformation of the vertical line.

[0060] Similarly, according to the above method, the deformation degree of each vertical line along the center line of the milk powder can is obtained, that is, the deformation degree of the milk powder can in the vertical direction along the center line.

[0061] Step S004: Obtain the matching weight of each pixel in the grayscale image of the milk powder can according to the deformation degree of the milk powder can along the center line and the deformation degree of the milk powder can in the direction perpendicular to the center line.

[0062] It should be noted that for the degree of deformation of the milk powder can along the center line, the pixel points on the center line can be used as the independent variable and the degree of deformation can be used as the function mapping of the dependent variable; for the degree of deformation of the milk powder can in the vertical direction along the center line, the pixel points in the direction perpendicular to the center line can be used as the independent variable and the degree of deformation can be used as the function mapping of the dependent variable. Therefore, compared with directly establishing a coordinate system in the vertical and horizontal extension directions of the grayscale image of the milk powder can, the rectangular coordinate system established according to the center line of the milk powder can and the vertical direction of the center line can better reflect the corresponding position of the pixel points in the grayscale image of the milk powder can on the cylinder of the milk powder can by considering the influence of deformation on the pixel points. According to the degree of deformation of the milk powder can along each straight line and the degree of deformation of the milk powder can in the vertical direction along the center line, the degree of deformation of any pixel point in the grayscale image of the milk powder can can be obtained.

[0063] Specifically, the rectangular coordinate system of the milk powder can is established with the pixel point at the lower right corner of the milk powder can as the origin, the center line direction as the vertical axis, and the direction perpendicular to the center line as the horizontal axis. The established rectangular coordinate system of the milk powder can is as follows: Figure 2 As shown, Figure 2 The solid rectangle in the middle is the image of the milk powder can. Figure 2 The dotted rectangle in the middle is the grayscale image of the milk powder can. For any pixel in the grayscale image of the milk powder can, the square root of the sum of the squares of the deformation degree of the milk powder can along the center line and the deformation degree of the milk powder can in the vertical direction along the center line is recorded as the deformation degree of any pixel in the grayscale image of the milk powder can.

[0064] It should be noted that the essence of label recognition is to use the sliding window method to traverse the entire image, and to perform template matching between the features of the existing label and the pixel information in the sliding window. For plane figures without distortion, the above method can be used directly for template matching. For the collected grayscale image of the milk powder can, the label of the milk powder can is deformed due to the curved side of the cylindrical surface of the milk powder can and the different shooting angles, so the recognition template needs to be adjusted. Constructing a sliding window and locally analyzing the grayscale image of the milk powder can can better capture the information of local deformation. By assigning a higher matching weight to pixels with a large degree of deformation in the sliding window, the recognition ability of deformed labels can be enhanced.

[0065] Specifically, on the grayscale image of the milk powder can, starting from the upper left corner, a pixel with a size of The sliding window is moved horizontally pixel by pixel, and the normalized deformation degree of the central pixel in the sliding window is recorded as the matching weight of each central pixel until the sliding window traverses the complete grayscale image of the milk powder can to obtain the matching weight of all pixels. This is described as an example, and other values ​​may be set in other implementation modes, which are not limited in this embodiment.

[0066] Step S005: According to the matching weights of all pixels in the grayscale image of the milk powder can, the correlation coefficient of each pixel is obtained, and template matching is performed between the grayscale image of the milk powder can and the existing template according to the correlation coefficient to complete the visual recognition of the milk powder can label.

[0067] According to the above steps, the deformation of each pixel in the grayscale image of the milk powder can and the matching weight of each pixel in label recognition are obtained, and the label of the milk powder can to be detected is recognized using the existing template matching algorithm.

[0068] The product of the matching weight of each pixel in the grayscale image of the milk powder can and the normalized correlation coefficient matching function of each pixel in the existing template is recorded as the correlation coefficient of each pixel. The correlation coefficient of each pixel is normalized. The larger the normalized value, the higher the similarity between the pixel and the pixel at the corresponding position in the existing template. The window sliding method is used to perform overall matching on the local area to obtain the matching result of each pixel in the grayscale image. The matching result represents the part of the grayscale image of the milk powder can that is most similar to the template. The image formed by the matching results of all pixels is recorded as the matching image, and the visual recognition of the milk powder packaging label is completed. It should be noted that the correlation coefficient matching function is a calculation function of the normalized correlation coefficient matching method of the existing template matching, and the specific calculation process will not be repeated in this embodiment.

[0069] So far, the present invention is completed.

[0070] To sum up, in an embodiment of the present invention, the present invention also provides a milk powder package label visual recognition system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program stored in the memory to implement the steps of the aforementioned method for visual recognition of milk powder package labels.

[0071] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for visual recognition of milk powder packaging labels, characterized in that: The method comprises the following steps: Obtain a grayscale image of a milk powder can and preset a number of straight lines in the grayscale image of the milk powder can, and collect surface labels of milk powder cans of the same category as existing templates; According to different information areas in the grayscale image of the milk powder can, the grayscale image of the milk powder can is divided into different connected domains, and according to the grayscale changes of the pixels in all connected domains along different straight line directions, the deformation degree of the milk powder can along each straight line is obtained, and the center line of the milk powder can is further obtained; According to each pixel point of the center line of the milk powder can, a number of vertical lines are constructed, and according to the grayscale change of the pixel points in each connected domain along the vertical line direction of the center line, the deformation degree of the milk powder can in the vertical direction along the center line is obtained; According to the deformation degree of the milk powder can along the center line and the deformation degree of the milk powder can in the direction perpendicular to the center line, a matching weight of each pixel in the grayscale image of the milk powder can is obtained; According to the matching weights of all pixels in the grayscale image of the milk powder can, the correlation coefficient of each pixel is obtained, and the grayscale image of the milk powder can is matched with the existing template according to the correlation coefficient to complete the visual recognition of the milk powder can label; The obtaining of the correlation coefficient of each pixel point comprises: The product of the matching weight of each pixel in the grayscale image of the milk powder can and the normalized correlation coefficient matching function of each pixel in the existing template is recorded as the correlation coefficient of each pixel; The step of obtaining the deformation degree of the milk powder can along each straight line comprises: Milk powder cans along the The calculation formula for the deformation degree of a straight line is: in, Indicates that the milk powder can is along the The degree of deformation of a straight line; Indicates the The straight line The first connected domain The pixel point is the orthocenter, perpendicular to the A straight line passing through The grayscale mean of all pixels of pixels; Indicates the The straight line The first connected domain The pixel point is the orthocenter, perpendicular to the A straight line passing through The grayscale mean of all pixels of pixels; Indicates The straight line The number of pixels passed through in a connected domain; Indicates The number of connected domains that a straight line passes through in the grayscale image of the milk powder can; represents the linear normalization function; The step of obtaining the degree of deformation of the milk powder can in the vertical direction along the center line comprises: The center line of the milk powder can The calculation formula for the deformation degree of a vertical line is: in, Indicates the number of The degree of deformation of the vertical line; Indicates the center line The number of connected domains crossed by the vertical lines; Indicates the center line The vertical line passes through The number of pixel rows in a connected domain; Indicates the center line The vertical line passes through The first Grayscale mean of row pixels; Indicates the center line The vertical line passes through The first Grayscale mean of row pixels; represents the linear normalization function.

2. According to claim 1, a method for visual recognition of milk powder packaging labels is characterized in that: The step of obtaining a grayscale image of the milk powder can and presetting a plurality of straight lines in the grayscale image of the milk powder can comprises: Taking the central pixel point of the grayscale image of the milk powder can as a reference, a straight line is drawn through the central pixel point according to a preset interval angle to obtain a plurality of straight lines of the grayscale image of the milk powder can.

3. The method for visually identifying a milk powder packaging label according to claim 1, characterized in that: The method of obtaining the center line of the milk powder can comprises: The degree of deformation of the milk powder can along each straight line is obtained, and the straight line with the smallest degree of deformation of the milk powder can along each straight line is recorded as the center line of the milk powder can.

4. The method for visually identifying a milk powder packaging label according to claim 1, characterized in that: The specific method of obtaining the connected domain is: The grayscale image of the milk powder can is divided into different connected domains using the depth-first algorithm.

5. The method for visually identifying milk powder packaging labels according to claim 1, characterized in that: The specific method of obtaining the vertical line is: The first The straight line with pixels and perpendicular to the center line is recorded as the center line Vertical lines.

6. The method for visually identifying milk powder packaging labels according to claim 1, characterized in that: The step of obtaining the matching weight of each pixel in the grayscale image of the milk powder can comprises: For any pixel point in the grayscale image of the milk powder can, the square root of the sum of the squares of the deformation degree of the milk powder can along the center line and the deformation degree of the milk powder can in the direction perpendicular to the center line is recorded as the deformation degree of any pixel point on the grayscale image of the milk powder can; On the grayscale image of the milk powder can, starting from the upper left corner, build a sliding window with each pixel as the center pixel, move pixel by pixel in the horizontal direction, and record the normalized result of the deformation degree of the center pixel in the sliding window as the matching weight of each center pixel, until the sliding window traverses the complete grayscale image of the milk powder can and obtains the matching weights of all pixels.

7. A milk powder packaging label visual recognition system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the computer program is executed by a processor, the steps of a method for visually identifying a milk powder packaging label as described in any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Visual inspection system and method for package identification

    CN122289813A