Printing quality evaluation method, system and equipment based on image recognition and medium
By using an image recognition-based method to obtain the edge contour of the wine box and segment the printed image for refined inspection, the limitations of infrared detection and the low efficiency of manual inspection in existing technologies are solved, thus achieving efficient and accurate printing quality assessment.
Patent Information
- Application Number
- CN202510926097.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-07
- Publication Date
- 2025-10-17
AI Technical Summary
Among the existing methods for inspecting printed wine boxes, infrared detection is limited in its applicability due to the influence of material reflection or thickness, while manual inspection is inefficient and prone to misjudgment, resulting in poor evaluation of printing quality.
An image recognition-based method is used to obtain the edge contour of the wine box through preprocessing, segment the printed image, and perform color difference, stain, blur and missing print detection. Pixel gradient and feature point analysis are combined to count the defective areas, and position compensation is used to evaluate the quality.
It achieves efficient and accurate printing quality assessment, reduces misjudgments and omissions, ensures that minor defects are not overlooked, quickly screens out defective products, and provides refined quality control.
Smart Images

Figure BDA0005484772580000061 
Figure BDA0005484772580000071 
Figure BDA0005484772580000111
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of printed image detection, in particular to a printed quality evaluation method, system, device and medium based on image recognition. BACKGROUND
[0002] Wine box printing usually adopts processes such as offset printing, intaglio printing or flexographic printing, and first, graphic information is made into a printing plate through design and layout, and then, ink is matched and printed on paper or board by a printing machine. In the printing process, due to poor ink quality and matching, and unstable printing equipment, etc., color difference, stains, blur and missing printing defects occur on the surface of the printed wine box, reducing the printing quality of the wine box.
[0003] In the existing wine box printing defect detection method, infrared spectroscopy is often used for detection or manual sampling inspection is supplemented. The infrared detection is affected by material reflection or thickness, and its applicability is limited; manual detection relies on experience, is low in efficiency and prone to misjudgment due to fatigue, resulting in poor effect and low efficiency of industrial detection of wine box printing. SUMMARY
[0004] The purpose of the present application is to provide a printed quality evaluation method, system, device and medium based on image recognition.
[0005] The technical scheme of the present application is as follows:
[0006] A printed quality evaluation method based on image recognition, comprising the following operations:
[0007] S1, pre-processing a to-be-detected image to obtain a pre-processed image; obtaining edge contour information of a wine box in the pre-processed image, and cutting out a wine box printing image based on the edge contour information;
[0008] S2, according to different development surfaces of the wine box, the wine box printing image is divided into a plurality of printing sub-images; each printing sub-image is subjected to color difference detection, stain detection, blur detection and missing printing detection based on respective printing background information, the positions, quantities and areas of all color difference, stain, blur and missing printing regions in all printing sub-images are counted, and a printing defect recognition result is obtained; the operation of blur detection is as follows: non-smooth areas in the printing sub-image are screened out according to pixel gradient variance, the non-smooth areas in the printing sub-image are subjected to grid division, and based on the number of feature points and the average pixel response value in the grid, a blur grid is screened out; the position information corresponding to the blur grid is marked in the wine box printing image, and the position, quantity and area of the blur region are counted;
[0009] S3, based on the printing defect recognition result, it is judged whether there is a key defect in a key region of the wine box; if there is, the wine box is unqualified; if not, S4 is executed;
[0010] S4; judging whether the important area exists defects based on the printing defect identification result; if not, obtaining the qualified level of the wine box according to the printing quality evaluation value obtained based on the printing defect identification result; if yes, updating the printing quality evaluation value based on the position compensation method, and obtaining the qualified level of the wine box.
[0011] The operation of extracting the printing image of the wine box in S1 is as follows: the preprocessed image is subjected to grayscale and Gaussian filtering processing to obtain a denoising grayscale image; based on the pixel gradient distribution information of the denoising grayscale image, edge points of the denoising grayscale image are extracted, the corresponding position points of the edge points in the preprocessed image are wine box edge points, and a spline curve fitting is performed to obtain a wine box edge contour; the wine box edge contour is subjected to expansion processing in the preprocessed image to obtain a wine box safety edge contour; after the wine box safety edge contour is subjected to binary mask generation processing, the wine box safety edge contour is subjected to bit operation processing with the preprocessed image to obtain the printing image of the wine box.
[0012] The operation of the color difference detection processing in S2 is as follows: the color space difference value of the printing sub-image relative to the corresponding standard sub-image is mapped into a grayscale image, and after binarization processing, a connected domain processing is performed to obtain a color difference marker map, and the color difference area position, number and area of the printing sub-image are counted.
[0013] The operation of screening out the fuzzy grid in S2 is as follows: the number of feature points in each grid in the non-smooth area and the average response value of the feature points in the grid are obtained, and the grid with the number of feature points less than the number threshold and the average response value less than the response value threshold is regarded as the fuzzy grid.
[0014] The feature point acquisition method is as follows: the pixel points in the grid, after different scale Gaussian blur processing, whose pixel values are all the extreme values of the neighborhood pixels, are regarded as key points; all the key points form a key point set; the key points in the neighborhood range with a contrast less than a contrast threshold in the key point set are deleted to obtain the feature points.
[0015] The operation of the missing printing detection in S2 is as follows: the difference image of the printing sub-image and the corresponding standard printing sub-image is obtained, and the points with a difference value greater than a difference value threshold in the difference image are regarded as missing printing points; the missing printing points in the neighborhood range are merged to obtain a missing printing marker map, and the missing printing area position, number and area are counted.
[0016] In S4, the printing quality evaluation value is calculated by the following formula:
[0017]
[0018] Q1 is the printing quality evaluation value, A s , A w , Ah , A b respectively, the area of the s-th color difference region, the area of the w-th stain region, the area of the h-th blur region, the area of the b-th miss printing region, S, W, H, B are respectively the total number of color difference regions, the total number of stain regions, the total number of blur regions, the total number of miss printing regions, A is the total area of defect regions, α1, α2, α3, α4 are respectively color difference weight, stain weight, blur weight and miss printing weight, β is the defect quantity weight, N d is the total number of defects, N max is the maximum allowed value of the total number of defects.
[0019] A printing quality evaluation method based on image recognition, for realizing the printing quality evaluation method based on image recognition described above, comprising:
[0020] A wine box printing image generation module is configured to pre-process a to-be-inspected image to obtain a pre-processed image, and obtain edge contour information of the wine box in the pre-processed image, and cut out a wine box printing image based on the edge contour information.
[0021] A printing defect recognition result generation module is configured to divide the wine box printing image into a plurality of printing sub-images according to different unfolded surfaces of the wine box, and perform color difference detection, stain detection, blur detection and miss printing detection on each printing sub-image based on respective printing background information, and count the positions, quantities and areas of all color difference regions, stain regions, blur regions and miss printing regions in all printing sub-images to obtain a printing defect recognition result. The operation of blur detection is as follows: non-smooth areas in the printing sub-image are screened out according to pixel gradient variance, the non-smooth areas in the printing sub-image are divided into grids, and blur grids are screened out based on the number of feature points and the average pixel response value in the grids. The corresponding position information of the blur grids is marked in the wine box printing image, and the position, quantity and area of the blur region are counted and obtained.
[0022] A wine box unqualified product identification module is configured to determine whether there is a key defect in a key region of the wine box based on the printing defect recognition result. If there is, the wine box is unqualified. If not, a wine box qualified grade identification module is executed.
[0023] The wine box qualified grade identification module is configured to determine whether there is a defect in an important region based on the printing defect recognition result. If not, the qualified grade of the wine box is obtained according to the printing quality evaluation value obtained based on the printing defect recognition result. If there is, the printing quality evaluation value is updated based on a position compensation method, and the qualified grade of the wine box is obtained.
[0024] A printing quality evaluation device based on image recognition, comprising a processor and a memory, wherein the processor implements the printing quality evaluation method based on image recognition described above when executing the computer program saved in the memory.
[0025] A computer readable storage medium for storing a computer program, wherein the computer program is executed by a processor to implement the image recognition-based printing quality evaluation method.
[0026] The present application has the advantages of:
[0027] The image recognition-based printing quality evaluation method provided by the present application first pre-processes the to-be-inspected image, cuts out the wine box printing image based on the edge contour information, reduces the interference of irrelevant information such as background, focuses on the printing area, reduces the misjudgment and missed judgment of defects, and speeds up the defect recognition and analysis speed. Then, according to the different unfolding surfaces of the wine box, the wine box printing image is divided into a plurality of printing sub-images, based on the different printing areas and printing background information of different wine boxes, each printing sub-image is subjected to color difference detection, stain detection, blur detection and missing printing detection based on the respective printing background information, interference between different regions is avoided, it is ensured that small defects are not missed, fine control of wine box printing detection is realized, the positions, quantities and areas of all color difference, stain, blur and missing printing regions in all printing sub-images are counted, and a printing defect recognition result is obtained. Next, based on the printing defect recognition result, it is judged whether there is a key defect in the key area of the wine box, the fatal defect in the key area is screened first, and unqualified products are quickly positioned and eliminated. Finally, based on the printing defect recognition result, it is judged whether there is a defect in the important area, if there is, a position compensation fine printing quality evaluation value is used to obtain an accurate quality classification result, which is used in wine box printing detection, has good detection effect and high efficiency, and quality control is in place. DETAILED DESCRIPTION
[0028] The present embodiment provides an image recognition-based printing quality evaluation method, which includes the following operations:
[0029] S1, pre-process the to-be-inspected image to obtain a pre-processed image; obtain the edge contour information of the wine box in the pre-processed image, and cut out the wine box printing image based on the edge contour information;
[0030] S2, according to the different unfolding surfaces of the wine box, the wine box printing image is divided into a plurality of printing sub-images; each printing sub-image is subjected to color difference detection, stain detection, blur detection and missing printing detection based on the respective printing background information, the positions, quantities and areas of all color difference, stain, blur and missing printing regions in all printing sub-images are counted, and a printing defect recognition result is obtained; the operation of blur detection is: according to the pixel gradient variance, the non-smooth area in the printing sub-image is screened out, the non-smooth area in the printing sub-image is subjected to grid division, based on the number of feature points and the average pixel response value in the grid, the fuzzy grid is screened out; the corresponding position information of the fuzzy grid in the wine box printing image is marked, and the position, quantity and area of the fuzzy region are counted;
[0031] S3, judging whether there is a key defect in the key area of the wine box based on the printing defect identification result; if there is, the wine box is unqualified; if not, performing S4;
[0032] S4, judging whether there is a defect in the important area based on the printing defect identification result; if not, obtaining the qualified level of the wine box according to the printing quality evaluation value obtained based on the printing defect identification result; if yes, updating the printing quality evaluation value based on the position compensation method to obtain the qualified level of the wine box.
[0033] The specific steps are as follows.
[0034] S1, pre-processing the image to be detected to obtain a pre-processed image; obtaining edge contour information of the wine box printing in the pre-processed image, and cutting out the wine box printing image based on the edge contour information.
[0035] The image to be detected is pre-processed, and the wine box printing image is cut out based on the edge contour information, which reduces the interference of irrelevant information such as background, focuses on the printing area, reduces the misjudgment and omission of defect identification, and speeds up the defect identification and analysis speed.
[0036] Firstly, due to the instability of the shooting environment, the original image often contains random noise, which may affect the accuracy of image analysis. In order to improve the image quality, the image to be detected is pre-processed to obtain a pre-processed image. The pre-processing operation can be realized by denoising the image to be detected. The denoising method includes but is not limited to median filtering or Gaussian filtering, which removes salt noise and background noise in the image, and provides a clearer image for subsequent processing.
[0037] Then, in order to locate and obtain the wine box printing area in the image, the edge contour information of the wine box printing in the pre-processed image is obtained, and the wine box printing image is cut out based on the edge contour information.
[0038] The operation of cutting out the wine box printing image is as follows: the pre-processed image is subjected to grayscale and Gaussian filtering to obtain a denoising grayscale image; based on the pixel gradient distribution information of the denoising grayscale image, the edge points of the denoising grayscale image are extracted, and the corresponding position points of the edge points in the pre-processed image are the wine box edge points; all the wine box edge points are subjected to spline curve fitting to obtain the wine box edge contour, which is used as the edge contour information of the wine box; the wine box edge contour (edge contour information) is subjected to expansion processing (expanding the wine box edge contour to the non-wine box position direction, i.e. outward expansion) in the pre-processed image to avoid edge loss due to positioning error, and a wine box safety edge contour is obtained; the wine box safety edge contour is subjected to binary mask generation processing to obtain a mask image with the contour area being 1 and the background being 0, and the mask image and the pre-processed image are subjected to bit operation (bitwise AND operation) processing to obtain the wine box printing image.
[0039] In addition, due to the influence of the light layout in the factory building, the image obtained in the process of printing the image after the camera shoots the pipeline is prone to have uneven brightness, which not only loses part of the printing details, but also makes the obtained pixel information inconsistent with the actual situation, resulting in poor image quality and low information expression accuracy. In order to ensure the accuracy of image defect recognition, the embodiment performs brightness equalization processing on the wine box printing image after obtaining the wine box printing image, obtains a wine box printing enhanced image, and uses the wine box printing enhanced image to perform the operation in S2.
[0040] The operation of brightness equalization processing is as follows: the image histogram of the wine box printing image is mapped to a uniform distribution, the information expression ability of dark textures (such as wine box gilded characters) is improved, and an equalized image is obtained; after the equalized image is normalized, a logarithmic domain image is obtained, and different scale (standard deviation) Gaussian filtering processing is performed, small scale is used to retain details, and large scale is used to remove large area uneven illumination, and a plurality of Gaussian filtering images are obtained; after obtaining the difference images of the plurality of Gaussian filtering images and the logarithmic domain image respectively, the texture and detail part of the image is retained, weighted average processing is performed, the processing results of different scales are balanced, and a Gaussian filtering fusion image is obtained; the Gaussian filtering fusion image is subjected to exponential operation and normalization processing, the pixel value representation of the image is restored, the image pixel value is mapped to a range suitable for display and subsequent processing, the brightness and contrast of the image meet the visual perception requirements, and the uneven illumination problem in the original image is eliminated, the details are enhanced, and a wine box printing enhanced image is obtained.
[0041] The operation of obtaining the equalized image can be realized by the following formula:
[0042]
[0043] s k is the gray value of the pixel point belonging to the k level (the total number of gray levels can be defined according to actual needs) in the equalized image, n k,i is the gray value of the nth pixel point of the gray level belonging to the k level in the image histogram of the wine box printing image, I is the total number of pixel points of the k level in the image histogram of the wine box printing image, and N is the total number of image pixel points.
[0044] S2, according to the different unfolding surfaces of the wine box, the wine box printing image (or the wine box printing enhanced image) is divided into a plurality of printing sub-images; each printing sub-image respectively performs color difference detection, stain detection, blur detection and missing printing detection based on the respective printing background information, counts the positions, quantities and areas of all color differences, stains, blurs and missing printing regions in all printing sub-images, and obtains a printing defect recognition result.
[0045] Firstly, according to different unfolding surfaces of the wine boxes, the wine box printing image (or the wine box printing enhanced image) is segmented into a plurality of printing sub-images, and based on different printing areas of the wine boxes, different background information of printing, each printing sub-image is subjected to color difference detection, stain detection, blur detection and missing printing detection based on respective printing background information, so as to avoid interference between different areas, ensure that small defects are not missed, realize fine control of the printing quality of the wine boxes, and count the number and area of the color difference area, the stain area and the blur area of all the sub-images to obtain a printing defect recognition result.
[0046] The operation of color difference detection processing of the printing sub-image is that the color space difference value of the printing sub-image relative to the corresponding standard sub-image is mapped into a gray scale image, after binarization processing, connected domain processing is performed to obtain a color difference marking graph, and the color difference area position, number and area of the printing sub-image are counted and obtained.
[0047] Specifically, the RGB color space of the printing sub-image is converted into Lab color space, and brightness normalization processing is performed to obtain a brightness normalized image; based on the brightness difference, the chroma difference and the hue difference between each pixel point in the brightness normalized image and the corresponding pixel point in the corresponding standard sub-image, the color space difference value of each pixel point in the printing sub-image is obtained, which is mapped into a gray scale image (the greater the color space difference value, the greater the gray value), binarization processing is performed, normal points and color difference points are marked, after deleting outlier color difference points, connected domain processing is performed to obtain a color difference marking graph, and the color difference area position, the color difference area number and the corresponding color difference area of the printing sub-image are counted and obtained.
[0048] The color space difference value is calculated by the following formula:
[0049]
[0050] ΔC is the color space difference value, ΔL1, ΔL2 and ΔL3 are the brightness difference, the chroma difference and the hue difference respectively, k1, k2 and k3 are the brightness difference weight coefficient, the chroma difference weight coefficient and the hue difference weight coefficient respectively, the values of k1, k2 and k3 include but are not limited to 1, and s1, s2 and s3 are the brightness difference scaling factor, the chroma difference scaling factor and the hue difference scaling factor respectively.
[0051] The above operation of deleting outlier color difference points can be realized by deleting color difference points in a neighborhood range whose total number is less than a color difference point total number threshold.
[0052] The process of the print sub-image through the spot detection is: converting the RGB color space of the print sub-image into the Lab color space to obtain a sub-image color space graph; based on the feature vector of the pixel point (obtained from the coordinates and color information of the pixel point), the sub-image color space graph is clustered to obtain the category of each pixel point; the pixel point whose center point category proportion in the neighborhood range (the ratio of all pixel points belonging to the center point category in the neighborhood range to the total number of pixel points in the neighborhood range) is less than the proportion threshold value is usually inconsistent with the surrounding pixel background, and is taken as an abnormal point; based on the position information of the abnormal point, the print sub-image is binarized, and the corresponding points of the abnormal points in the neighborhood range are merged to obtain a plurality of spot regions, and the position, number and area of the spot regions of the print sub-image are counted.
[0053] The operation of the clustering process is specifically: selecting a plurality of pixel points from the sub-image color space graph as starting center points, and performing label classification; obtaining the distance between any one of the remaining pixel points and the starting center points, combining the starting center point corresponding to the minimum distance with the pixel point, and forming an aggregation group; obtaining the average value of the feature vectors of all pixel points in the aggregation group as the updated center point of the aggregation group; other remaining pixel points are sequentially executed to obtain the distance from the center point (starting center point or updated center point), combine the center point corresponding to the minimum distance, and update the center point, until the last pixel point forms an aggregation group, and a plurality of aggregation groups are obtained; the label classification of each starting center in the aggregation group is taken as the label classification of each pixel point in the corresponding aggregation group.
[0054] The distance between the above two pixel points is obtained based on the product of the feature vectors of the two pixel points.
[0055] The operation steps of the print sub-image through the blur detection are as follows.
[0056] Step a, the non-smooth area in the print sub-image is screened according to the pixel gradient variance, to avoid invalid detection of the background and other smooth areas.
[0057] The operation of obtaining the non-smooth area is: after the print sub-image is processed by the gray scale, the horizontal gradient graph and the vertical gradient graph are obtained (which can be realized by calculating the gradient of the gray scale graph of the print sub-image in the horizontal and vertical directions through the Sobel operator), to highlight the areas with sharp changes in pixel value in the image, i.e. the edge and texture detail parts; based on the horizontal gradient graph and the vertical gradient graph, a gradient amplitude image is obtained, which makes the edge and detail area more obvious; the gradient amplitude image is divided into a plurality of local windows, and the local window with a gradient variance value greater than a gradient variance threshold value is taken as a non-smooth window, and the non-smooth windows in the neighborhood range are merged to obtain the non-smooth area.
[0058] Step b, grid division is performed on the non-smooth area in the printed sub-image, and based on the number of feature points and the average pixel response value in the grid, a blurred grid is screened out. Few feature points mean that the image detail information is missing, and low average response value indicates that the contrast between pixels is insufficient, and the combination of the two can more comprehensively and accurately identify the blurred grid and reduce misjudgment.
[0059] The operation of screening out the blurred grid in the non-smooth area is: obtaining the number of feature points in each grid in the non-smooth area and the average response value of the feature points in the grid, and regarding the grid with the number of feature points less than the number threshold and the average response value less than the response value threshold as the blurred grid.
[0060] The feature point acquisition method is: regarding the pixel point in the grid whose pixel value is the extreme value of the neighborhood pixel after different scale Gaussian blur processing as a key point; all key points form a key point set; deleting the key points in the key point set within the neighborhood range whose contrast is less than the contrast threshold, effectively excluding noise interference, so that the extracted feature points can truly reflect the clarity of the image, and the feature points are obtained.
[0061] The average response value of the feature points in the grid is the average value of the local contrast of all feature points in the grid, and the local range can be set by demand.
[0062] Step c, the corresponding position information of the blurred grid is marked in the printed image of the wine box, and the position, number and area of the blurred area of the printed sub-image are obtained by statistics.
[0063] The operation of missing printing detection of the printed sub-image is: obtaining the difference image of the printed sub-image and the corresponding standard printed sub-image, regarding the points with a difference value greater than a difference value threshold in the difference image as missing printing points; merging the missing printing points within the neighborhood range to obtain a missing printing mark image, and obtaining the position, number and area of the missing printing area of the printed sub-image by statistics.
[0064] In order to improve the accuracy of missing printing detection of the surface of the wine box, especially the wine box with more structured patterns, another missing printing detection method is provided in the embodiment, and the missing printing detection is obtained by fusing the information of the multi-layer low-frequency component image and the multi-layer high-frequency component image of the printed sub-image. The specific operation steps are as follows.
[0065] Step a, the printed sub-image is subjected to gray scale processing and discrete Fourier transform processing, focusing on the brightness and texture features of the pattern, and separating the low-frequency (representing the overall structure and contour of the image) and high-frequency (representing the edge and detail) information from the spatial domain of the image to obtain a frequency domain gray scale image.
[0066] Step b, the frequency domain gray scale image is processed by different scale low pass filter and different scale high pass filter, to obtain multi-layer low frequency component image for analyzing the overall integrity of the structured pattern, and multi-layer high frequency component image for capturing the edge, texture detail changes of the structured pattern, and for detecting the pattern edge missing or discontinuity caused by the missing printing.
[0067] Step c, the multi-layer high frequency component image and the multi-layer spatial domain low frequency image are respectively processed by inverse Fourier transform, to intuitively present the structure and contour distribution of the image, and restore the edge and detail information of the structured pattern, to obtain multi-layer spatial domain low frequency image and multi-layer spatial domain high frequency image.
[0068] Step d, after the multi-layer spatial domain low frequency image is respectively processed by image difference value processing with the corresponding low frequency image of the standard printing sub-image (which can be obtained by low pass filter processing of the standard printing sub-image), and then fused, the large area pattern missing area caused by the missing printing is quickly located, to obtain low frequency difference image; based on the preset edge intensity threshold, the multi-layer spatial domain high frequency image is processed by threshold segmentation and then fused, to obtain high frequency binary image.
[0069] Step e, the low frequency difference image and the high frequency binary image are processed by logical or operation, to fuse the low frequency and high frequency detection results, comprehensively mark the missing printing area on the printing surface of the wine box, reduce the missing detection and false detection, and obtain comprehensive missing printing area binary image; the comprehensive missing printing area binary image is processed by connected domain analysis, to obtain missing printing marking image, and the missing printing area position, number and area of the printing sub-image are counted.
[0070] S3, based on the printing defect recognition result, it is judged whether there is a key defect in the key area of the wine box; if there is, the wine box is unqualified product; if not, S4 is executed.
[0071] Based on the printing defect recognition result, it is judged whether there is a key defect in the key area of the wine box. The above-mentioned content of the key area with key defect is that there is a missing printing area at the position of the wine box brand logo or the regulatory text, or there is a stain area or color difference area with defect area greater than the defect area threshold in the center area of the wine box, or the maximum length (or maximum width) of any defect area (color difference area, area stain, area blur, area missing printing) is greater than the defect length threshold (or defect width threshold).
[0072] When the above-mentioned key defect exists, the fatal defect of the wine box printing is easily recognized by the naked eye or does not meet the printing regulations, so the wine box is judged as unqualified product.
[0073] If not, the wine box is qualified product, and the classification of qualified grade in S4 is executed.
[0074] S4. Based on the printing defect recognition results, determine whether there are defects in the important area; if not, obtain the qualified grade of the wine box according to the printing quality evaluation value obtained based on the printing defect recognition results; if there are defects, update the printing quality evaluation value based on the position compensation method to obtain the qualified grade of the wine box.
[0075] Based on the print defect detection results, determine whether there are defects in important areas. Important areas include the brand area, barcode area, and legal text area on the front of the wine box.
[0076] If it does not exist, in order to improve calculation efficiency, the qualified grade of the wine box is obtained according to the printing quality evaluation value obtained based on the printing defect recognition results. For example: if the printing quality evaluation value is not less than the first evaluation value threshold, the wine box is a first-level qualified product; if the printing quality evaluation value is between the first evaluation value threshold and the second evaluation value threshold (the first evaluation value threshold is greater than the second evaluation value threshold), the wine box is a second-level qualified product; if the printing quality evaluation value is not greater than the second evaluation value threshold, the wine box is a third-level qualified product.
[0077] The above printing quality evaluation value is calculated by the following formula:
[0078]
[0079] Q1 is the printing quality evaluation value, They are the total area of color difference area, total area of stain area, total area of fuzzy area, total area of missing area, A s 、A w 、A h 、A b are the area of the sth color difference area, the area of the wth stain area, the area of the hth fuzzy area, and the area of the bth missing print area, respectively. S, W, H, and B are the total number of color difference areas, the total number of stain areas, the total number of fuzzy areas, and the total number of missing print areas, respectively. A is the total area of defect areas (the sum of the total area of color difference areas, the total area of stain areas, the total area of fuzzy areas, and the total area of missing print areas). α1, α2, α3, and α4 are the color difference weight, stain weight, fuzzy weight, and missing print weight, respectively. β is the defect number weight. N d is the total number of defects (the sum of color difference, stains, blur and missing prints), N max The maximum allowable value for the total number of defects. This calculation formula takes into account both the proportion of the total defect area (area influence) and the total number of defects (discreteness influence), comprehensively analyzes the printing quality of wine boxes, and improves the accuracy of the printing quality assessment value.
[0080] If exists, based on the position compensation method, the important area is increased in position weight, the important position defect influence is highlighted, the printing quality evaluation value is updated, and the qualified grade of the wine box is obtained. For example, if the printing quality update evaluation value is not less than the first update evaluation value threshold, the wine box is the first grade qualified product; if the printing quality update evaluation value is between the first update evaluation value threshold and the second update evaluation value threshold (the first update evaluation value threshold is greater than the second update evaluation value threshold), the wine box is the second grade qualified product; if the printing quality update evaluation value is not greater than the second update evaluation value threshold, the wine box is the third grade qualified product.
[0081] The updated printing quality evaluation value is realized by the following formula:
[0082]
[0083] Q2 is the printing quality update evaluation value; γ s is the position weight of the s-th color difference area, if the s-th color difference area belongs to the important area (for example, the wine box side decoration pattern area, the package joint), then θ s is the color difference area position compensation coefficient, is the initial position weight of the s-th color difference area, θ s >1; γ w is the position weight of the w-th stain area, if the w-th stain area belongs to the important area, then θ w is the stain area position compensation coefficient, is the initial position weight of the r-th stain area, θ w >1; γ h is the position weight of the h-th blur area, if the h-th blur area belongs to the important area, then γ h is the blur area position compensation coefficient, is the initial position weight of the h-th blur area, θ h >1; γ b is the position weight of the b-th missing printing area, if the b-th missing printing area belongs to the important area, then is the initial position weight of the b-th missing printing area, θ b is the missing printing area position compensation coefficient, θ b >1,
[0084] The embodiment also provides a printing quality evaluation method based on image recognition, which is used for realizing the printing quality evaluation method based on image recognition and comprises the following steps:
[0085] The wine box printing image generation module is configured to pre-process the to-be-inspected image to obtain a pre-processed image, obtain edge contour information of the wine box in the pre-processed image, and cut out the wine box printing image based on the edge contour information.
[0086] The printing defect recognition result generation module is configured to divide the wine box printing image into a plurality of printing sub-images according to different unfolded surfaces of the wine box, perform color difference detection, stain detection, blur detection and missing printing detection on each printing sub-image based on respective printing background information, count positions, quantities and areas of all color difference regions, all stain regions, all blur regions and all missing printing regions in all printing sub-images, and obtain a printing defect recognition result. The operation of the blur detection is as follows: non-smooth areas in the printing sub-image are screened out according to pixel gradient variance, the non-smooth areas in the printing sub-image are divided into grids, and blur grids are screened out based on the number of feature points in the grids and average pixel response values.
[0087] The wine box unqualified product recognition module is configured to determine whether a key defect exists in a key region of the wine box based on the printing defect recognition result, and determine that the wine box is an unqualified product if the key defect exists.
[0088] The wine box qualified level recognition module is configured to determine whether a defect exists in an important region based on the printing defect recognition result, obtain a qualified level of the wine box according to a printing quality evaluation value obtained based on the printing defect recognition result if the defect does not exist, and update the printing quality evaluation value based on a position compensation method and obtain the qualified level of the wine box if the defect exists.
[0089] The embodiment also provides a printing quality evaluation device based on image recognition, which comprises a processor and a memory.
[0090] The embodiment also provides a computer readable storage medium for storing a computer program, wherein the computer program is executed by a processor to implement the printing quality evaluation method based on image recognition.
[0091] The embodiment provides a printing quality evaluation method based on image recognition, first, the image to be detected is pretreated, and a wine box printing image is cut based on edge contour information, irrelevant information interference such as background is reduced, a printing area is focused, defect identification misjudgment and missing judgment are reduced, and defect identification and analysis speed is accelerated; then, according to different development surfaces of the wine box, the wine box printing image is segmented into a plurality of printing sub-images, based on different printing areas of different wine boxes and different printing background information, each printing sub-image is subjected to color difference detection, stain detection, blur detection and missing printing detection based on respective printing background information, interference between different areas is avoided, it is ensured that small defects are not missed, fine control of wine box printing detection is realized, positions, quantities and areas of all color difference, stain, blur and missing printing areas in all printing sub-images are counted, and a printing defect identification result is obtained; then, based on the printing defect identification result, it is judged whether there is a key defect in a key area of the wine box, fatal defects in the key area are screened first, and unqualified products are quickly positioned and eliminated; finally, based on the printing defect identification result, it is judged whether there is a defect in an important area, if there is, a position compensation fine printing quality evaluation value is used, an accurate quality classification result is obtained, and the method is used in wine box printing detection, has good detection effect, high efficiency and in-place quality control.
Claims
1. A printing quality assessment method based on image recognition, characterized in that: The following operations are included: S1. Preprocessing the image to be inspected to obtain a preprocessed image; obtaining edge contour information of the wine box in the preprocessed image, and extracting a printed image of the wine box based on the edge contour information; S2. Segment the printed image of the wine box into several printed sub-images based on the different unfolded surfaces of the wine box. Each printed sub-image is subjected to color difference detection, stain detection, blur detection, and missing print detection based on its respective printing background information. The location, number, and area of all color difference, stain, blur, and missing print areas in all printed sub-images are counted to obtain the printing defect recognition results. The fuzzy detection operation is as follows: the non-smooth area in the printed sub-image is screened out based on the pixel gradient variance, the non-smooth area in the printed sub-image is divided into a grid, and the fuzzy grid is screened out based on the number of feature points in the grid and the average pixel response value; Mark the corresponding position information of the fuzzy grid in the wine box printing image, and obtain the position, number and area of the fuzzy area; S3. Based on the printing defect recognition results, determine whether there are key defects in the key areas of the wine box; If it exists, the wine box is unqualified; If it does not exist, execute S4; S4; Based on the printing defect recognition results, determine whether there are defects in important areas; If not, obtain the qualified grade of the wine box according to the printing quality evaluation value obtained based on the printing defect recognition result; If it exists, the printing quality evaluation value is updated based on the position compensation method to obtain the qualified grade of the wine box.
2. The printing quality assessment method based on image recognition according to claim 1, characterized in that: In S1, the operation of extracting the wine box printed image is as follows: The preprocessed image is grayscaled and Gaussian filtered to obtain a denoised grayscale image; based on the pixel gradient distribution information of the denoised grayscale image, the edge points of the denoised grayscale image are extracted, and the corresponding positions of the edge points in the preprocessed image are the edge points of the wine box. After spline curve fitting, the edge contour of the wine box is obtained; in the preprocessed image, the edge contour of the wine box is expanded to obtain the safe edge contour of the wine box; after the safe edge contour of the wine box is generated by a binary mask, it is subjected to bit operation processing with the preprocessed image to obtain the wine box printing image.
3. The printing quality assessment method based on image recognition according to claim 1, characterized in that: In S2, the color difference detection process is as follows: The color space difference between the printed sub-image and the corresponding standard sub-image is mapped into a grayscale image. After binarization, connected domain processing is performed to obtain a color difference labeling map, and the position, number and area of the color difference regions of the printed sub-image are statistically obtained.
4. The printing quality assessment method based on image recognition according to claim 1, characterized in that: In S2, the operation of screening out fuzzy grids is: obtaining the number of feature points in each grid in the non-smooth area and the average response value of the feature points in the grid, and taking the grids whose number of feature points is less than the number threshold and whose average response value is less than the response value threshold as fuzzy grids.
5. The printing quality assessment method based on image recognition according to claim 4, characterized in that: The method for obtaining feature points is as follows: the pixel points in the grid whose pixel values are the extreme values of the neighborhood pixels after Gaussian blur processing at different scales are taken as key points; all key points form a key point set; the key points in the key point set whose contrast within the neighborhood range is less than the contrast threshold are deleted to obtain feature points.
6. The printing quality assessment method based on image recognition according to claim 1, characterized in that: In S2, the operation of missing print detection is as follows: obtaining a difference map between the printed sub-image and the corresponding standard printed sub-image, and taking the points in the difference map with difference values greater than the difference value threshold as missing print points; merging the missing print points in the neighborhood range to obtain a missing print mark map, and statistically obtaining the position, number and area of the missing print area.
7. The printing quality assessment method based on image recognition according to claim 1, characterized in that: In S4, the printing quality evaluation value is calculated using the following formula: Q1 is the printing quality evaluation value, They are the total area of color difference area, total area of stain area, total area of fuzzy area, total area of missing area, A s 、A w 、A h 、A b are the area of the sth color difference area, the area of the wth stain area, the area of the hth fuzzy area, and the area of the bth missing print area, respectively. S, W, H, and B are the total number of color difference areas, the total number of stain areas, the total number of fuzzy areas, and the total number of missing print areas, respectively. A is the total area of defective areas. α1, α2, α3, and α4 are the color difference weight, stain weight, fuzzy weight, and missing print weight, respectively. β is the defect number weight. N d is the total number of defects, N max The maximum value allowed for the total number of defects.
8. A printing quality assessment method based on image recognition, used to implement the printing quality assessment method based on image recognition according to claim 1, characterized in that: include: The wine box printing image generation module is used to pre-process the image to be inspected to obtain a pre-processed image; Obtain edge contour information of the wine box in the preprocessed image, and extract the printed image of the wine box based on the edge contour information; The printing defect identification result generation module is used to segment the wine box printed image into several printed sub-images based on the different unfolding surfaces of the wine box. Each printed sub-image is tested for color difference, stain, blur, and missing print based on its own printing background information. The location, number, and area of all color difference, stain, blur, and missing print areas in all printed sub-images are counted to obtain the printing defect identification results. The fuzzy detection operation is to filter out non-smooth areas in the printed sub-image based on the pixel gradient variance, divide the non-smooth areas into grids, and select fuzzy grids based on the number of feature points and average pixel response values within the grid. Mark the corresponding position information of the fuzzy grid in the wine box printing image, and obtain the position, number and area of the fuzzy area; The defective wine box identification module is used to determine whether there are critical defects in the key areas of the wine box based on the printing defect identification results; If it exists, the wine box is unqualified; If it does not exist, execute the wine box qualified grade identification module; The wine box qualified grade recognition module is used to determine whether there are defects in important areas based on the printing defect recognition results; If not, obtain the qualified grade of the wine box according to the printing quality evaluation value obtained based on the printing defect recognition result; If it exists, the printing quality evaluation value is updated based on the position compensation method to obtain the qualified grade of the wine box.
9. A printing quality assessment device based on image recognition, characterized in that: The system comprises a processor and a memory, wherein when the processor executes the computer program stored in the memory, the printing quality assessment method based on image recognition according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that Used to store a computer program, wherein when the computer program is executed by a processor, the printing quality assessment method based on image recognition according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Intelligent control system and method for perfect binding line image-text recognition and automatic waste discharge
CN121617108A
Cigarette packet surface printing defect detection method and system based on vision intelligence
CN121707971A