Computer Vision-Assisted Digital Printing Defect Detection Method and System

Through the digital printing defect detection method based on computer vision assistance, combined with sliding window and similarity calculation, the problem of low accuracy and reliability in digital printing product inspection is solved, and more efficient defect detection and product quality control is achieved.

CN119417819BActive Publication Date: 2025-06-10ZHEJIANG JINCHEN TEXTILE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510011905.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-06
Publication Date
2025-06-10
Estimated Expiration
2045-01-06

AI Technical Summary

Technical Problem

Digital printed products have low accuracy and reliability in defect detection, mainly because the template matching method is sensitive to geometric transformation of the detected image, resulting in false detection and missed detection.

Method used

Using a digital printing defect detection method based on computer vision assistance, the target printing image of the product to be detected is determined, the sliding window is determined, the similarity and deformation degree between the window area and the printing standard template is calculated, and the matching degree is determined, and the defect detection is performed based on the matching degree.

Benefits of technology

It improves the accuracy and reliability of defect detection of digital printed products, ensures that each local area is fully inspected, reduces false inspections and missed inspections, and improves the effect of product quality control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119417819B_ABST
    Figure CN119417819B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of image processing, and specifically relates to a digital printing defect detection method and system assisted by computer vision. The method includes: obtaining a target printing image of a digital printing product to be detected; determining a sliding window according to a preset printing standard template; determining the similarity between the window area and the printing standard template; determining the second deformation degree of the window area according to the first deformation degree, where the first deformation degree is the deformation degree of the printing pattern area of the target printing image located in the window area; determining the matching degree between the window area and the printing standard template according to the second deformation degree and the similarity; and performing defect detection on the target printing image of the digital printing product based on the matching degree between the window area and the printing standard template. The present invention improves the accuracy and reliability of defect detection for digital printing products.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and particularly relates to a method and system for detecting digital printing defects assisted by computer vision. Background Art

[0002] Digital printing is a new printing technology that directly prints patterns onto textiles using digital technology. Digital printing has the advantages of high precision, high efficiency, low energy consumption, and environmental protection. It is widely used in the fields of clothing, home, and decoration. However, during the production process, due to equipment problems and process errors, etc., digital printing products are prone to defects such as color difference, missing printing, and pattern misalignment, which seriously affect the product quality and market competitiveness. In order to ensure the product quality of digital printing products, it is particularly important to detect the defects of digital printing products.

[0003] In some scenarios, the template matching method is often used to detect digital printing defects. The template matching method discovers differences and determines defects by comparing the finished image of the digital printing product to be detected with a pre-set printing standard template. However, due to reasons such as the angle and distance during shooting, the image of the digital printing product to be detected may be deformed. And template matching is very sensitive to the geometric transformation of the image to be detected, and the geometric transformation of the image to be detected will have a greater impact on the detection accuracy. The visual deformation of the image of the digital printing product is not a problem of the printing pattern defect. It is only because of the visual deformation of the image of the digital printing product that the image to be detected is not completely consistent with the pre-set printing standard template, and false detection and missed detection may occur. Therefore, when performing template matching between the digital printing product to be detected and the pre-set printing standard template, the accuracy and reliability of the defect detection of the digital printing product are relatively low. Summary of the Invention

[0004] In order to solve the technical problem of relatively low accuracy and reliability of the defect detection of digital printing products, the purpose of the present invention is to provide a method and system for detecting digital printing defects assisted by computer vision, and the specific technical solutions adopted are as follows:

[0005] In a first aspect, an embodiment of the present invention provides a digital printing defect detection method based on computer vision assistance, including: obtaining a target printing image of a digital printing product to be detected; determining a sliding window according to a preset printing standard template; determining the similarity between the window area and the printing standard template according to the first pixel number of the color intensity of the window area of the target printing image located in the sliding window and the second pixel number of the color intensity of the printing standard template; determining the second deformation degree of the window area according to the first deformation degree, where the first deformation degree is the deformation degree of the printing pattern area of the target printing image located in the window area; determining the matching degree between the window area and the printing standard template according to the second deformation degree and the similarity; and performing defect detection on the target printing image of the digital printing product based on the matching degree between the window area and the printing standard template.

[0006] Optionally, determining the similarity between the window area and the printing standard template according to the first pixel number of the color intensity of the window area of the target printing image located in the sliding window and the second pixel number of the color intensity of the printing standard template includes: calculating a first ratio between the first pixel number and the third pixel number of all pixels in the window area, and a second ratio between the second pixel number and the fourth pixel number of all pixels of the printing standard template; performing an exponential operation on the first difference between the first ratio and the second ratio to obtain a color ratio; and averaging the color ratios of all color intensities in the window area to obtain the similarity between the window area and the printing standard template.

