Digital printing defect detection method and system based on computer vision assistance
Through the digital printing defect detection method based on computer vision assistance, using sliding windows and color intensity analysis, the problem of low accuracy and reliability in digital printing product inspection is solved, and more efficient defect detection is achieved.
Patent Information
- Application Number
- CN202510011905.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-06
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2045-01-06
AI Technical Summary
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.
Using a digital printing defect detection method based on computer vision assistance, the target printing image of the product to be detected is determined, and the similarity and matching degree are calculated based on the color intensity and deformation degree of the image to be detected, and defect detection is performed.
It improves the accuracy and reliability of defect detection of digital printed products, ensures that each local area is fully inspected, and reduces the possibility of false detection and missed detection.
Smart Images

Figure CN119417819A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a digital printing defect detection method and system based on computer vision assistance. Background Art
[0002] Digital printing is a new printing technology that uses digital technology to print patterns directly onto textiles. Digital printing has the advantages of high precision, high efficiency, low energy consumption and environmental protection. It is widely used in clothing, home furnishings and decoration. However, during the production process, due to equipment problems and process errors, digital printing products are prone to defects such as color difference, missing printing and pattern dislocation, which seriously affect product quality and market competitiveness. In order to ensure the product quality of digital printing products, it is particularly important to perform defect detection on digital printing products.
[0003] In some scenarios, template matching methods are often used to detect digital printing defects. The template matching method is to find differences and determine defects by comparing the finished image of the digital printing product to be detected with the pre-set printing standard template. However, due to the angle and distance during shooting, the image of the digital printing product to be detected may be deformed. 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 great impact on the accuracy of the detection. The visual deformation of the image of the digital printing product does not cause the problem of printing pattern defects. It is only because of the visual deformation of the image of the digital printing product, which causes the image to be detected to be inconsistent with the pre-set printing standard template, and may cause false detection and missed detection. Therefore, when template matching is performed between the digital printing product to be detected and the pre-set printing standard template, the accuracy and reliability of defect detection of digital printing products are low. Summary of the invention
[0004] In order to solve the technical problem of low accuracy and reliability of defect detection of digital printing products, the purpose of the present invention is to provide a digital printing defect detection method and system based on computer vision assistance. The technical solution adopted is as follows: 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 print image of a digital printing product to be detected; determining a sliding window according to a preset print standard template; determining the similarity between the window area and the print standard template according to the first number of pixels of color intensity of the window area of the target print image located in the sliding window and the second number of pixels of color intensity of the print standard template; determining a second deformation degree of the window area according to a first deformation degree, the first deformation degree being the deformation degree of a print pattern area of the target print image located in the window area; determining a matching degree between the window area and the print standard template according to the second deformation degree and the similarity; and performing defect detection on the target print image of the digital printing product based on the matching degree between the window area and the print standard template.
[0005] Optionally, determining the similarity between the window area and the print standard template based on a first pixel number of color intensity of the target print image located in the window area of the sliding window and a second pixel number of color intensity of the print standard template includes: calculating a first ratio between the first pixel number and a third pixel number of all pixels in the window area, and a second ratio between the second pixel number and a fourth pixel number of all pixels in the print standard template; performing an exponential operation on a 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 print standard template.
[0006] 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 segmented area; determining the background expression degree of the segmented area according to the grayscale value of the pixel points in the segmented area, the first area of the segmented area and the second area of the target printed image; binarizing the segmented area with the largest background expression degree to obtain the printed pattern area of the target printed image; determining the core color reference degree of the color intensity in the printed pattern area according to the third pixel number of the color intensity of the printed pattern area and the fourth pixel number of all pixels in the printed pattern area; selecting 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; determining the directional consistency of the printed pattern area according to a first angle and a second angle, the first angle being the angle between the line connecting the core point in the printed pattern area with the left and right adjacent core points in the horizontal range and the horizontal straight line, and the second angle being the angle between the line connecting the core point in the printed pattern area with the upper and lower adjacent core points in the vertical range and the horizontal straight line; 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; and determining the second deformation degree of the window area using the first deformation degree of each printed pattern area.
[0007] Optionally, determining the background expression degree of the segmented area based on the grayscale value of the pixel points in the segmented area, the first area of the segmented area and the second area of the target printed image includes: calculating a third ratio between the first area and the second area, and calculating the variance of the grayscale values of all the pixels in the segmented area; performing an exponential operation on the variance to obtain an operation result; and determining a first product of the third ratio and the operation result as the background expression degree of the segmented area.
[0008] Optionally, determining the core color reference degree of color intensity in the printed pattern area based on the third pixel number of color intensity in the printed pattern area and the fourth pixel number of all pixels in the printed pattern area includes: calculating a fourth ratio between the third pixel number and the fourth pixel number; averaging the fourth ratios of each printed pattern area in the window area to obtain the core color reference degree of color intensity in the printed pattern area.
[0009] Optionally, determining the directional consistency of the printed pattern area based on the first angle and the second angle includes: calculating a first average angle of the first angle corresponding to all core points in the printed pattern area, and a second average angle of the second angle corresponding to all core points in the printed pattern area; calculating the absolute value of the second difference between the first angle of the current core point and the first average angle, and the absolute value of the third difference between the second angle of the current core point and the second average angle; performing an exponential operation on the average of the absolute values of the second difference and the absolute values of the third difference to obtain the directional consistency of the printed pattern area.
[0010] Optionally, determining the first deformation degree of the printed pattern area based on the directional consistency and the spacing distance between adjacent core points in the printed pattern area includes: 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 values of the fourth difference between each adjacent spacing distance; determining the second product of the directional consistency and the average value as the first deformation degree of the printed pattern area.
[0011] Optionally, determining the degree of match between the window area and the printing standard template according to the second deformation degree and the similarity includes: determining a third product between the second deformation degree and the similarity as the degree of match.
[0012] Optionally, performing defect detection on a target printing image of a digital printing product based on a matching degree between the window area and a printing standard template includes: marking the window area as a defective area when the matching degree is less than a threshold value.
[0013] In the second aspect, an embodiment of the present invention provides a digital printing defect detection system based on computer vision assistance, comprising: a processor and a memory; wherein the memory is used to store a computer program 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 mentioned in the first aspect.
[0014] The present invention has the following beneficial effects: an embodiment of the present invention first acquires a target print image of a digital print product to be detected; then determines a sliding window according to a preset print standard template; then determines 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; secondly determines the second deformation degree of the window area according to the first deformation degree, the first deformation degree being the deformation degree of the print pattern area of the target print image located in the window area; and determines the matching degree between the window area and the print standard template according to the second deformation degree and the similarity; finally, based on the matching degree between the window area and the print standard template, defects of the target print image of the digital print product are detected.
[0015] 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 be template matched 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 and ensure that each local area in the target printing image can be fully inspected, thereby improving the accuracy of defect detection. Then, the color in the window area is used to perform similarity calculation, which can effectively reflect the color distribution in the window area, thereby identifying the difference between the target printing image and the image of the printing standard template. In addition, 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 printing pattern area in the window area, and perform defect detection according to the matching degree, further improving the accuracy and reliability of defect detection of digital printing products. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 A flowchart of a digital printing defect detection method based on computer vision assistance provided by an embodiment of the present invention; Figure 2 A schematic diagram of the structure of an image acquisition device provided by one embodiment of the present invention; Figure 3 A schematic diagram of an image with different color intensities of a target printed image provided by one embodiment of the present invention; Figure 4 A histogram of different color intensities of a target printed image provided by one embodiment of the present invention; Figure 5 A schematic diagram of images of different color intensities of a printing standard template provided by one embodiment of the present invention; Figure 6 A histogram of different color intensities of a printing standard template provided by one embodiment of the present invention; Figure 7 A schematic diagram of a segmented area obtained by edge detection according to an embodiment of the present invention; Figure 8 A schematic diagram of core points and some connecting lines of a printed pattern area provided by an embodiment of the present invention; Fig. 9 A schematic structural diagram of a computer vision-assisted digital printing defect detection system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0018] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of a computer vision-assisted digital printing defect detection method and system proposed by the present invention, its specific implementation, structure, features and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0019] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0020] The following is a detailed description of a computer vision-assisted digital printing defect detection method and system provided by the present invention in conjunction with the accompanying drawings.
[0021] Embodiment 1: See also Figure 1 , which shows a flow chart of a digital printing defect detection method based on computer vision assistance provided by an embodiment of the present invention, including: S101, obtaining a target printing image of a digital printing product to be inspected.
[0022] Specifically, digital printing products are a process that uses digital technology to print patterns directly onto fabrics or other materials. During the process, mechanical errors of the equipment or movement of the fabric will affect the printing effect, resulting in defects such as color difference, blur and misalignment of the printed pattern. By collecting the printed image in real time, computer vision technology can be used to better detect printing defects. In an embodiment of the present invention, an industrial camera is used to shoot a digital printing product to obtain a printed image of the digital printing product. The printed image is then preprocessed, such as performing Gaussian filtering on the printed image to reduce the noise in the printed image. The contrast of the printed image is then enhanced by histogram equalization, the details of the printed image are highlighted, a clear and uniform target printed image is obtained, and the influence of the external environment on defect detection is reduced.
[0023] For example, Figure 2 As shown, Figure 2 A schematic diagram of the structure of an image acquisition device provided by an embodiment of the present invention is shown in FIG. Figure 2 As shown, the image acquisition device includes a conveyor belt, a digital printing product, a camera, an image acquisition card, and a system. The digital printing product can be placed on the conveyor belt, and the camera is perpendicular to the digital printing product for shooting. The height between the camera and the printing product should be moderate. In the embodiment of the present invention, the height is set to 40cm, so that it can cover a sufficient detection range and ensure the image details of the digital printing product. The image acquisition card is used to process the printing image captured 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 the digital printing product can capture clear images in motion. In the embodiment of the present invention, the sampling frequency is set to 50fps to ensure that the printing details of each digital printing product can be captured.
[0024] S102, determining a sliding window according to a preset printing standard template.
[0025] Specifically, the standard printing template refers to a standard printing. By comparing the standard printing template with the target printing image of the digital printing product to be detected, the area with a low matching degree may be a curved area. However, the template matching algorithm is sensitive to the pattern deformation of the target printing image. Due to the distance and angle at which the camera shoots the printing image, the display effect of other printing pattern areas except those directly below the camera may be different in the image. This is not caused by defects, but may be mistakenly detected as defects. In addition, printed fabrics are easy to move. In the process of defect detection, the use of the embodiments of the present invention may cause the printing fabric to move easily. Figure 2When the collection device shown is used, a device is used to fix it. During this process, the printed pattern may be subjected to a pulling force, causing the printed pattern to deform. At the same time, due to the visual effect of near large and far small, in the area toward the edge of the printed image, due to the shooting angle, a gradual zoom may appear. Therefore, according to the printing characteristics of the printed pattern, the embodiment of the present invention adjusts the matching of the printed pattern with the printed standard template.
[0026] Furthermore, an embodiment of the present invention sets the size of the sliding window to be the size of the print standard template, and the sliding window slides pixel by pixel in the target print image to match the window area of the print standard template covered by each sliding window with the image in the print standard template.
[0027] S103, 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.
[0028] Specifically, color intensity includes but is not limited to grayscale, R channel, G channel, and B channel. In order to obtain different color intensities of the target printing image and the printing standard template, the embodiment of the present invention processes the target printing image and the printing standard template into grayscale images, R channel images, G channel images, and B channel images, respectively. Figure 3 As shown, Figure 3 A schematic diagram of an image with different color intensities of a target printed image provided by an embodiment of the present invention, Figure 3 The image includes the grayscale image of the target printing image, the image of the R channel, the image of the G channel, and the image of the B channel. Figure 4 As shown, Figure 4 A histogram of different color intensities of a target printed image provided by an embodiment of the present invention, Figure 4 The grayscale histogram, R channel histogram, G channel histogram and B channel histogram of the target printing image are included. Figure 5 As shown, Figure 5 A schematic diagram of images of different color intensities of a printing standard template provided by an embodiment of the present invention, Figure 5 The image 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. Figure 6 As shown, Figure 6 A histogram of different color intensities of a printing standard template provided by an embodiment of the present invention, Figure 6 The grayscale histogram, R channel histogram, G channel histogram and B channel histogram of the printing standard template are included. It is worth noting that the RGB values of the target printing image and the image in the printing standard template have a total of 256 values.
[0029] Furthermore, when determining the similarity between the window area and the print standard template, as an optional embodiment of the present invention, firstly, a first ratio between the first number of pixels and the third number of pixels of all pixels in the window area, and a second ratio between the second number of pixels and the fourth number of pixels of all pixels of the print standard template are calculated; then, an exponential operation is performed on the first difference between the first ratio and the second ratio to obtain the color ratio; finally, the color ratios of all color intensities in the window area are averaged to obtain the similarity between the window area and the print standard template.
[0030] Specifically, the embodiment of the present invention uses the following formula to calculate the similarity between the window area and the printing standard template: ;
[0031] In the above formula, Indicates the first The similarity between the image of the window area and the printed standard template. Indicates The first window area The number of first pixels with the same color intensity. Indicates The total number of pixels in the window area, that is, the third number of pixels. Indicates the first The number of second pixels with the same color intensity. Indicates the total number of pixels of the printing standard template, that is, the fourth pixel number. Indicates The first window area The color intensity is the percentage of pixels in the entire window area. Indicates the first The color intensity is the percentage of pixels in the entire window area. The target stamp image The smaller the formula is, the more similar the proportions of the window area of the target print image to be tested and the image of the print standard template are, and the greater the similarity between the window area of the target print image to be tested and the print standard template is. Represents an exponential function with a natural constant as its base.
[0032] S104, determining a second deformation degree of the window area according to the first deformation degree.
[0033] The first deformation degree is the deformation degree of the printing pattern area of the target printing image located in the window area.
[0034] Specifically, digital printing products are repeated printings of the same color pattern. Based on the color histogram of the target printing product, the similarity between the window area of the target printing image to be tested and the image of the printing standard template is preliminarily obtained. However, due to the deformation and scaling of the printing image, the color proportion of the printing image and the image in the printing standard template is different or the color proportion of the background area is high, and defect detection by color matching may not be accurate. Digital printing is formed by repeated arrangement of the same graphic elements. In the vertical or horizontal direction, the repetition pattern of the pattern is uniform and rhythmic, and the overall direction is consistent. Even if the pattern undergoes geometric transformation or deformation caused by pulling, all image elements will change in the same direction, showing an overall consistent change.
[0035] Further, when determining the second deformation degree of the window area, as an optional embodiment of the present invention, firstly, edge detection is performed on the window area to obtain a segmented area; then, the background expression degree of the segmented area is determined according to the grayscale value of the pixel points in the segmented area, the first area of the segmented area and the second area of the target printed image; secondly, the segmented area with the largest background expression degree is binarized to obtain the printed pattern area of the target printed image; and the core color reference degree of the color intensity in the printed pattern area is determined according to the third pixel number of the color intensity of the printed pattern area and the fourth pixel number of all pixels in the printed pattern area; then the center of the connected domain of the color intensity corresponding to the maximum value in the color reference degree is selected as the core point of the printed pattern area; and the directional consistency of the printed pattern area is determined according to the first angle and the second angle, the first angle being the angle between the line connecting the core point in the printed pattern area with the adjacent core points on the left and right in the horizontal range and the horizontal straight line, and the second angle being the angle between the line connecting the core point in the printed pattern area with the adjacent core points on the top and bottom in the vertical range and the horizontal straight line; finally, the first deformation degree of the printed pattern area is determined according to the directional consistency and the spacing distance between the adjacent core points in the printed pattern area; and the second deformation degree of the window area is determined using the first deformation degree of each printed pattern area.
[0036] Specifically, in order to eliminate the interference of the background area and to analyze the arrangement rules and directions of the printed patterns in the embodiments of the present invention, the target printed image to be detected is segmented into regions, and only the printed patterns in the target printed image are retained. Therefore, the target printed image to be detected is segmented by Sobel bidirectional edge detection, and the segmented regions include the printed pattern region and the background region. For the segmented regions segmented by edge detection, background interference is eliminated. When eliminating background interference, the background expression degree of each segmented region can be calculated. The greater the background expression degree, the more likely it is that the segmented region is the background region. Then, the segmented region with the largest background expression degree is binarized to obtain the printed pattern region. For example, Figure 7 As shown, Figure 7 A schematic diagram of a segmented area obtained by edge detection provided in an embodiment of the present invention, which includes a printed pattern area 701 and a background area 702 .
[0037] Furthermore, when determining the background expression degree of the segmented area, as an optional embodiment of the present invention, firstly, a third ratio between the first area and the second area is calculated, and the variance of the grayscale values of all pixels in the segmented area is calculated; then, an exponential operation is performed on the variance to obtain the operation result; finally, the first product of the third ratio and the operation result is determined as the background expression degree of the segmented area.
[0038] Specifically, the embodiment of the present invention may use the following formula to calculate the background expression level of the segmented area: ;
[0039] In the above formula, Indicates the first The background expression level of each segmented area. Indicates The first area of the segmented region, i.e. The total number of pixels in the segmented area. Represents the second area of the target print image to be measured, that is, the total number of pixels of the target print image. Indicates The variance of the grayscale values of all pixels in a segmented area. The smaller the variance, the more uniform the color of the segmented area is, and the more likely it is to be the background area. Indicates The ratio of a segmented area to the target printed image to be tested, when the ratio is larger, the background performance of the segmented area is greater. represents the exponential function, which is used to Perform exponential operation.
[0040] Furthermore, the segmented area with the highest background expression degree is binarized, and only the printed pattern area is retained in the target printed image to be tested.
[0041] Furthermore, based on the target print image to be tested that has been binarized to remove the background area, the arrangement regularity of the print pattern in the target print image is analyzed to obtain the distribution characteristics of each window area. First, it is necessary to analyze the arrangement and direction of the print pattern area in the target print image to be tested, first confirm the core point position of the print pattern area, and confirm the distribution of the print pattern through the arrangement of the core points. The center of the area with the largest color proportion in the print pattern area in the entire target print image to be tested is selected as the core point of each print pattern area. When calculating the core color reference degree of color intensity in the print pattern area, as an optional embodiment of the present invention, first calculate the fourth ratio between the third number of pixels and the fourth number of pixels; then average the fourth ratio of each print pattern area in the window area to obtain the core color reference degree of color intensity in the print pattern area.
[0042] Specifically, the embodiment of the present invention uses the following formula to calculate the core color reference degree: ;
[0043] In the above formula, Indicates the first A core color reference for each color intensity. Indicates the number of printed pattern areas in the target printed image to be tested. Indicates In the printed pattern area The third pixel number of the color intensity. Indicates The total number of pixels in the printed pattern area, that is, the fourth number of pixels. Indicates In the printed pattern area The proportion of pixels with a certain color intensity in the printed pattern area. The larger the formula is, the more representative the color intensity is. Indicates the first The average representativeness of the color intensity. The larger the formula is, the greater the core color reference of the color intensity is.
[0044] Further, select max The color intensity is taken as a reference, and the center of the connected domain of the color intensity in each printed pattern area is taken as the core point of the printed pattern area.
[0045] Furthermore, digital printing patterns are usually horizontal and vertical, or due to the involvement of the fixing device, there will be a slight angle deviation. The alignment of adjacent core points within ten degrees in the horizontal and vertical directions is observed. The printing patterns without pattern shift defects are arranged in the same direction. Figure 8 As shown, Figure 8 A schematic diagram of core points and partial connection lines of a printed pattern area provided by an embodiment of the present invention, such as Figure 8 As shown, each core point has at least one adjacent core point, and the directional consistency of each printed pattern area is obtained based on the connection conditions within the lateral and longitudinal ranges of the core points.
[0046] Furthermore, when determining the directional consistency of the printed pattern area, as an optional embodiment of the present invention, firstly, the first average angle of the first angle corresponding to all the core points in the printed pattern area and the second average angle of the second angle corresponding to all the core points in the printed pattern area are calculated; then, the absolute value of the second difference between the first angle of the current core point and the first average angle and the absolute value of the third difference between the second angle of the current core point and the second average angle are calculated; finally, 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.
[0047] Specifically, the following formula is used to calculate the directional consistency of the printed pattern area in the embodiment of the present invention: ;
[0048] In the above formula, Indicates Directional consistency of the printed pattern area. Indicates The first angle between the line connecting the core point of a printed pattern area and the horizontal line within the horizontal range and the right adjacent core point. Indicates The first average angle of the first angles of the core points of all the printing pattern areas within the lateral range of the printing pattern area. Indicates The second angle between the line connecting the core point of each printed pattern area and the vertical line within the longitudinal range and the line connecting the next adjacent core point. Indicates The second average angle of the second angles of the core points of all the printed pattern areas within the longitudinal range of a printed pattern area. Indicates The difference between the first angle and the first average angle in the lateral range of a printed pattern area, when the formula is smaller, it means that the printed pattern area has greater directional consistency. Indicates The difference between the second angle and the second average angle in the longitudinal range of a printed pattern area. The smaller the formula is, the greater the directional consistency of the printed pattern area is. represents the exponential function, which is used to Perform exponential operation.
[0049] Furthermore, when each printed pattern area is deformed due to external forces, there will be differences in the spacing distances in the transverse direction or the longitudinal direction. Therefore, based on the changes in the distance intervals in different directions, it is determined whether each printed pattern area has the possibility of deformation, that is, the first deformation degree. When determining the first deformation degree of the printed pattern area, as an optional embodiment of the present invention, the absolute value of the fourth difference between adjacent spacing distances in the printed pattern area is first calculated, and the average value of the absolute value of the fourth difference between each adjacent spacing distance is calculated; then the second product of the directional consistency and the average value is determined as the first deformation degree of the printed pattern area.
[0050] Specifically, the embodiment of the present invention uses the following formula to calculate the first deformation degree of the printed pattern area: ;
[0051] In the above formula, Indicates The first deformation degree of a printed pattern area. Indicates The larger the value is, the less likely it is that the printed pattern area is defectively shifted. Indicates the number of spacing distances between all adjacent core points in the horizontal and vertical ranges of each printed pattern area. Indicates The printed pattern area is within the horizontal and vertical range of distance interval. Indicates The horizontal and vertical range of the printed pattern area distance interval. Indicates The difference between the distance intervals between adjacent printed pattern areas in the horizontal and vertical ranges. The larger the formula is, the greater the possibility that the printed pattern area presents a consistent transformation in the overall direction and is not a separate displacement defect, and the deformation is caused by external force.
[0052] Furthermore, after determining the first deformation degree of each printed pattern area, the first deformation degree of each printed pattern area is averaged to obtain the second deformation degree of the window area. The embodiment of the present invention uses the following formula to calculate the second deformation degree of the window area: ;
[0053] In the above formula, Indicates The second deformation degree of the window area. Indicates the number of printed pattern areas within each window area. Indicates The first deformation degree of each printed pattern area is a first deformation degree of each printed pattern area. When the deformation degrees of all printed pattern areas in the window area are large, it means that the deformation degree of the window area is greater.
[0054] S105, determining the matching degree between the window area and the printing standard template according to the second deformation degree and the similarity.
[0055] Specifically, in the process of template matching of 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, the similarity between the window area and the printed standard template image is obtained according to the color histogram of the target printed image of the digital printing product. Due to deformation and scaling, the color proportion will be abnormal. Usually, the color proportion of the background area is enlarged, which leads to being mistaken for a defective area and causing false detection. Therefore, according to the degree of deformation of the printed pattern area, it is adjusted to reduce the possibility of false detection.
[0056] Further, when determining the degree of matching between the window area and the printing standard template, as an optional embodiment of the present invention, the third product between the second deformation degree and the similarity is determined as the degree of matching.
[0057] Specifically, the embodiment of the present invention uses the following formula to calculate the matching degree: ;
[0058] Indicates the first The matching degree between the window area and the printing standard template. Indicates the first The similarity between the window area and the printing standard template. Indicates The second deformation degree of the window area.
[0059] Through the regularity of the arrangement of the printing pattern and the reason why it still maintains regular deformation after being affected by interference factors, the final matching degree between the window area and the printing standard template in each target printing image to be tested is obtained. The smaller the matching degree, the greater the possibility of defects in the window area.
[0060] S106, 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.
[0061] Specifically, when performing defect detection on the target printed image, as an optional embodiment of the present invention, when the matching degree is less than a threshold, the window area is marked as a defect area.
[0062] Among them, the present invention sets the threshold value as 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. Borders or different color marks can be used on the target printing image. Each suspicious window area is clearly displayed, the defect type is confirmed, the color histogram of each window area is analyzed, whether there are significantly different colors from the surrounding areas, and the integrity of the printed pattern is checked. Determine whether there is a problem of partial printing without printing or uneven printing, by comparing the positional relationship between the pattern in the printing pattern area and the printing standard template, determine whether the printing pattern has misalignment and other phenomena, record the coordinates and size of each defective area and other information for subsequent repair or quality tracking.
[0063] In the process of defect detection of digital printing products in the embodiment of the present invention, the printing standard template can be template matched 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 and ensure that each local area in the target printing image can be fully inspected, thereby improving the accuracy of defect detection. Then, the color in the window area is used to perform similarity calculation, which can effectively reflect the color distribution in the window area, thereby identifying the difference between the target printing image and the image of the printing standard template. In addition, 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 printing pattern area in the window area, and perform defect detection according to the matching degree, further improving the accuracy and reliability of defect detection of digital printing products.
[0064] Embodiment 2: Corresponding to the computer vision-assisted digital printing defect detection method provided in the above embodiment, based on the same technical concept, an embodiment of the present invention further provides a computer vision-assisted digital printing defect detection system, which is used to execute the computer vision-assisted digital printing defect detection method. Fig. 9 A schematic diagram of a computer vision-assisted digital printing defect detection system is provided in accordance with an embodiment of the present invention. Fig. 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.
[0065] 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.
[0066] 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.
[0067] 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.
[0068] 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.
[0069] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on 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; 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.
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 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 horizontal 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; The second deformation degree of the window area is determined by using the first deformation degree of each of the printed pattern areas.
4. The computer vision-assisted digital printing defect detection method according to claim 3, characterized in that: Determining the background expression 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 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.
5. The computer vision-assisted digital printing defect detection method according to claim 3, 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.
6. The computer vision-assisted digital printing defect detection method according to claim 3, 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.
7. The computer vision-assisted digital printing defect detection method according to claim 3, 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.
8. 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.
9. 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.
10. 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-9.
Citation Information
Patent Citations
Printing defect detection method based on flexible template registration
CN103048331A
Chinese medicine complexion recognition method based on color modeling
CN103400146A
Method for recognizing patterns of blueprint cloth
CN103871084A
Method and device for judging target tracking effect
CN106502380A
Anti-auto-encoder texture surface defect detection method based on self-attention
CN113989216A