Label laminating effect detection method and system based on photographing identification
By using high-definition industrial cameras for photography and image processing, combined with label edge and texture color analysis, automated detection and warehousing of can labels have been achieved, solving the problems of low detection efficiency and accuracy, and improving the automation level and efficiency of production and warehousing management.
Patent Information
- Application Number
- CN202511333854.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-18
- Publication Date
- 2025-12-19
AI Technical Summary
The existing can label adhesion testing methods suffer from low efficiency and accuracy, making it difficult to achieve automated warehousing management.
High-definition industrial cameras are used to capture images of aluminum can labels. Combined with image recognition and processing technology, the system determines skew by calculating the angle between the label edge and the horizontal or vertical direction, analyzes texture and color features to determine flatness, and combines optical character recognition for information detection and automatic data entry.
This has enabled an integrated process for aluminum can products, from inspection to automatic warehousing, which has improved the automation and efficiency of production and warehousing management, reduced human error, and lowered costs.
Smart Images

Figure CN121169873A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition and detection technology, specifically to a method and system for detecting label adhesion effect based on photo recognition. Background Technology
[0002] In modern industrial production and warehousing management, the packaging labels of beverage cans not only contain key product information, but their adhesion also directly affects the product's appearance and subsequent use. Traditional label adhesion inspection and label information recognition mainly rely on manual operation. Manual inspection is inefficient, costly, and prone to human judgment errors, making it difficult to meet the needs of large-scale production and rapid warehousing. Although some machine vision-based inspection methods exist, most are single-function and cannot simultaneously and comprehensively inspect and identify both the label adhesion and the information on the label. Improving adhesion, such as whether the label is skewed or flat, hinders automated warehousing management. Therefore, there is an urgent need for an efficient, accurate, and automated label adhesion inspection method. Summary of the Invention
[0003] To address the aforementioned technical shortcomings, this invention provides a label adhesion effect detection method and system based on image recognition, thereby solving the problems of low detection efficiency and accuracy in existing can label adhesion detection.
[0004] This invention is achieved through the following technical solution: A method for detecting label adhesion effect based on image recognition is provided, the method comprising the following steps: Step S10: Set up a high-definition industrial camera on the aluminum can product conveyor line. After precise debugging, confirm the camera's shooting angle and position to ensure that the label on the surface of the aluminum can can be captured completely and clearly. When the aluminum can moves to the designated shooting area with the conveyor line, trigger the industrial camera's shooting program to take a picture and obtain an image of the aluminum can containing the label. Step S20: Perform image preprocessing on the obtained image of the aluminum can containing the label, and locate and extract the label; Step S30: Based on the extracted label image, determine whether the label is skewed by calculating the angle between the label edge and the horizontal or vertical direction, and determine whether the label is flat by analyzing the texture and color features of the label image. Step S40: After the detection is completed, the label information is identified and automatically entered into the database based on the identification results.
[0005] Preferably, step S10, which involves obtaining an image of a can containing a label, includes: Equipment installation and commissioning: Install a high-definition industrial camera at a suitable position above the beverage can product conveyor line, and precisely adjust the camera's shooting angle, height, focal length, and other parameters according to factors such as the size and shape of the beverage cans and the running speed of the conveyor line; Setting up the shooting area: Define a specific shooting area on the conveyor line. The location and size of the shooting area are determined based on factors such as the camera's shooting range and the stability of the can's movement on the conveyor line. This ensures that when the can enters the area, the camera can obtain a complete and unobstructed label image, avoiding problems such as missing label parts or blurry images due to an unreasonable shooting area. Setting up a photo-taking trigger mechanism: Install photoelectric sensors or other triggering devices near the shooting area. When the can moves into the shooting area with the conveyor line, the photoelectric sensor or other triggering device is triggered to detect the presence of the can. The photoelectric sensor or other triggering device sends a trigger signal to the industrial camera. The transmission of the trigger signal must be timely and accurate to avoid shooting failure or incomplete images due to signal delay or loss. After receiving the trigger signal, the industrial camera starts the photo-taking program to automatically take a picture, acquire an image of the can including the label, and transmit it to the storage unit.
[0006] Preferably, the step of image preprocessing in step S20 of obtaining the image of the can containing the label includes: Grayscale processing: The image of the aluminum can containing the label is obtained from the storage unit through the image reading function. This image is a color image, stored in the RGB color model, that is, red, green and blue. Each pixel contains the intensity values of the three channels of red, green and blue. According to the grayscale formula, the RGB color model is converted into a grayscale model. By traversing each pixel in the aluminum can image, the R, G and B values of each pixel are weighted and summed to obtain the corresponding grayscale value. The color image is converted into a grayscale image and stored in a specific image format. Filtering and denoising: Based on the noise characteristics of the converted grayscale image, select an appropriate filtering algorithm, determine the size of the filtering window, slide the window pixel by pixel on the grayscale image according to the determined window size, and calculate the new pixel value for each pixel area covered by the window according to the filtering algorithm rules. Image enhancement: By statistically analyzing the frequency of each gray level in a grayscale image, a grayscale histogram is generated to visually represent the grayscale distribution. Based on the principle of histogram equalization, a new grayscale value is calculated for each gray level. By mapping the relatively concentrated grayscale distribution in the original grayscale image to a wider grayscale range, the dynamic range of the image grayscale is increased, and the image contrast is improved. By traversing all pixels in the grayscale image, the original grayscale value of each pixel is replaced with the new grayscale value obtained from the equalization calculation, thus completing image enhancement. This makes the label edges and details clearer, facilitating subsequent feature extraction and analysis.
[0007] Preferably, the tag location and extraction steps in step S20 include: Edge detection: The Canny edge detection algorithm is used to perform edge detection on the preprocessed image of the can containing the label, extract edge information in the image, determine the approximate outline of the label, including Gaussian smoothing, calculation of gradient magnitude and direction, non-maximum suppression, and double threshold detection and edge connection; Contour filtering and positioning: Analyze the general outline of the determined label, filter out the outlines that match the label characteristics based on the shape features and size range of the label, and determine the position of the label in the image; Tag extraction: Based on the determined position of the tag in the image, the tag image is extracted from the original image of the can containing the tag, so as to perform subsequent adhesion effect detection and information recognition.
[0008] Preferably, step S30, which involves determining whether a label is skewed based on the extracted label image by calculating the angle between the label edge and the horizontal or vertical direction, includes: Edge enhancement and binarization: In order to make the label edges stand out more in the image so that the subsequent Hough transform can detect lines more accurately, the extracted label image is first subjected to edge enhancement processing. After the edge enhancement processing is completed, the label image is binarized to divide the pixels in the label image into foreground and background. The foreground is the label edge. A commonly used binarization method is the global thresholding method, which makes the label edges appear as white pixels and the background as black pixels, resulting in a black and white image. Hough Transform Line Detection: The Hough Transform algorithm is applied to the binarized label image. The Hough Transform is a method that transforms the line detection problem in image space into a parameter space for voting solution. During the execution process, appropriate Hough Transform parameters are set, and all possible lines are detected in the label image through the Hough Transform, and the parameter representation of each line in the image is obtained. Filtering lines: Traverse all lines detected by the Hough transform and filter out valid lines belonging to the label edge based on the characteristics of the label edge; Calculate the angle between lines: Based on the selected valid lines, calculate the angle between them and the horizontal or vertical direction and set the angle threshold. When the line is represented by polar coordinates (ρ,θ), the angle between the line and the horizontal direction is θ. When there are multiple lines, you can calculate their angles with the horizontal or vertical direction separately and record them. Skewness determination: The calculated angle between the lines is compared with a set threshold. When the absolute value of the angle between any valid line and the horizontal or vertical direction is greater than or equal to the threshold, the label is determined to be skewed. When all the angles between the lines are less than the threshold, the label is determined to be properly attached and without skewness.
[0009] Preferably, step S30, which involves analyzing the texture and color features of the label image to determine whether the label adheres smoothly, includes: Texture feature extraction: For the label image and other areas of the can surface, texture features are extracted using methods such as gray-level co-occurrence matrix. Appropriate parameters are set, and the gray-level co-occurrence matrix is calculated to describe the frequency of occurrence of gray-level pixel pairs in a specific direction and distance, thereby obtaining the texture information of the image. Commonly used texture feature parameters are extracted from the gray-level co-occurrence matrix, and the texture feature parameters of the label area and other areas of the can surface are calculated to provide data support for subsequent comparison. Color feature analysis and judgment: Compare the differences in texture feature parameters between the label area and other areas on the surface of the can, and analyze the color distribution of the label image. When the label edge shows abnormal color, blurred texture or missing texture, the label is judged to be uneven by combining the preset flatness judgment rules. The preset flatness judgment rules include texture feature parameter difference threshold, texture feature change trend, abnormal color distribution range and color change judgment.
[0010] Preferably, the step S40, which involves identifying tag information after detection and automatically storing the data in the database based on the identification results, includes: Label information recognition: The characters in the label image are segmented using methods such as connected component analysis or projection analysis. Each character is extracted individually, and optical character recognition (OCR) technology is used to match the segmented character image with a pre-stored character template library to identify the text information on the label. For QR codes or barcodes on the label, the corresponding decoding algorithm is used to identify them and obtain the product information contained therein. Automated warehousing processing: The identified label information is stored in the database and associated with the product's unique identifier, including text information and QR code or barcode information. Based on the label adhesion effect detection results and the identified product information, a corresponding warehousing instruction is generated. When the label adhesion effect is qualified and the information is accurately identified, an allow warehousing instruction is generated. When there are issues such as label misalignment, uneven adhesion, or information recognition errors, an unqualified instruction is generated, and relevant information is recorded. The warehousing instruction is then sent to the automated warehousing unit, which performs the corresponding warehousing operation on the canned products according to the instruction.
[0011] Furthermore, to achieve the above objectives, the present invention also proposes a label bonding effect detection system based on image recognition, wherein the label bonding effect detection system based on image recognition includes: Aluminum can image acquisition module: used to set up a high-definition industrial camera on the aluminum can product conveyor line. After precise debugging, the shooting angle and position of the camera are confirmed to ensure that the label on the surface of the aluminum can can be captured completely and clearly. When the aluminum can moves to the designated shooting area with the conveyor line, the industrial camera shooting program is triggered to take a picture and obtain an image of the aluminum can containing the label. Aluminum can image preprocessing module: used to preprocess the obtained aluminum can image containing the label, and to locate and extract the label; The module for judging the adhesion effect of aluminum can labels is used to judge whether the label is skewed by calculating the angle between the label edge and the horizontal or vertical direction based on the extracted label image, and to judge whether the label is flat by analyzing the texture and color features of the label image. Aluminum can product identification and automatic warehousing module: After inspection, it identifies the label information and automatically warehouses the product based on the identification results.
[0012] Furthermore, to achieve the above objectives, the present invention also proposes a label bonding effect detection device based on image recognition. The device includes: a memory, a processor, and a program for label bonding effect detection based on image recognition stored in the memory and executable on the processor. The program for label bonding effect detection based on image recognition is a set of steps for implementing the label bonding effect detection method based on image recognition as described above.
[0013] In addition, to achieve the above objectives, the present invention also provides a computer program product, which includes programs such as label fitting effect detection based on photo recognition. When the label fitting effect detection program based on photo recognition is executed by a processor, it implements a label fitting effect detection method based on photo recognition as described above.
[0014] The advantages and effects of this invention are: This invention proposes a label adhesion effect detection method and system based on image recognition. It acquires images of aluminum can labels using an industrial camera and combines image recognition and processing technologies to simultaneously detect and identify the label adhesion effect and label information. This achieves an integrated process from product detection to automatic warehousing, improving the automation and efficiency of production and warehousing management. Furthermore, the use of multiple image preprocessing and feature extraction algorithms effectively improves the accuracy of detection and identification, reduces human error, and lowers the incidence of product quality problems. In addition, the automatic warehousing function enables rapid and accurate product storage, optimizes warehousing management processes, and reduces labor and management costs, demonstrating significant economic benefits and promising application prospects. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a flowchart of a label adhesion effect detection method based on photo recognition according to the present invention.
[0017] Figure 2 This is a schematic diagram of the structure of a label adhesion effect detection system based on photo recognition according to the present invention.
[0018] Figure 3 This is a schematic block diagram of an electronic device for detecting label adhesion effect based on photo recognition according to the present invention. Detailed Implementation
[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] like Figure 1 As shown, in one embodiment of the present invention, a label adhesion effect detection method based on image recognition includes the following steps: Step S10: Set up a high-definition industrial camera on the aluminum can product conveyor line. After precise debugging, confirm the camera's shooting angle and position to ensure that the label on the surface of the aluminum can can be captured completely and clearly. When the aluminum can moves to the designated shooting area with the conveyor line, trigger the industrial camera's shooting program to take a picture and obtain an image of the aluminum can containing the label.
[0021] Specifically, step S10, which involves obtaining an image of a can containing a label, includes: Equipment Installation and Debugging: Install a high-definition industrial camera at a suitable position above the aluminum can product conveyor line. Precisely adjust the camera's shooting angle, height, and focal length parameters according to factors such as the size and shape of the aluminum cans and the operating speed of the conveyor line. For example, for aluminum cans of different heights, adjust the vertical height of the camera; for aluminum cans of different diameters, adjust the focal length to ensure that the camera can completely and clearly capture the label on the surface of the aluminum can, providing a high-quality image basis for subsequent inspection and identification work. Setting up the shooting area: Define a specific shooting area on the conveyor line. The location and size of the shooting area are determined based on factors such as the camera's shooting range and the stability of the can's movement on the conveyor line. This ensures that when the can enters the area, the camera can obtain a complete and unobstructed label image, avoiding problems such as missing label parts or blurry images due to an unreasonable shooting area. Setting up a photo-taking trigger mechanism: Install photoelectric sensors or other triggering devices near the shooting area. When the can moves into the shooting area with the conveyor line, the photoelectric sensor or other triggering device is triggered to detect the presence of the can. The photoelectric sensor or other triggering device sends a trigger signal to the industrial camera. The transmission of the trigger signal must be timely and accurate to avoid shooting failure or incomplete images due to signal delay or loss. After receiving the trigger signal, the industrial camera starts the photo-taking program to automatically take a picture, acquire an image of the can including the label, and transmit it to the storage unit.
[0022] Step S20: Perform image preprocessing on the obtained image of the can containing the label, and locate and extract the label.
[0023] Specifically, step S20, which involves image preprocessing of the obtained image of the can containing the label, includes: Grayscale processing: The image of the aluminum can containing the label is retrieved from the storage unit through the image reading function. This image is a color image, stored in the RGB color model, i.e., red, green, and blue. Each pixel contains the intensity values of the three channels of red, green, and blue. According to the grayscale formula, the RGB color model is converted into a grayscale model. By traversing each pixel in the aluminum can image, the R, G, and B values of each pixel are weighted and summed to obtain the corresponding grayscale value. The color image is converted into a grayscale image and stored in a specific image format, such as BMP or JPEG, for easy access in subsequent processing. Filtering and denoising: Based on the noise characteristics of the converted grayscale image, select an appropriate filtering algorithm. For example, median filtering is suitable for removing salt-and-pepper noise, while Gaussian filtering has a good suppression effect on Gaussian noise. Determine the size of the filtering window, such as 3×3 or 5×5. The window size affects the filtering effect. Smaller windows can better preserve image details, but the denoising ability is relatively weak. Larger windows have a strong denoising effect, but will cause image edges to be blurred. Slide the window pixel by pixel on the grayscale image according to the determined window size. For each pixel area covered by the window, calculate the new pixel value according to the filtering algorithm rules. Taking median filtering as an example, sort the grayscale values of all pixels in the window and take the median value as the new grayscale value of the current pixel. Process the entire image in this way to remove noise interference. Image enhancement: By statistically analyzing the frequency of each gray level in a grayscale image, a grayscale histogram is generated to visually represent the grayscale distribution. Based on the principle of histogram equalization, a new grayscale value is calculated for each gray level. By mapping the relatively concentrated grayscale distribution in the original grayscale image to a wider grayscale range, the dynamic range of the image grayscale is increased, and the image contrast is improved. By traversing all pixels in the grayscale image, the original grayscale value of each pixel is replaced with the new grayscale value obtained from the equalization calculation, thus completing image enhancement. This makes the label edges and details clearer, facilitating subsequent feature extraction and analysis.
[0024] Specifically, the steps for locating and extracting tags in step S20 include: Edge detection: The Canny edge detection algorithm is used to perform edge detection on the preprocessed image of the can containing the label, extracting edge information from the image and determining the approximate outline of the label. This includes Gaussian smoothing, calculating gradient magnitude and direction, non-maximum suppression, and double threshold detection and edge connectivity. Specifically, it includes: Gaussian smoothing: The preprocessed image is smoothed using a Gaussian filter. By setting an appropriate Gaussian kernel size and standard deviation, such as 3×3 or 5×5, the interference of image noise on edge detection is reduced, and false edges caused by noise are reduced. For example, for images with a lot of noise, a larger Gaussian kernel and a slightly larger standard deviation can be used to make the image smoother. Calculate gradient magnitude and direction: Use the Sobel operator to calculate the gradient of the image in the horizontal and vertical directions respectively, to obtain the gradient information of each pixel in the image, highlighting the areas with large gray-level changes in the image, i.e., the locations where edges may exist; Non-maximum suppression: Iterate through each pixel in the image. For each pixel, along its gradient direction, compare the gradient magnitude of the pixel with the gradient magnitude of the adjacent pixels in the gradient direction. When the gradient magnitude of the pixel is not a local maximum, set its gray value to 0. When the gradient magnitude of the pixel is a local maximum in its gradient direction, retain the pixel. This refines the edge and makes the edge width as close to a single pixel as possible. Dual threshold detection and edge connectivity: setting a high threshold T h and low threshold T l T h Approximately T l The gradient magnitude is 2-3 times that of the high threshold. Pixels with gradient magnitude greater than the high threshold are identified as strong edge points, while pixels with gradient magnitude less than the low threshold are excluded. Pixels in between are retained as weak edge points when connected to strong edge points, otherwise they are excluded. Finally, by connecting strong edge points and the weak edge points connected to them, the complete edge contour is obtained, thereby determining the approximate contour of the label.
[0025] Contour filtering and positioning: Analyze the approximate contours of the identified labels. Based on the shape characteristics and size range of the labels (e.g., rectangles, circles), filter out contours that match the label characteristics and determine the label's position in the image. This specifically includes: Contour extraction: Using image contour extraction algorithms, such as the findContours function in OpenCV, all contour information is extracted from the edge-detected image, and the edge pixels in the image are connected into a continuous contour curve. Shape Feature Analysis: Traverse all extracted contours and calculate the shape feature parameters for each contour. For rectangular labels, the shape feature can be determined by calculating parameters such as the aspect ratio of the bounding rectangle and the rectangularity (ratio of the contour area to the bounding rectangle area). For circular labels, the circularity can be calculated, such as the ratio of the square of the perimeter to the area (a closer circle has a value closer to 4π), the center, radius, and other parameters. Based on the preset range of label shape features, contours that match the label shape features are selected. Size range filtering: Further size judgment is performed on the filtered contours to obtain the area, perimeter and other size information of the contours, and compare them with the pre-set label size range. If the area is within a certain value range or the perimeter is within the corresponding range, contours that do not meet the size requirements are excluded, and the position of the label in the image is finally determined.
[0026] Label extraction: Based on the determined label position in the image, the label image is extracted from the original image of the can containing the label for subsequent adhesion detection and information recognition. Specifically, this includes: Determine the extraction area: Based on the label outline obtained from the filtering and positioning, calculate the bounding rectangle or minimum enclosing rectangle of the outline, determine the coordinate range of the label in the original image, including the coordinates of the upper left and lower right corners, and thus determine the extraction area of the label image; Image cropping: Using an image cropping function, the label image is cropped from the original image of the can containing the label according to a defined coordinate range, resulting in a complete label area image. The cropped label image is then stored or directly passed to the subsequent bonding effect detection and information recognition module for further processing.
[0027] Step S30: Based on the extracted label image, determine whether the label is skewed by calculating the angle between the label edge and the horizontal or vertical direction, and determine whether the label is flat by analyzing the texture and color features of the label image.
[0028] Specifically, step S30, which determines whether a label is skewed based on the extracted label image by calculating the angle between the label edge and the horizontal or vertical direction, includes: Edge enhancement and binarization: To make the label edges stand out more in the image so that the subsequent Hough transform can detect lines more accurately, the extracted label image is first subjected to edge enhancement processing. For example, the Canny edge detection algorithm is used again to strengthen the edge features. After the edge enhancement processing is completed, the label image is binarized to divide the pixels in the label image into foreground and background. The foreground is the label edge. Common binarization methods include global thresholding, such as the Otsu algorithm that automatically calculates the threshold, and local thresholding, so that the label edges are presented as white pixels and the background is presented as black pixels, resulting in a black and white image. Hough Transform Line Detection: The Hough Transform algorithm is applied to the binarized label image. The Hough Transform is a method that transforms the line detection problem in image space into a parameter space for voting solution. During the execution process, appropriate Hough Transform parameters are set, such as accumulator resolution (which determines the accuracy of line detection), minimum line segment length (which filters out meaningless line segments that are too short), and line segment interval threshold (which determines whether adjacent line segments belong to the same line). Through the Hough Transform, all possible lines are detected in the label image, and the parameter representation of each line in the image is obtained, such as ρ and θ in polar coordinates, which represent the distance of the line to the origin and the angle between the line normal and the x-axis, respectively. Filtering lines: Traverse all lines detected by the Hough transform and filter out valid lines that may belong to the label edge based on the characteristics of the label edge. For example, by analyzing the length and positional relationship of the lines, exclude lines that are too short, that is, obviously do not conform to the length characteristics of the label edge, or whose position deviates from the label area. Usually, the edge lines of the label have a certain length range and there are parallel or perpendicular geometric relationships between them. These characteristics can be used to remove interfering lines. Calculate the angle between lines: Based on the selected valid lines, calculate the angle between them and the horizontal or vertical direction and set the angle threshold. When the line is represented by polar coordinates (ρ,θ), the angle between the line and the horizontal direction is θ. When there are multiple lines, you can calculate their angles with the horizontal or vertical direction separately and record them. Skewness determination: The calculated angle between the lines is compared with a set threshold. For example, if the angle threshold is set to ±5°, the label is determined to be skewed when the absolute value of the angle between any valid line and the horizontal or vertical direction is greater than or equal to the threshold. When all the angles between the lines are less than the threshold, the label is determined to be properly attached and without skewness.
[0029] Specifically, step S30, which involves analyzing the texture and color features of the label image to determine whether the label is properly attached, includes: Texture Feature Extraction: For the label image and other areas of the can surface, texture features are extracted using methods such as the gray-level co-occurrence matrix (GLCM). Appropriate parameters are set, such as the number of gray levels (typically 16, 32, etc.), direction (including multiple directions such as 0°, 45°, 90°, and 135°), and distance (the distance between pixels, such as 1, 2, etc.). By calculating the GLCM, the frequency of gray-level pixel pairs in the image at specific directions and distances is described, thus obtaining the image's texture information. Commonly used texture feature parameters are extracted from the GLCM, such as energy (reflecting the uniformity of gray-level distribution and texture coarseness), entropy (measuring the complexity of the image texture), contrast (reflecting the gray-level contrast between adjacent pixels in the image), and correlation (measuring the similarity of image textures). Texture feature parameters are calculated for the label area and other areas of the can surface to provide data support for subsequent comparisons. Combining color feature analysis for judgment: Comparing the texture feature parameters of the label area with other areas of the can surface, and analyzing the color distribution of the label image, when abnormal colors, blurred textures, or missing parts appear at the label edges, the label is judged to be unevenly attached based on preset flatness judgment rules. These preset flatness judgment rules include texture feature parameter difference thresholds, texture feature change trends, abnormal color distribution ranges, and color abrupt change judgments, specifically including: Texture feature parameter difference threshold: For texture feature parameters such as energy, entropy, contrast, and correlation extracted from the gray-level co-occurrence matrix, difference thresholds are set respectively. For example, when the energy value difference between the label area and other areas on the surface of the can exceeds 30%, or the entropy value difference is greater than 20%, and the contrast difference exceeds 25%, it is initially judged that the label may have uneven adhesion. This is because when the label is unevenly adhered, its surface texture will change, causing these parameters to differ significantly from those of the normal area. Texture feature change trend: In addition to parameter differences, the change trend of texture feature parameters in the label edge area is also considered. When the energy value from the label center to the edge shows a significant decreasing trend, and the entropy value gradually increases, it indicates that the label edge is loose or lifted, resulting in a change in texture. If this change trend is met, it can be judged as uneven adhesion. Color distribution anomaly range: Set a threshold for the difference between the label edge color and the normal area color in the HSV color space. For example, when the hue (H) value of the label edge area differs from the normal area by more than 15°, or the saturation (S) value difference is greater than 20%, the lightness (V) value difference is greater than 15%, and the area of the abnormal color area accounts for more than 10% of the total area of the label edge, it is determined that there is a color anomaly at the label edge, which may indicate an uneven bonding problem; Color abrupt change judgment: When the color of the label edge suddenly changes, such as from the normal label color to the background color of the can, and the length of the line segment of the color abrupt change exceeds a certain threshold, such as 5 mm, regardless of the size of the abrupt change area, it is judged as the label not being applied evenly. This color abrupt change usually means that part of the label edge has fallen off.
[0030] Step S40: After the detection is completed, the label information is identified and automatically entered into the database based on the identification results.
[0031] Specifically, step S40, after detection, involves identifying the tag information and automatically storing it in the database based on the identification results. Label information recognition: The characters in the label image are segmented using methods such as connected component analysis or projection analysis. Each character is extracted individually, and optical character recognition (OCR) technology is used to match the segmented character image with a pre-stored character template library to identify the text information on the label. For QR codes or barcodes on the label, the corresponding decoding algorithm is used to identify them and obtain the product information contained therein. Automated Inbound Processing: The identified label information is stored in the database and associated with the product's unique identifier, including text information and QR code or barcode information. Based on the label adhesion effect detection results and the identified product information, corresponding inbound instructions are generated. When the label adhesion effect is qualified and the information is accurately identified, an allow inbound instruction is generated. When there are issues such as label misalignment, uneven adhesion, or information recognition errors, a disqualification instruction is generated, and relevant information is recorded. The inbound instruction is then sent to the automated warehousing unit, which performs the corresponding inbound operations on the canned products according to the instructions, such as placing qualified products in designated shelf locations and sorting disqualified products into the defective product area.
[0032] In addition, such as Figure 2 As shown, in one embodiment of the present invention, a label bonding effect detection system based on image recognition is proposed. The system includes: Aluminum can image acquisition module: used to set up a high-definition industrial camera on the aluminum can product conveyor line. After precise debugging, the shooting angle and position of the camera are confirmed to ensure that the label on the surface of the aluminum can can be captured completely and clearly. When the aluminum can moves to the designated shooting area with the conveyor line, the industrial camera shooting program is triggered to take a picture and obtain an image of the aluminum can containing the label. Aluminum can image preprocessing module: used to preprocess the obtained aluminum can image containing the label, and to locate and extract the label; The module for judging the adhesion effect of aluminum can labels is used to judge whether the label is skewed by calculating the angle between the label edge and the horizontal or vertical direction based on the extracted label image, and to judge whether the label is flat by analyzing the texture and color features of the label image. Aluminum can product identification and automatic warehousing module: After inspection, it identifies the label information and automatically warehouses the product based on the identification results.
[0033] This application provides a label adhesion effect detection system based on image recognition, employing a label adhesion effect detection method based on image recognition as described in the above embodiments. This system addresses the technical problems of low detection efficiency and accuracy in existing can label adhesion detection methods. Compared to existing technologies, the beneficial effects of the label adhesion effect detection system based on image recognition provided in this application are the same as those of the label adhesion effect detection method based on image recognition provided in the above embodiments. Furthermore, other technical features of the label adhesion effect detection system based on image recognition are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0034] This application provides a label bonding effect detection device based on photo recognition. The label bonding effect detection device based on photo recognition includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the label bonding effect detection method based on photo recognition in the above embodiment 1.
[0035] like Figure 3 As shown in the illustration, in one embodiment of the present invention, a structural schematic diagram of a label bonding effect detection device based on photo recognition, suitable for implementing the embodiments of this application, is presented. The label bonding effect detection device based on photo recognition in this application embodiment may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), etc., as well as fixed terminals such as digital TVs, desktop computers, etc. Figure 3 The label fitting effect detection device based on photo recognition shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0036] Figure 3The illustrated label-application effect detection device based on image recognition may include a processor 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a machine-readable storage medium (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the image-recognition-based label-application effect detection device. The processor 1001, the read-only memory 1002, and the machine-readable storage medium 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and a communication unit 1009. Communication unit 1009 allows a label adhesion detection device based on image recognition to wirelessly or wiredly communicate with other devices to exchange data. Although the figure shows a label adhesion detection device based on image recognition with various systems, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems can be implemented alternatively.
[0037] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication unit, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processor 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0038] This application provides a label adhesion effect detection device based on image recognition, employing a label adhesion effect detection method based on image recognition as described in the above embodiments. This addresses the technical problems of low detection efficiency and accuracy in existing can label adhesion detection methods. Compared to the prior art, the beneficial effects of the label adhesion effect detection device based on image recognition provided in this application are the same as those of the label adhesion effect detection method based on image recognition provided in the above embodiments. Furthermore, other technical features of this label adhesion effect detection device based on image recognition are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0039] The various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0040] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the label fitting effect detection method based on image recognition as described above.
[0041] The computer program product provided in this application can solve the technical problems of low detection efficiency and accuracy in existing can label adhesion detection. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the label adhesion effect detection method based on image recognition provided in the above embodiments, and will not be repeated here.
[0042] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for detecting label adhesion effect based on image recognition, characterized in that, The method includes the following steps: Step S10: Set up an industrial camera on the aluminum can product conveyor line. After debugging, confirm the camera's shooting angle and position. When the aluminum can moves with the conveyor line to the designated shooting area, trigger the industrial camera's shooting program to take a picture and obtain an image of the aluminum can containing the label. Step S20: Perform image preprocessing on the obtained image of the aluminum can containing the label, and locate and extract the label; Step S30: Based on the extracted label image, determine whether the label is skewed by calculating the angle between the label edge and the horizontal or vertical direction, and determine whether the label is flat by analyzing the texture and color features of the label image. Step S40: After the detection is completed, the label information is identified and automatically entered into the database based on the identification results.
2. The label adhesion effect detection method based on image recognition according to claim 1, characterized in that, The step S10 of obtaining the image of the can containing the label includes: Equipment installation and commissioning: Install an industrial camera at a suitable position above the beverage can product conveyor line, and adjust the camera's shooting angle, height, and focal length parameters according to the size and shape of the beverage cans and the running speed of the conveyor line; Setting the shooting area: A specific shooting area is defined on the conveyor line. The location and size of the shooting area are determined based on the camera's shooting range and the stability of the can's movement on the conveyor line. Setting up a photo-taking trigger mechanism: Install photoelectric sensors in the shooting area. When an aluminum can moves into the shooting area along the conveyor line, the photoelectric sensor is triggered to detect the presence of the aluminum can. The photoelectric sensor sends a trigger signal to the industrial camera. After receiving the trigger signal, the industrial camera starts the photo-taking program to automatically take a picture, acquire an image of the aluminum can including the label, and transmit it to the storage unit.
3. The label adhesion effect detection method based on image recognition according to claim 1, characterized in that, The step of image preprocessing in step S20, which involves obtaining the image of the aluminum can containing the label, includes: Grayscale processing: The image of the aluminum can containing the label is obtained from the storage unit through the image reading function. This image is a color image, stored in the RGB color model, that is, red, green and blue. Each pixel contains the intensity values of the three channels of red, green and blue. According to the grayscale formula, the RGB color model is converted into a grayscale model. By traversing each pixel in the aluminum can image, the R, G and B values of each pixel are weighted and summed to obtain the corresponding grayscale value. The color image is converted into a grayscale image and stored in a specific image format. Filtering and denoising: Based on the noise characteristics of the converted grayscale image, select an appropriate filtering algorithm, determine the size of the filtering window, slide the window pixel by pixel on the grayscale image according to the determined window size, and calculate the new pixel value for each pixel area covered by the window according to the filtering algorithm rules. Image enhancement: Statistically count the frequency of each gray level in the grayscale image, generate a grayscale histogram of the image, calculate the new grayscale value corresponding to each gray level according to the histogram equalization principle, traverse all pixels in the grayscale image, and replace the original grayscale value of each pixel with the new grayscale value obtained by the equalization calculation to complete the image enhancement.
4. The label adhesion effect detection method based on image recognition according to claim 1, characterized in that, The steps for locating and extracting the tags in step S20 include: Edge detection: The Canny edge detection algorithm is used to perform edge detection on the preprocessed image of the can containing the label, extract edge information in the image, determine the label outline, including Gaussian smoothing, calculation of gradient magnitude and direction, non-maximum suppression, and double threshold detection and edge connection; Contour filtering and positioning: Analyze the determined label contours, filter out contours that match the label characteristics based on the shape features and size range of the labels, and determine the position of the labels in the image; Tag extraction: Based on the determined location of the tag in the image, extract the tag image from the original image of the can containing the tag.
5. The label adhesion effect detection method based on image recognition according to claim 1, characterized in that, The step S30, which determines whether a label is skewed based on the extracted label image by calculating the angle between the label edge and the horizontal or vertical direction, includes: Edge enhancement and binarization: Edge enhancement processing is performed on the extracted label image. After the edge enhancement processing is completed, the label image is binarized to divide the pixels in the label image into foreground and background, so that the label edge is presented as white pixels and the background is presented as black pixels. Hough Transform Line Detection: The Hough Transform algorithm is applied to the binarized label image. During the execution process, appropriate Hough Transform parameters are set to detect all straight lines in the label image through the Hough Transform and obtain the parameter representation of each straight line in the image. Filtering lines: Traverse all lines detected by the Hough transform and filter out lines belonging to the label edges based on the characteristics of the label edges; Calculate the angle between lines: Based on the selected lines, calculate the angle between them and the horizontal or vertical direction and set the angle threshold; Skewness determination: The calculated angle between the straight lines is compared with a set threshold. When the absolute value of the angle between any straight line and the horizontal or vertical direction is greater than or equal to the threshold, the label is determined to be skewed. When all the angles between the straight lines are less than the threshold, the label is determined to be properly attached and without skewness.
6. The label adhesion effect detection method based on image recognition according to claim 1, characterized in that, The step S30, which involves analyzing the texture and color features of the label image to determine whether the label is properly attached, includes: Texture feature extraction: For the label image and other areas of the can surface, the gray-level co-occurrence matrix method is used to extract the texture features of the image. By setting appropriate parameters, the gray-level co-occurrence matrix is calculated to describe the frequency of occurrence of gray-level pixel pairs in the image at specific directions and distances, thereby obtaining the texture information of the image. Texture feature parameters are extracted from the gray-level co-occurrence matrix, and the texture feature parameters of the label area and other areas of the can surface are calculated respectively. Combining color feature analysis for judgment: Compare the differences in texture feature parameters between the label area and other areas on the surface of the can, and analyze the color distribution of the label image. When color abnormalities, blurred textures, or missing parts appear at the edge of the label, the label is judged to be unevenly attached based on the preset flatness judgment rules. The preset flatness judgment rules include the texture feature parameter difference threshold, texture feature change trend, abnormal color distribution range, and color change judgment.
7. The label adhesion effect detection method based on image recognition according to claim 1, characterized in that, The steps in step S40, including tag information recognition after detection and automatic data entry based on the recognition results, include: Label information recognition: The characters in the label image are segmented using connected component analysis or projection analysis methods. Each character is extracted separately. Optical character recognition technology is used to match the segmented character image with a pre-stored character template library to identify the text information on the label. For QR codes or barcodes on the label, the corresponding decoding algorithm is used to identify them and obtain the product information contained therein. Automated warehousing processing: The identified label information is stored in the database and associated with the product's unique identifier, including text information and QR code or barcode information. Based on the label adhesion effect detection results and the identified product information, a corresponding warehousing instruction is generated. When the label adhesion effect is qualified and the information is accurately identified, an allow warehousing instruction is generated. When there is label misalignment, uneven adhesion, or information recognition error, an unqualified instruction is generated and the relevant information is recorded. The warehousing instruction is sent to the automated warehousing unit, which performs the corresponding warehousing operation on the can products according to the instruction.
8. A label adhesion effect detection system based on image recognition, characterized in that, The system executes the label adhesion effect detection method based on image recognition as described in claim 1, including: Aluminum can image acquisition module: Used to set up an industrial camera on the aluminum can product conveyor line. After debugging, the shooting angle and position of the camera are confirmed. When the aluminum can moves with the conveyor line to the designated shooting area, the industrial camera shooting program is triggered to take a picture and obtain an image of the aluminum can including the label. Aluminum can image preprocessing module: used to preprocess the obtained aluminum can image containing the label, and to locate and extract the label; The module for judging the adhesion effect of aluminum can labels is used to judge whether the label is skewed by calculating the angle between the label edge and the horizontal or vertical direction based on the extracted label image, and to judge whether the label is flat by analyzing the texture and color features of the label image. Aluminum can product identification and automatic warehousing module: After inspection, it identifies the label information and automatically warehouses the product based on the identification results.
9. A label adhesion effect detection device based on image recognition, characterized in that, include: The present invention includes a memory, a processor, and a label fitting effect detection program based on image recognition, which is stored in the memory and can run on the processor. When the label fitting effect detection program based on image recognition is executed by the processor, it implements a label fitting effect detection method based on image recognition as described in any one of claims 1 to 7.
10. A computer program product, characterized in that, The computer program product includes a label fitting effect detection program based on photo recognition, which, when executed by a processor, implements a label fitting effect detection method based on photo recognition as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Salted duck egg surface crack online visual inspection method based on morphologic edge detection
CN108051449A
Product label detection method based on machine vision multi-level features
CN117092129A
Visual inspection method for building external wall thermal insulation material
CN119354976A
Ultrasonic radar pin defect detection method
CN120163768A
Bottled oral liquid quality detection method and system based on image recognition
CN120219291A