[0007] Optionally, determining the second deformation degree of the window area according to the first deformation degree includes: performing edge detection on the window area to obtain a segmentation area; determining the background representation degree of the segmentation area according to the gray value of the pixel points in the segmentation area, the first area of the segmentation area, and the second area of the target printing image; performing binarization processing on the segmentation area with the largest background representation degree to obtain the printing pattern area of the target printing image; determining the core color reference degree of the color intensity in the printing pattern area according to the third pixel number of the color intensity of the printing pattern area and the fourth pixel number of all pixels in the printing pattern area; selecting the center of the connected domain corresponding to the maximum value in the color reference degrees as the core point of the printing pattern area; determining the direction consistency of the printing pattern area according to the first included angle and the second included angle, where the first included angle is the included angle between the line connecting the core point in the printing pattern area and the adjacent core points on the left and right in the horizontal range and the horizontal line, and the second included angle is the included angle between the line connecting the core point in the printing pattern area and the adjacent core points above and below in the vertical range and the vertical line; determining the first deformation degree of the printing pattern area according to the direction consistency and the interval distance between adjacent core points in the printing pattern area; and determining the second deformation degree of the window area by using the first deformation degrees of each printing pattern area.

[0008] Optionally, determining the background manifestation degree of the segmentation region according to the gray value of the pixel points in the segmentation region, the first area of the segmentation region, and the second area of the target printed pattern image includes: calculating a third ratio between the first area and the second area, and calculating the variance of the gray values of all the pixel points in the segmentation region; performing an exponential operation on the variance to obtain an operation result; determining that the first product of the third ratio and the operation result is the background manifestation degree of the segmentation region.

[0009] Optionally, determining the core color reference degree of the color intensity in the printed pattern region according to the third pixel quantity of the color intensity in the printed pattern region and the fourth pixel quantity of all the pixels in the printed pattern region includes: calculating a fourth ratio between the third pixel quantity and the fourth pixel quantity; averaging the fourth ratios of each printed pattern region in the window region to obtain the core color reference degree of the color intensity in the printed pattern region.

[0010] Optionally, determining the direction consistency of the printed pattern region according to the first included angle and the second included angle includes: calculating a first average included angle of the first included angles corresponding to all the core points in the printed pattern region, and a second average included angle of the second included angles corresponding to all the core points in the printed pattern region; calculating the absolute value of a second difference between the first included angle of the current core point and the first average included angle, and the absolute value of a third difference between the second included angle of the current core point and the second average included angle; performing an exponential operation on the average value of the absolute value of the second difference and the absolute value of the third difference to obtain the direction consistency of the printed pattern region.

[0011] Optionally, determining the first deformation degree of the printed pattern region according to the direction consistency and the interval distance between adjacent core points in the printed pattern region includes: calculating the absolute value of a fourth difference between adjacent interval distances in the printed pattern region, and calculating the average value of the absolute values of the fourth differences between each adjacent interval distance; determining that the second product of the direction consistency and the average value is the first deformation degree of the printed pattern region.

[0012] Optionally, determining the matching degree between the window region and the printed standard template according to the second deformation degree and the similarity includes: determining that the third product of the second deformation degree and the similarity is the matching degree.

[0013] Optionally, performing defect detection on the target printed pattern image of the digital printed product based on the matching degree between the window region and the printed standard template includes: in the case where the matching degree is less than the threshold, marking the window region as a defective region.

[0014] Second aspect, an embodiment of the present invention provides a digital printing defect detection system based on computer vision assistance, including: a processor and a memory; wherein, the memory is used to store a computer program that can run on the processor; the processor is used to execute the program stored on the memory to implement the steps of the digital printing defect detection method based on computer vision assistance mentioned in the first aspect.

[0015] The present invention has the following beneficial effects: In the embodiment of the present invention, first, a target printing image of a digital printing product to be detected is obtained; then a sliding window is determined according to a preset printing standard template; then, according to the first pixel number of the color intensity of the window area of the target printing image located in the sliding window and the second pixel number of the color intensity of the printing standard template, the similarity between the window area and the printing standard template is determined; secondly, the second deformation degree of the window area is determined according to the first deformation degree, and the first deformation degree is the deformation degree of the printing pattern area of the target printing image located in the window area; and the matching degree between the window area and the printing standard template is determined according to the second deformation degree and the similarity; finally, defect detection is performed on the target printing image of the digital printing product based on the matching degree between the window area and the printing standard template.

[0016] In this way, in the process of defect detection of digital printing products in the embodiment of the present invention, the printing standard template can perform template matching with the target printing image of the digital printing product to be detected in the form of a sliding window, which helps to conduct a detailed analysis of the target printing image, ensuring that each local area in the target printing image can be fully inspected, thereby improving the accuracy of defect detection. Then, the similarity is calculated using the colors in the window area, which can effectively reflect the color distribution within the window area, thereby identifying the differences between the target printing image and the image of the printing standard template. And the embodiment of the present invention can determine the matching degree between the window area and the printing standard template by combining the deformation degree of the printing pattern area in the window area and the similarity, and perform defect detection according to this matching degree, further improving the accuracy and reliability of defect detection of digital printing products. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for description in the embodiments or the prior art. Obviously, the following described drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0018] Figure 1 It is a flowchart of a digital printing defect detection method based on computer vision assistance provided by an embodiment of the present invention;

[0019] Figure 2 Schematic diagram of the structure of an image acquisition device provided in an embodiment of the present invention;

[0020] Figure 3 Schematic diagram of images with different color intensities of a target printed pattern provided in an embodiment of the present invention;

[0021] Figure 4 Histogram of different color intensities of a target printed pattern provided in an embodiment of the present invention;

[0022] Figure 5 Schematic diagram of images with different color intensities of a printing standard template provided in an embodiment of the present invention;

[0023] Figure 6 Histogram of different color intensities of a printing standard template provided in an embodiment of the present invention;

[0024] Figure 7 Schematic diagram of a segmented region obtained by edge detection provided in an embodiment of the present invention;

[0025] Figure 8 Schematic diagram of the key points and partial connections of a printed pattern region provided in an embodiment of the present invention;

[0026] Figure 9 Schematic diagram of the structure of a digital printing defect detection system assisted by computer vision provided in an embodiment of the present invention. Detailed implementation manners

[0027] In order to further elaborate on the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following combines the accompanying drawings and preferred embodiments to detail the specific implementation manners, structures, features and effects of a digital printing defect detection method and system assisted by computer vision proposed according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures or characteristics in one or more embodiments can be combined in any suitable form.

[0028] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which the present invention belongs.

[0029] The following specifically describes the specific solutions of a digital printing defect detection method and system assisted by computer vision provided by the present invention with reference to the accompanying drawings.

[0030] Embodiment 1:

[0031] Please refer toFigure 1 , which shows a flowchart of a digital printing defect detection method assisted by computer vision provided in an embodiment of the present invention, including:

[0032] S101, obtaining a target printing image of a digital printing product to be detected.

[0033] Specifically, digital printing products are a process of directly printing patterns onto fabrics or other materials using digital technology. During the process, due to reasons such as equipment mechanical errors or fabric movement, the printing effect will be affected, resulting in defects such as color differences, blurring, and misalignment in the printed patterns. By collecting printing images in real time, computer vision technology can better detect printing defects. In the embodiment of the present invention, an industrial camera is used to photograph the digital printing product to obtain a printing image of the digital printing product. Then, preprocessing is performed on the printing image, such as performing Gaussian filtering on the printing image to reduce noise in the printing image. Then, the contrast of the printing image is enhanced through histogram equalization to highlight the details of the printing image, and a clear and uniform target printing image is obtained, reducing the influence of the external environment on defect detection.

[0034] Exemplarily, as Figure 2 shown, Figure 2 is a schematic structural diagram of an image acquisition device provided in an embodiment of the present invention. As Figure 2 shown, the image acquisition device includes a conveyor belt, a digital printing product, a camera, an image acquisition card, and a system, etc. The digital printing product can be placed on the conveyor belt, and the camera shoots perpendicular to the digital printing product. The height of the camera from the printing product should be appropriate. In the embodiment of the present invention, the height is set to 40 cm. In this way, it can not only cover a sufficient detection range but also ensure the image details of the digital printing product. The image acquisition card is used to process the printing image collected by the camera, and the system is used to set the sampling frequency of the camera. In the embodiment of the present invention, the sampling frequency should be adjusted according to the speed of the production line to ensure that clear images can also be collected during the movement of the digital printing product. In the embodiment of the present invention, the sampling frequency is set to 50 fps to ensure that the printing details of each digital printing product can be captured.

[0035] S102, determining a sliding window according to a preset printing standard template.

[0036] Specifically, the printed standard template refers to the standard print. By comparing the printed standard template with the target printed image of the digital printed product to be detected, the area with a lower matching degree may be the curved area. However, the template matching algorithm is sensitive to the pattern deformation of the target printed image. Due to the distance and angle of the camera shooting the printed image, the display effects of other printed pattern areas except directly below the camera in the image may vary, but this is not caused by defects and may be misdetected as defects. In addition, the printed fabric is prone to movement. During the defect detection process, when using the acquisition device shown in Figure 2 in the embodiments of the present invention, a device is used for fixing. During this process, the printed pattern may be subjected to a pulling force, resulting in deformation of the printed pattern. At the same time, due to the visual effect of objects being larger when closer and smaller when farther away, in the area of the printed image towards the edge, due to the shooting angle, there may be a gradual scaling. Therefore, the embodiments of the present invention adjust the matching situation between the printed pattern and the printed standard template according to the printing characteristics of the printed pattern.

[0037] Furthermore, the embodiments of the present invention set the size of the sliding window to be the same as the size of the printed standard template. The sliding window slides pixel by pixel in the target printed image, and the window area of the printed standard template covered by each sliding window is matched with the image in the printed standard template.

[0038] S103. Determine the similarity between the window area and the printed standard template according to the first pixel quantity of the color intensity of the window area of the target printed image located in the sliding window and the second pixel quantity of the color intensity of the printed standard template.

[0039] Specifically, the color intensity includes but is not limited to grayscale, R channel, G channel, and B channel, etc. To obtain the different color intensities of the target printed image and the printed standard template, the embodiments of the present invention process the target printed image and the printed standard template into grayscale images, R-channel images, G-channel images, B-channel images, etc. As Figure 3 shown, Figure 3 is a schematic diagram of images with different color intensities of a target printed image provided by an embodiment of the present invention, Figure 3 which includes the grayscale image, R-channel image, G-channel image, and B-channel image of the target printed image. As Figure 4 shown, Figure 4 is a histogram of images with different color intensities of a target printed image provided by an embodiment of the present invention, Figure 4 which respectively includes the grayscale histogram, R-channel histogram, G-channel histogram, and B-channel histogram of the target printed image. As Figure 5 shown, Figure 5Schematic diagram of images with different color intensities of a printing standard template provided by an embodiment of the present invention Figure 5 It includes the grayscale image of the printing standard template, the image of the R channel, the image of the G channel, and the image of the B channel. As Figure 6 shown Figure 6 Histogram of different color intensities of a printing standard template provided by an embodiment of the present invention Figure 6 It respectively includes the grayscale histogram of the printing standard template, the R channel histogram, the G channel histogram, and the B channel histogram, etc. It should be noted that there are a total of 256 RGB values for the target printing image and the images in the printing standard template

[0040] Furthermore, when determining the similarity between the window area and the printing standard template, as an optional embodiment of the present invention, first calculate the first ratio between the first pixel quantity and the third pixel quantity of all pixels in the window area, and the second ratio between the second pixel quantity and the fourth pixel quantity of all pixels in the printing standard template; then perform an exponential operation on the first difference between the first ratio and the second ratio to obtain the color ratio; finally, average the color ratios of all color intensities in the window area to obtain the similarity between the window area and the printing standard template

[0041] Specifically, the embodiment of the present invention calculates the similarity between the window area and the printing standard template using the following formula

[0042]

[0043] In the above formula represents the similarity between the th window area of the target printing image to be measured and the image of the printing standard template represents the first pixel quantity of the th color intensity in the th window area represents the total pixel quantity of the th window area, that is, the third pixel quantity represents the second pixel quantity of the th color intensity in the printing standard template represents the total pixel quantity of the printing standard template, that is, the fourth pixel quantity represents the proportion of the pixel quantity of the th color intensity in the th window area in the entire window area represents the proportion of the pixel quantity of the th color intensity in the printing standard template in the entire window area represents the The difference between the proportion of each window area corresponding to the same color intensity of the printed standard template. The smaller this formula is, the more similar the proportion of each color intensity of the window area of the target printed image to be measured and the image of the printed standard template, and the greater the similarity between the window area of the target printed image to be measured and the printed standard template. Represents the exponential function with the natural constant as the base.

[0044] S104. Determine the second deformation degree of the window area according to the first deformation degree.

[0045] Wherein, the first deformation degree is the deformation degree of the printed pattern area of the target printed image located in the window area.

[0046] Specifically, digital printed products are printed with the same color pattern repeatedly. The similarity between the window area of the target printed image to be measured and the image of the printed standard template is initially obtained according to the color histogram of the target printed product. However, due to the deformation and scaling of the printed image, there are differences in the color proportion between the printed image and the image in the printed standard template, or the color proportion of the background area is relatively high. Defect detection through color matching may not be accurate. Digital printing is formed by repeatedly arranging the same graphic elements. Vertically or horizontally, the repetition pattern of the pattern is uniform and rhythmic, and the overall direction is also the same. Even if the pattern undergoes geometric transformation or deformation caused by stretching, all image elements will change in the same direction, showing a consistent overall change.

[0047] Furthermore, when determining the second deformation degree of the window area, as an optional embodiment of the present invention, first perform edge detection on the window area to obtain a segmentation area; then determine the background manifestation degree of the segmentation area according to the gray value of the pixel points in the segmentation area, the first area of the segmentation area, and the second area of the target printed image; secondly, perform binarization processing on the segmentation area with the largest background manifestation degree to obtain the printed pattern area of the target printed image; and determine the core color reference degree of the color intensity in the printed pattern area according to the third pixel number of the color intensity in the printed pattern area and the fourth pixel number of all pixels in the printed pattern area; then select the center of the connected domain of the color intensity corresponding to the maximum value in the color reference degree as the core point of the printed pattern area; and determine the direction consistency of the printed pattern area according to the first included angle and the second included angle. The first included angle is the included angle between the line connecting the core point in the printed pattern area and the adjacent core points on the left and right within the horizontal range and the horizontal line, and the second included angle is the included angle between the line connecting the core point in the printed pattern area and the adjacent core points above and below within the vertical range and the vertical line; finally, determine the first deformation degree of the printed pattern area according to the direction consistency and the interval distance between adjacent core points in the printed pattern area; and determine the second deformation degree of the window area by using the first deformation degree of each printed pattern area.

[0048] Specifically, in the embodiments of the present invention, in order to exclude the interference of the background area and analyze the arrangement rules and directions of the printing patterns, the target printing image to be detected is subjected to region segmentation, and only the printing patterns in the target printing image are retained. Therefore, the Sobel two-way edge detection is performed on the target printing image to be detected to segment the region, and the segmented region includes a printing pattern region and a background region. For the segmented region segmented by edge detection, the background interference is excluded. When excluding the background interference, the background manifestation degree of each segmented region can be calculated. The greater the background manifestation degree, the greater the possibility that the segmented region is the background region. Then, the segmented region with the largest background manifestation degree is binarized to obtain the printing pattern region. Exemplarily, as Figure 7 shown, Figure 7 is a schematic diagram of the segmented region obtained by edge detection provided by an embodiment of the present invention, which includes a printing pattern region 701 and a background region 702.

[0049] Further, when determining the background manifestation degree of the segmented region, as an optional embodiment of the present invention, first, the third ratio between the first area and the second area is calculated, and the variance of the gray values of all pixel points in the segmented region is calculated; then, an exponential operation is performed on the variance to obtain an operation result; finally, the first product of the third ratio and the operation result is determined as the background manifestation degree of the segmented region.

[0050] Specifically, the embodiments of the present invention can calculate the background manifestation degree of the segmented region by the following formula:

[0051]

[0052] In the above formula, represents the background manifestation degree of the th segmented region in the target printing image to be detected. represents the th segmented region's first area, that is, the total number of pixel points in the th segmented region. represents the second area of the target printing image to be detected, that is, the total number of pixels in the target printing image. represents the th segmented region's variance of the gray values of all pixel points. The smaller the variance, the more uniform the color of the segmented region and the more likely it is the background region. represents the th segmented region's proportion in the target printing image to be detected. The larger the ratio, the greater the background manifestation degree of the segmented region. represents the exponential function, which is used to perform an exponential operation on .

[0053] Further, the segmentation region with the maximum background representation degree in the segmentation regions is binarized, and only the printed pattern region is retained in the target printed image to be measured.

[0054] Further, based on the target printed image to be measured from which the background region has been removed through binarization, the arrangement regularity of the printed patterns in the target printed image is analyzed to obtain the distribution characteristics of each window region. First, it is necessary to analyze the arrangement and direction of the printed pattern regions in the target printed image to be detected. First, confirm the position of the core point of the printed pattern region, and confirm the distribution of the printed patterns through the arrangement of the core points. Select the center of the region with the largest color proportion in the printed pattern region of the entire target printed image to be measured as the core point of each printed pattern region. When calculating the core color reference degree of the color intensity in the printed pattern region, as an optional embodiment of the present invention, first calculate the fourth ratio between the third pixel quantity and the fourth pixel quantity; then average the fourth ratios of the printed pattern regions in the window region to obtain the core color reference degree of the color intensity in the printed pattern region.

[0055] Specifically, the embodiment of the present invention calculates the core color reference degree using the following formula:

[0056]

[0057] In the above formula, represents the core color reference degree of the th color intensity in the printed pattern region. represents the number of printed pattern regions in the target printed image to be measured. represents the rd printed pattern region and the th color intensity of the third pixel quantity. represents the th printed pattern region and the total pixel quantity, that is, the fourth pixel quantity. represents the rd printed pattern region and the th color intensity of the pixel proportion in the printed pattern region. The larger this formula is, the more representative the color intensity is. represents the average representativeness of the th color intensity in all printed segmentation pattern regions. The larger this formula is, the greater the core color reference degree of the color intensity.

[0058] Further, select the color intensity of max as the reference, and use the center of the connected domain of this color intensity in each printed pattern region as the core point of the printed pattern region.

[0059] Further, digital printing patterns are usually horizontal and vertical, or due to the pulling of the fixing device, there may be a slight angular deviation. For the connection lines of adjacent core points within ten degrees of horizontal and vertical directions, observe their alignment. The printing patterns without pattern shift defects have the same arrangement direction. As Figure 8 shown, Figure 8 Figure 4 shows a schematic diagram of the core points and some connection lines in a printing pattern area provided by an embodiment of the present invention. As Figure 8 shown, each core point has at least one adjacent core point. According to the connection conditions within the horizontal and vertical ranges of the core points, the direction consistency of each printing pattern area is obtained.

[0060] Further, when determining the direction consistency of the printing pattern area, as an optional embodiment of the present invention, first calculate the first average angle of the first included angles corresponding to all the core points in the printing pattern area, and the second average angle of the second included angles corresponding to all the core points in the printing pattern area; then calculate the absolute value of the second difference between the first included angle of the current core point and the first average angle, and the absolute value of the third difference between the second included angle of the current core point and the second average angle; finally, perform an exponential operation on the average value of the absolute value of the second difference and the absolute value of the third difference to obtain the direction consistency of the printing pattern area.

[0061] Specifically, in the embodiment of the present invention, the following formula is used to calculate the direction consistency of the printing pattern area:

[0062]

[0063] In the above formula, represents the direction consistency of the th printing pattern area. represents the first included angle between the connection line of the core point of the th printing pattern area and the right adjacent core point within the horizontal range and the horizontal line. represents the first average angle of the first included angles of all the core points of the th printing pattern area within the horizontal range. represents the second included angle between the connection line of the core point of the th printing pattern area and the lower adjacent core point within the vertical range and the vertical line. represents the second average angle of the second included angles of all the core points of the th printing pattern area within the vertical range. represents the difference between the first included angle and the first average angle of the th printing pattern area within the horizontal range. The smaller this formula is, the greater the direction consistency of the printing pattern area. Represents the difference between the second included angle and the second average included angle within the longitudinal range of the th printed pattern area. The smaller this formula is, the greater the directional consistency of the printed pattern area. Represents an exponential function, which is used to perform exponential operations on .

[0064] Furthermore, when each printed pattern area is deformed due to external force, there will be differences in the spacing distances in the horizontal or vertical directions. Therefore, according to the changes in the distance intervals in different directions, it is determined whether there is a possibility of deformation in each printed pattern area, that is, the first degree of deformation. When determining the first degree of deformation of the printed pattern area, as an alternative embodiment of the present invention, first calculate the absolute value of the fourth difference between adjacent spacing distances in the printed pattern area, and calculate the average value of the absolute values of the fourth differences between adjacent spacing distances; then determine that the second product of the directional consistency and the average value is the first degree of deformation of the printed pattern area.

[0065] Specifically, the embodiment of the present invention uses the following formula to calculate the first degree of deformation of the printed pattern area:

[0066]

[0067] In the above formula, Represents the first degree of deformation of the th printed pattern area. Represents the directional consistency of the th printed pattern area. The larger this value is, the smaller the possibility that the printed pattern area is a defect shift. Represents the number of spacing distances between all adjacent core points within the horizontal and vertical ranges of each printed pattern area. Represents the th distance interval within the horizontal and vertical ranges of the th printed pattern area. Represents the th distance interval within the horizontal and vertical ranges of the th printed pattern area. Represents the difference between adjacent distance intervals within the horizontal and vertical ranges of the th printed pattern area. The larger this formula is, the greater the possibility that the printed pattern area shows a consistent transformation in the overall direction, is not a separate shift defect, and is deformed due to external force.

[0068] Furthermore, after determining the first degree of deformation of each printed pattern area, the average value of the first degrees of deformation of each printed pattern area is obtained to get the second degree of deformation of the window area. The embodiment of the present invention uses the following formula to calculate the second degree of deformation of the window area:

[0069]

[0070] In the above formula, represents the second degree of deformation of the th window area. represents the number of printed pattern areas within each window area. represents the first degree of deformation of the th printed pattern area. When the degrees of deformation of all printed pattern areas within the window area are relatively large, it indicates that the degree of deformation of the window area is greater.

[0071] S105. Determine the matching degree between the window area and the printed standard template according to the second degree of deformation and the similarity.

[0072] Specifically, in the process of performing template matching on the target printed image to be detected, in order to prevent the fabric from being deformed due to pulling or the influence of the camera angle, which may interfere with the defect detection of the target printed image to be detected, according to the color histogram of the target printed image of the digital printing product, obtain the similarity between the window area and the image of the printed standard template. Due to deformation and scaling, there will be abnormalities in the color proportion. Usually, the color proportion of the background area expands, resulting in an area being misidentified as a defective area, causing false detection. Therefore, according to the degree of deformation of the printed pattern area, make adjustments to reduce the possibility of false detection.

[0073] Furthermore, when determining the matching degree between the window area and the printed standard template, as an optional embodiment of the present invention, determine the third product between the second degree of deformation and the similarity as the matching degree.

[0074] Specifically, the embodiment of the present invention calculates the matching degree using the following formula:

[0075]

[0076] represents the matching degree between the th window area in the target printed image to be detected and the printed standard template. represents the similarity between the th window area in the target printed image to be detected and the printed standard template. represents the second degree of deformation of the th window area.

[0077] Through the regularity of the arrangement of the printed patterns, due to the reason that the regular deformation is still maintained after being affected by the interference factors, obtain the final matching degree between the window area and the printed standard template in each target printed image to be detected. The smaller the matching degree, the greater the possibility that there are defects in the window area.

[0078] S106, perform defect detection on the target printed image of the digital printing product based on the matching degree between the window area and the printing standard template.

[0079] Specifically, when performing defect detection on the target printed image, as an optional embodiment of the present invention, in the case where the matching degree is less than the threshold, the window area is marked as a defective area.

[0080] Wherein, the present invention sets the threshold value to 0.8. When the matching degree between a certain window area and the printing standard template is lower than 0.8, the window area is marked as a defective area. It can be marked with a border or different colors on the target printed image. Clearly display each suspicious window area, confirm the defect type, analyze the color histogram of each window area, judge whether there is a color significantly different from the surrounding area, and check the integrity of the printed pattern. Judge whether there is a problem that part of the printed pattern is not printed or printed unevenly. By comparing the position relationship between the pattern in the printed pattern area and the printing standard template, judge whether the printed pattern is misaligned, etc., and record the coordinates and size and other information of each defective area for subsequent repair or quality tracking.

[0081] In the process of defect detection of the digital printing product in the embodiment of the present invention, the printing standard template can perform template matching with the target printed image of the digital printing product to be detected in the form of a sliding window, which helps to perform a detailed analysis of the target printed image, ensure that each local area in the target printed image can be fully inspected, and thus improve the accuracy of defect detection. Then, the similarity is calculated using the colors in the window area, which can effectively reflect the color distribution in the window area, thereby identifying the differences between the target printed image and the image of the printing standard template. And the embodiment of the present invention can determine the matching degree between the window area and the printing standard template in combination with the deformation degree and similarity of the printed pattern area in the window area, and perform defect detection according to the matching degree, further improving the accuracy and reliability of the defect detection of the digital printing product.

[0082] Embodiment 2:

[0083] Corresponding to the digital printing defect detection method assisted by computer vision provided in the above embodiment, based on the same technical concept, the embodiment of the present invention also provides a digital printing defect detection system assisted by computer vision. The digital printing defect detection system assisted by computer vision is used to execute the above digital printing defect detection method assisted by computer vision. Figure 9 The structural schematic diagram of a digital printing defect detection system assisted by computer vision provided by an embodiment of the present invention is as Figure 9The computer vision-assisted digital printing defect detection system may have relatively large differences due to different configurations or performances, and may include one or more processors 901 and memory 902, the memory 902 is used to store computer programs that can be run on the processor 901, and the processor 901 is used to execute the program stored in the memory 902 to achieve the above Figure 1 The various steps in the method embodiment. The memory 902 may be a temporary storage or a permanent storage. The application stored in the memory 902 may include one or more modules (not shown in the figure), each of which may include a series of computer executable instructions in the digital printing defect detection system based on computer vision assistance.

[0084] Furthermore, the processor 901 can be configured to communicate with the memory 902 to execute a series of computer executable instructions in the memory 902 on the computer vision-assisted digital printing defect detection system. The computer vision-assisted digital printing defect detection system can also include one or more power supplies 903, one or more wired or wireless network interfaces 904, one or more input and output interfaces 905, and one or more keyboards 906.

[0085] Specifically in this embodiment, the digital printing defect detection system based on computer vision assistance includes a processor, a communication interface, a memory and a communication bus; wherein the processor, the communication interface and the memory communicate with each other through the bus; the memory is used to store computer programs; the processor is used to execute the programs stored in the memory to achieve the above Figure 1 The various steps in the method embodiment are similar to those in the method embodiment, and have the beneficial effects of the above method embodiments. To avoid repetition, the embodiments of the present invention will not be described in detail here.

[0086] It should be noted that the digital printing defect detection system based on computer vision assistance provided in an embodiment of the present invention and the digital printing defect detection method based on computer vision assistance provided in an embodiment of the present invention are based on the same application concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the aforementioned digital printing defect detection method based on computer vision assistance, and has the same or similar beneficial effects, and the repetitive parts will not be repeated.

[0087] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0088] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other, and the key point of each embodiment is to illustrate the differences from other embodiments.

Claims

1. A digital printing defect detection method based on computer vision, characterized in that: The computer vision-assisted digital printing defect detection method includes: Acquire a target printing image of a digital printing product to be inspected; Determine the sliding window according to a pre-set printing standard template; Determine the similarity between the window area and the print standard template according to a first pixel number of the color intensity of the window area of ​​the target print image located in the sliding window and a second pixel number of the color intensity of the print standard template; Determining a second deformation degree of the window area according to the first deformation degree, wherein the first deformation degree is a deformation degree of a print pattern area of ​​the target print image located in the window area; determining a degree of matching between the window area and the printing standard template according to the second deformation degree and the similarity; Performing defect detection on the target printing image of the digital printing product based on the matching degree between the window area and the printing standard template; Determining the second deformation degree of the window area according to the first deformation degree comprises: Performing edge detection on the window area to obtain a segmented area; Determine the background representation degree of the segmented area according to the grayscale value of the pixel point in the segmented area, the first area of ​​the segmented area and the second area of ​​the target printed image; Binarization is performed on the segmented area with the largest background expression degree to obtain the printed pattern area of ​​the target printed image; Determining a core color reference degree of the color intensity in the printed pattern area according to a third pixel number of the color intensity in the printed pattern area and a fourth pixel number of all pixels in the printed pattern area; Selecting the center of the connected domain of color intensity corresponding to the maximum value in the color reference degree as the core point of the printed pattern area; Determine the directional consistency of the printed pattern area according to a first angle and a second angle, wherein the first angle is the angle between a line connecting a core point in the printed pattern area with adjacent core points on the left and right in a horizontal range and a horizontal straight line, and the second angle is the angle between a line connecting a core point in the printed pattern area with adjacent core points on the top and bottom in a vertical range and a vertical straight line; Determining a first deformation degree of the printed pattern area according to the directional consistency and the spacing distance between adjacent core points in the printed pattern area; Determining the second deformation degree of the window area by using the first deformation degree of each of the printed pattern areas; The method for determining the background expression degree of the segmented area includes: Calculating a third ratio between the first area and the second area, and calculating a variance of the grayscale values ​​of all pixels in the segmented area; Performing an exponential operation on the variance to obtain an operation result; A first product of the third ratio and the operation result is determined as the background representation degree of the segmented area.

2. The computer vision-assisted digital printing defect detection method according to claim 1, characterized in that: Determining the similarity between the window area and the print standard template according to the first pixel number of the color intensity of the window area of ​​the target print image located in the sliding window and the second pixel number of the color intensity of the print standard template comprises: Calculating a first ratio between the first number of pixels and a third number of pixels of all pixels in the window area, and a second ratio between the second number of pixels and a fourth number of pixels of all pixels of the printing standard template; Performing an exponential operation on a first difference between the first ratio and the second ratio to obtain a color ratio; The color ratios of all color intensities in the window area are averaged to obtain the similarity between the window area and the printing standard template.

3. The computer vision-assisted digital printing defect detection method according to claim 1, characterized in that: Determining the core color reference of the color intensity in the printed pattern area according to the third pixel number of the color intensity in the printed pattern area and the fourth pixel number of all pixels in the printed pattern area comprises: calculating a fourth ratio between the third number of pixels and the fourth number of pixels; The fourth ratios of the printed pattern areas in the window area are averaged to obtain a core color reference of the color intensity in the printed pattern area.

4. The computer vision-assisted digital printing defect detection method according to claim 1, characterized in that: Determining the directional consistency of the printed pattern area according to the first angle and the second angle includes: Calculating a first average angle of first angles corresponding to all core points in the printed pattern area, and a second average angle of second angles corresponding to all core points in the printed pattern area; Calculate an absolute value of a second difference between a first angle of a current core point and the first average angle, and an absolute value of a third difference between a second angle of the current core point and the second average angle; An exponential operation is performed on the average of the absolute value of the second difference and the absolute value of the third difference to obtain the directional consistency of the printed pattern area.

5. The computer vision-assisted digital printing defect detection method according to claim 1, characterized in that: The step of determining the first deformation degree of the printed pattern area according to the directional consistency and the spacing distance between adjacent core points in the printed pattern area comprises: Calculating the absolute value of the fourth difference between adjacent spacing distances in the printed pattern area, and calculating the average value of the absolute value of the fourth difference between each adjacent spacing distance; A second product of the directional consistency and the average value is determined as a first deformation degree of the printed pattern area.

6. The computer vision-assisted digital printing defect detection method according to claim 1, characterized in that: Determining the matching degree between the window area and the printing standard template according to the second deformation degree and the similarity includes: A third product between the second deformation degree and the similarity is determined as the matching degree.

7. The computer vision-assisted digital printing defect detection method according to claim 1, characterized in that: The performing defect detection on the target printing image of the digital printing product based on the matching degree between the window area and the printing standard template comprises: When the matching degree is less than a threshold, the window area is marked as a defect area.

8. A computer vision-assisted digital printing defect detection system, characterized in that: The digital printing defect detection system based on computer vision assistance includes: a processor and a memory; wherein the memory is used to store computer programs that can be run on the processor; the processor is used to execute the program stored in the memory to implement the steps of the digital printing defect detection method based on computer vision assistance as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Method for recognizing patterns of blueprint cloth

    CN103871084A

  • Packaging machine defective product detection method based on machine vision

    CN115272341A