A printing quality detection method based on machine vision
Through the printing quality detection method based on machine vision, image preprocessing and feature value calculation, combined with the characteristics of image contour morphology, the impact of the external environment on printing quality detection is solved, and efficient and accurate printing quality recognition is achieved.
Patent Information
- Application Number
- CN202510553320.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-29
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2045-04-29
AI Technical Summary
The prior art is susceptible to external environment in printing quality inspection, resulting in low recognition accuracy and low efficiency.
The printing quality detection method based on machine vision is adopted to generate quality detection results through image preprocessing, feature value calculation, clear threshold setting, boundary value calculation and empirical methods, and defect identification is performed based on the characteristics of the image contour morphology.
It reduces the impact of the external environment on recognition, improves the accuracy and efficiency of recognition, simplifies the calculation process, and improves the accuracy and processing efficiency of image analysis.
Smart Images

Figure CN120088245B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of printing detection, and in particular to a printing quality detection method based on machine vision. Background Art
[0002] Printing quality detection is a process of quantitatively evaluating the color accuracy, text clarity, layout integrity and defects (such as ink dots, scratches, overprint deviation) of printed matter through optical instruments, image processing or artificial intelligence algorithms;
[0003] The most common detection method is manual detection by staff. However, this method relies on the long-term work of manpower, and detection deviation is likely to occur due to the visual fatigue of the human eye. Existing technologies mostly rely on image analysis algorithms, such as pixel-based template matching, edge detection or deep learning models. Currently, the detection method of machine vision is relatively common. However, during the detection process, texture recognition is affected by the environment, including factors such as light in the environment and the vibration of the printing press itself, resulting in low recognition accuracy. In addition, the commonly used machine vision algorithms rely on a large amount of image data support, and the efficiency is low in real-time detection. Summary of the Invention
[0004] In view of the deficiencies of the prior art, the present invention provides a printing quality detection method based on machine vision, which solves the technical problems that the prior art is easily affected by the external environment with low recognition accuracy and low recognition efficiency, and achieves the purpose of reducing the environmental impact and improving the recognition accuracy and recognition efficiency.
[0005] To solve the above technical problems, the present invention provides the following technical solutions: A printing quality detection method based on machine vision, the method includes the following steps:
[0006] S1. Collect the original image of the printed image, and preprocess the original image to obtain a preprocessed image;
[0007] S2. Calculate the first eigenvalue and the second eigenvalue , and obtain a preposed vector based on the first eigenvalue ; ;
[0008] S3. Calculate a clarity threshold for distinguishing the clarity of the preprocessed image , and obtain a set of images to be detected based on the clarity threshold ;
[0009] S4. Calculate the binary value of any image to be detected in the set of images to be detected Obtain a binary image and based on the boundary values of the binary image Obtain the printing boundary;
[0010] S5. Calculate the first detection threshold of the printing boundary and the second detection threshold , and based on the first detection threshold and the second detection threshold screen out the printing missing positions;
[0011] S6. Obtain the quality pass value for generating the quality detection result by the empirical method , and send the quality detection result to the display module.
[0012] Preferably, in S1, the specific implementation steps are as follows:
[0013] S11. Convert the original image to the RGB space to obtain the RGB values of the pixel points in the original image, and calculate the grayscale value of the original image ;
[0014] S12. Calculate the grayscale difference value based on the grayscale value ;
[0015] S13. Integrate the grayscale difference value into a sharpness image , calculate the median filter value of the sharpness image ;
[0016] S14. In the median filter image formed by the median filter value , randomly select two pixel points and and calculate the correction angle ;
[0017] S15. Perform angle correction on the median filter image according to the correction angle and obtain the preprocessed image after correction.
[0018] Preferably, in S2, the specific implementation steps are as follows:
[0019] S21. Obtain the pixel value of any pixel point in the range image as the center point, and obtain the within the center point radius neighboring pixel points, and calculate the reference value for obtaining the binary result, and the calculation formula is:
[0020] ;
[0021] Wherein, represents the sign function, represents the grayscale value of the center point, represents the grayscale values of the neighboring pixel points;
[0022] S22. Change the radius of the center point to , and repeat S21 to obtain multiple reference values . According to the multiple reference values , calculate the first eigenvalue , and the calculation formula is:
[0023] ;
[0024] Among them, represents the binary result of the reference value circularly shifted to the right by times;
[0025] S23. Obtain the gray levels of the preprocessed image through the gray quantization method and . According to the gray levels and , calculate the processing value , and the calculation formula is:
[0026] ;
[0027] Among them, represents the pixel value of the pixel point in the preprocessed image, and respectively represent the offset amounts of the pixel point at different angles, and represent the length and width of the preprocessed image;
[0028] S24. According to the processing value , calculate the comparison value , entropy value and relationship value of the preprocessed image respectively, and the calculation formulas are:
[0029] ;
[0030] ;
[0031] ;
[0032] Among them, represents the quantity of , represents the average value of the processing value , and respectively represent and standard deviation;
[0033] S25. Combine the comparison value , entropy value and relationship value to obtain the second eigenvalue through the weighting method;
[0034] S26. Combine the first eigenvalue and the second eigenvalue to form the pre - vector of the pre - processed image.
[0035] Preferably, in S3, the specific implementation steps are as follows:
[0036] S31. Divide the pre - processed image into image blocks equally, and obtain the DCT coefficients of each image block through the discrete cosine transform method, and determine the high - frequency region based on the DCT coefficients ;
[0037] S32. Calculate the frequency energy value of the pre - vector of the image block according to the DCT coefficients , and the calculation formula is:
[0038] ;
[0039] wherein, represents the number of DCT coefficients ;
[0040] S33. Obtain a random number L between through a random generator, and calculate the non - zero minimum value according to the random number L;
[0041] S34. Calculate the spatial domain contrast according to the non - zero minimum value and the pre - vector , and the calculation formula is:
[0042] ;
[0043] wherein, represents the gradient of the pre - vector in the direction, represents the gradient of the pre - vector in the direction, represents and The number of groups;
[0044] S35. Calculate the multi-scale fusion value according to the frequency-energy value and the spatial domain contrast , and the calculation formula is: , the calculation formula is:
[0045]
[0046] wherein, and represent the optimization coefficients, and ;
[0047] S36. Calculate the clarity threshold for distinguishing the clarity of the preprocessed image , and the calculation formula is:
[0048] ;
[0049] wherein, and respectively represent the gradient means of the preposed vector in the direction and the direction, represents the mean value of the preposed vector ;
[0050] S37. Classify the clarity of the preprocessed image according to the clarity threshold ;
[0051] If , then mark the preprocessed image as a clear image, wherein, represents the average value of the preposed vector ;
[0052] If , then mark the preprocessed image as a defective image;
[0053] S38. Aggregate the defective images into a set of images to be detected.
[0054] Preferably, in S4, the specific implementation steps are as follows:
[0055] S41. Arbitrarily select a defective image to be detected in the set of images to be detected , and define the pixel coordinates of the image to be detected as ;
[0056] S42. Define a circular processing element with a radius of on the image to be detected , wherein, And ;
[0057] S43. Calculate the binary value according to the image to be detected , and the calculation formula is:
[0058] ;
[0059] Wherein, represents the th binary value, represents the erosion operation, represents the dilation operation;
[0060] S44. Generate a binary image according to the binary value, and randomly select a boundary pixel point on the binary image, and calculate the boundary value of the boundary pixel point ;
[0061] S45. Obtain the printing boundary of the binary image according to the boundary value .
[0062] Preferably, the calculation formula of the boundary value is:
[0063] ;
[0064] Wherein, represents the standard deviation of the Gaussian kernel obtained based on the Gaussian function.
[0065] Preferably, in S5, the specific implementation steps are as follows:
[0066] S51. Select the pixel point in the upper left corner of the binary image as the origin, establish a global coordinate system and obtain the number of the upper limit pixel points on the printing boundary ;
[0067] S52. Obtain multiple limit pixel points on the printing boundary, and calculate the centroid coordinate of the printing boundary;
[0068] S53. Calculate the centroid distance according to the centroid coordinate ;
[0069] S54. Calculate the centroid mean used to measure the average situation of the centroid distance according to the centroid distance ;
[0070] S55. Calculate the standard deviation value for evaluating the fluctuation of the average center distance , and the calculation formula is: ,
[0071] ;
[0072] wherein, represents the th standard deviation value;
[0073] S56. Calculate the average value of adjacent points according to the average center distance , and the calculation formula is: ,
[0074] ;
[0075] wherein, represents the average center distance of the pixel points adjacent to the average center coordinate ;
[0076] S57. Calculate the first detection threshold and the second detection threshold for identifying the printing missing positions respectively;
[0077] S58. Identify the printing missing positions in the binary image according to the first detection threshold and the second detection threshold ;
[0078] If and , then mark the boundary pixel points at the corresponding positions as printing missing positions;
[0079] Otherwise, do not mark;
[0080] S59. Set the marked printing missing positions as the printing missing set.
[0081] Preferably, the calculation formulas of the first detection threshold and the second detection threshold are respectively:
[0082] ;
[0083] ;
[0084] wherein, and respectively represent the maximum value and the minimum value of the standard deviation value , and respectively represent the maximum value and the minimum value of the average value of adjacent points .
[0085] Preferably, in S6, the specific implementation steps are as follows:
[0086] S61. Count the number of printing missing positions in the printing missing set by the counting method ;
[0087] S62. Set the quality qualified value by the empirical method , and screen out the binary images that meet the requirements according to the quality qualified value ;
[0088] If , it indicates that the binary image is a qualified image;
[0089] If , it indicates that the binary image is an unqualified image;
[0090] S63. Generate a quality inspection result according to the screening result of the quality qualified value , and send the quality inspection result to the display module.
[0091] By means of the above technical solution, the present invention provides a printing quality inspection method based on machine vision, which at least has the following beneficial effects:
[0092] 1. Through the preprocessing of the image and the detailed recognition of the texture in the image, the present invention can preprocess and correct the image, correct the image offset caused by light and the vibration of the printing press, and then perform various feature recognitions on the preprocessed image, so that the fusion of various features of the image texture can not only reduce the influence of the external environment on the image, improve the accuracy of image recognition, but also improve the recognition accuracy of the image texture features and improve the recognition efficiency.
[0093] 2. By equally dividing the preprocessed image and recognizing the image according to the frequency energy value and the spare contrast of the image, and using the method of gradient calculation for multi-scale fusion, the present invention can accurately recognize the clarity of the image, and then complete the preliminary screening of the image, which is simpler and more efficient than the prior art and has a high accuracy of clarity recognition.
[0094] 3. In the present invention, by first convolving the image with a Gaussian kernel to suppress high-frequency noise and then applying the second-order derivative to the smoothed image to accurately locate the edge, it can not only reduce the influence of high-frequency noise, but also accurately locate the edge of the image, improve the accuracy of image analysis, and the operation steps are simple and efficient, improving the processing efficiency.
[0095] 4. The present invention identifies defects by establishing a two-dimensional coordinate system and combining the morphological characteristics of the image contour. It can not only improve the robustness of the algorithm, but also avoid the training of a large amount of data. By using the particularity of the contour, it can efficiently identify the missing parts. It has high robustness, is more accurate and efficient than the traditional method of obtaining regional thresholds, and simplifies the calculation, greatly improving the calculation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0096] The drawings described herein are used to provide a further understanding of the present application, and form a part of the present application. The illustrative embodiments and descriptions thereof are used to explain the present application and do not constitute an improper limitation of the present application. In the drawings:
[0097] Figure 1 is a flowchart of a printing quality detection method based on machine vision according to the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0098] To make the above objects, features, and advantages of the present invention more obvious and understandable, the present invention will be further described in detail below with reference to the drawings and specific embodiments. Through this, the implementation process of how the present application uses technical means to solve technical problems and achieve technical effects can be fully understood and implemented accordingly.
[0099] Due to the technical problems that the prior art is easily affected by the external environment, with low recognition accuracy and low recognition efficiency, this embodiment provides a printing quality detection method based on machine vision, which can reduce the environmental impact and improve the recognition accuracy and recognition efficiency. As Figure 1 shown, the method includes the following steps:
[0100] S1. Collect the original image of the printed image and preprocess the original image to obtain a preprocessed image; due to the external environmental light and the vibration of the printing press itself, it is easy to cause image deviation with certain noise. To solve this problem, the specific steps are as follows:
[0101] S11. Convert the original image to the RGB space to obtain the RGB values of the pixel points in the original image, and calculate the grayscale value of the original image according to the RGB values , and the calculation formula is:
[0102] ;
[0103] Wherein, , and respectively represent the RGB values of the original image;
[0104] S12. Calculate the grayscale difference according to the grayscale value , and the calculation formula is:
[0105] ;
[0106] in, Represents the grayscale values at different positions in the original image, and Respectively The number of pixels in the direction and The number of directional pixels;
[0107] S13, grayscale difference Integrated into a clear image , calculate the clarity image The filter value , the calculation formula is:
[0108] ;
[0109] in, Represents the median gray value of the central pixel;
[0110] S14, filter value in the middle Select any two pixels from the filter image and , calculate the correction angle , the calculation formula is:
[0111] ;
[0112] in, Indicates Correction angle;
[0113] S15, according to the correction angle The angle of the filtered image is corrected and a corrected preprocessed image is obtained. By preprocessing the image and identifying the texture in the image in detail, the image can be preprocessed and corrected, and the image offset caused by light and printing machine vibration can be corrected. Then, multiple feature recognition is performed on the preprocessed image, and multiple features of the image texture are integrated. This can not only reduce the impact of the external environment on the image and improve the image recognition accuracy, but also improve the recognition accuracy of the image texture features and improve the recognition efficiency.
[0114] S2. Calculate the first eigenvalue based on the preprocessed image and the second eigenvalue , based on the first eigenvalue and the second eigenvalue Get the pre-vector ; After obtaining the preprocessed image, in order to more accurately identify the texture features and avoid inaccurate recognition, the specific steps are as follows:
[0115] S21. Obtain the pixel value of any pixel point in the range image as the center point, and obtain the radius of the center point within the number of neighborhood pixel points, and calculate the reference value for obtaining the binary result . The calculation formula is:
[0116] ;
[0117] ;
[0118] wherein, represents the sign function, represents the gray value of the center point, represents the gray value of the neighborhood pixel point; the reference value can transform the image into a binary form, which is achieved through the sign function and is different from the pixel value of the binary image, and is only used for clarity recognition in this step.
[0119] S22. Change the radius of the center point to , repeat S21 to obtain multiple reference values , and calculate the first eigenvalue according to the multiple reference values . The calculation formula is:
[0120] ;
[0121] wherein, represents circularly shifting the binary result of the reference value to the right by times; it is a characteristic value of a numerical sequence generated by translating and circulating according to the 0 and 1 sequences of the run length.
[0122] S23. Obtain the gray level of the preprocessed image through the gray quantization method and , and calculate the processing value and according to the gray levels . The calculation formula is:
[0123] ;
[0124] wherein, represents the pixel value of the pixel point in the preprocessed image, and respectively represent the offsets of the pixel point at different angles (for example: in the actual correction process, the angle offset is very small, generally between 0.12 and 3.61, such as 1.16), and Indicates the length and width of the preprocessed image; the gray quantization method is a method of quantizing the gray level of an image and obtaining the number of gray levels, which is a commonly used method for obtaining gray levels and will not be elaborated here.
[0125] S24. According to the processing value Calculate the comparison value , entropy value and relationship value of the preprocessed image respectively, and the calculation formulas are:
[0126] ;
[0127] ;
[0128] ;
[0129] Among them, represents the quantity of represents the average value of the processing value , and respectively represent and the standard deviations of
[0130] S25. Obtain the second eigenvalue of the comparison value , entropy value and relationship value through the weighting method; the weighting method is a commonly used data processing method that sums each value after weighting and will not be elaborated here.
[0131] S26. Combine the first eigenvalue and the second eigenvalue into the prevector of the preprocessed image. In this step, the first eigenvalue and the second eigenvalue are used to complete the recognition of texture features. In actual operation, the recognition of texture will be completed through multiple features of the texture. In this solution, only two eigenvalues are used as examples for illustration. Through the preprocessing of the image and the detailed recognition of the texture in the image, the image can be preprocessed and corrected, and the image offset caused by light and the vibration of the printing press can be corrected. Furthermore, multiple feature recognitions can be performed on the preprocessed image, enabling the fusion of multiple features of the image texture. This can not only reduce the influence of the external environment on the image and improve the accuracy of image recognition, but also improve the accuracy of the recognition of image texture features and enhance the recognition efficiency.
[0132] S3, calculating the clarity threshold used to distinguish the clarity of the pre-processed image according to the equally divided pre-processed image , and based on the clarity threshold Get the image set to be detected; after initially obtaining the pre-vector After the preprocessed image, it needs to be further processed to complete the recognition of image clarity. In order to solve this problem, the specific steps are as follows:
[0133] S31, divide the preprocessed image into The DCT coefficients of each image block are obtained by discrete cosine transform method. , and based on the DCT coefficients Identify high frequency areas ; Discrete cosine transform method is a commonly used method for obtaining DCT coefficients of an image, which will not be described in detail here.
[0134] S32, according to DCT coefficient Calculate the pre-vector of the image block Frequency energy value , the calculation formula is:
[0135] ;
[0136] in, Represents DCT coefficients The number of frequency energy values It can be understood as the energy value in a certain frequency domain.
[0137] S33, through the random generator in Get a random number L between the two, and calculate the non-zero minimum value based on the random number L The calculation formula is:
[0138] ;
[0139] in, represents a non-zero minimum value randomly generated according to the random number L;
[0140] S34, based on non-zero minimum and the prepend vector Calculate spatial contrast , the calculation formula is:
[0141] ;
[0142] in, Indicated in Preceding vector in direction The gradient of Indicated in Preposed vector in the direction of the gradient, indicating and the number of groups;
[0143] S35. Calculate the multi-scale fusion value according to the frequency energy value and the spatial domain contrast , and the calculation formula is:
[0144] ;
[0145] wherein, and represent the optimization coefficients, and ;
[0146] S36. Calculate the clarity threshold for distinguishing the clarity of the preprocessed image,
[0147] ;
[0148] wherein, and respectively represent the average gradient of the preposed vector in the direction and direction, represents the average value of the preposed vector ;
[0149] S37. Classify the clarity of the preprocessed image according to the clarity threshold ;
[0150] If , then mark the preprocessed image as a clear image, wherein, represents the average value of the preposed vector ;
[0151] If , then mark the preprocessed image as a defective image;
[0152] S38. Assemble the defective images into a set of images to be detected. By equally dividing the preprocessed images and identifying the images according to the frequency energy value and spatial domain contrast of the images, and then using the method of gradient calculation for multi-scale fusion, the clarity of the images can be accurately identified, and thus the preliminary screening of the images can be completed. Compared with the prior art, it is simpler and more efficient, and the accuracy of clarity identification is high.
[0153] S4. Calculate the binary value of any image to be detected Obtain a binary image and calculate the boundary value of the binary image Obtain the printing boundary; after performing clarity recognition on the preprocessed image, a clear image and a defective image can be obtained. For the defective image, further detection is required. To solve this problem, the specific steps are as follows:
[0154] S41. Arbitrarily select a defective image to be detected from the set of images to be detected , and define the image to be detected with pixel coordinates as ;
[0155] S42. Define a circular processing element with a radius of on the image to be detected , where the radius and ;
[0156] S43. Calculate the two-phase value according to the image to be detected , and the calculation formula is:
[0157] ;
[0158] Among them, represents the th two-phase value, represents the erosion operation, represents the dilation operation;
[0159] S44. Generate a binary image according to the two-phase value . Arbitrarily select a boundary pixel point on the binary image, and calculate the boundary value of the boundary pixel point , and the calculation formula is:
[0160] ;
[0161] Among them, represents the standard deviation of the Gaussian kernel obtained based on the Gaussian function;
[0162] S45. Obtain the printing boundary of the binary image according to the boundary value . In this step, first convolve the image with a Gaussian kernel to suppress high-frequency noise, and then apply the second derivative to the smoothed image to accurately locate the edge. This can not only reduce the influence of high-frequency noise but also accurately locate the edge of the image, improve the accuracy of image analysis, and the operation steps are simple and efficient, improving the processing efficiency.
[0163] S5. Calculate the first detection threshold of the printing boundary and the second detection threshold , based on the first detection threshold and the second detection threshold screen out the missing printing positions; after performing boundary processing and recognition on the image, further defect detection is also required. To solve this problem, the specific steps are as follows:
[0164] S51. Select the pixel point in the upper left corner of the binary image as the origin, establish a global coordinate system, and obtain the number of upper boundary pixels of the printing boundary ; ;
[0165] S52. Obtain multiple boundary pixels on the printing boundary , calculate the centroid coordinate of the printing boundary , and the calculation formula is:
[0166] ;
[0167] ;
[0168] where represents the abscissa value of the th boundary pixel, represents the ordinate value of the th boundary pixel, represents the number of boundary pixels ;
[0169] S53. Calculate the centroid distance according to the centroid coordinate , and the calculation formula is:
[0170] ;
[0171] where represents the th centroid distance;
[0172] S54. Calculate the centroid mean used to measure the average situation of the centroid distance , and the calculation formula is:
[0173] ;
[0174] where represents the th centroid mean;
[0175] S55. Calculate the standard deviation used to evaluate the fluctuation of the centroid distance , and the calculation formula is:
[0176] ;
[0177] Among them, represents the th standard deviation value;
[0178] S56. Calculate the mean value of adjacent points according to the mean center distance , and the calculation formula is:
[0179] ;
[0180] Among them, represents the mean center distance of the pixel points adjacent to the mean center coordinate . When processing the same binary image, the same printing boundary is used. Therefore, in S52 - S56 both represent the number of boundary pixel points on the same printing boundary to be processed;
[0181] S57. Calculate the first detection threshold and the second detection threshold for identifying the printing missing position respectively, and the calculation formula is:
[0182] ;
[0183] ;
[0184] Among them, and represent the maximum value and the minimum value of the standard deviation value respectively, and represent the maximum value and the minimum value of the mean value of adjacent points respectively;
[0185] S58. Identify the printing missing position in the binary image according to the first detection threshold and the second detection threshold ;
[0186] If and , then mark the boundary pixel point at the corresponding position as the printing missing position;
[0187] Otherwise, do not mark;
[0188] S59. The set of marked printing missing positions is aggregated into a printing missing set. By establishing a two-dimensional coordinate system and combining the morphological characteristics of the image contour for defect recognition, not only can the robustness of the algorithm be improved, but also the training of a large amount of data can be avoided. Using the particularity of the contour to efficiently identify the missing parts can not only have high robustness but also be more accurate and efficient than traditional regional thresholds, and the calculation is simplified, greatly improving the calculation efficiency.
[0189] S6. Based on the empirical method, a quality qualified value is obtained for screening the binary images in the printing missing set. , and a quality inspection result is generated and sent to the display module; after obtaining the recognized printing missing set, it is also necessary to find qualified images with fewer missing parts and unqualified images with more missing parts in the printing missing set. To solve this problem, the specific steps are as follows:
[0190] S61. The number of printing missing positions in the printing missing set is counted by the counting method. The counting method is a commonly used method for counting quantities and will not be elaborated here.
[0191] S62. A quality qualified value is set by the empirical method. , and the binary images that meet the requirements are screened according to the quality qualified value. The empirical method is a method for obtaining thresholds by setting a certain qualified range through years of practical experience and will not be elaborated here.
[0192] If , it indicates that the binary image is a qualified image.
[0193] If , it indicates that the binary image is an unqualified image.
[0194] S63. A quality inspection result is generated according to the screening result of the quality qualified value and the quality inspection result is sent to the display module. In actual applications, the number of printing missing positions will be specified, allowing for a small number of printing missing positions. Therefore, a larger number of printing missing positions are unqualified images. The display module is generally the display of an instrument for detecting the printing quality of a printing press, which can mark and display the unqualified images and the specific printing missing positions to improve the processing speed of the staff for unqualified printed products and enhance work efficiency.
[0195] Those of ordinary skill in the art can understand that all or part of the steps in implementing the methods of the above embodiments can be completed by instructing relevant hardware through a program. Therefore, this application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, this application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0196] The above embodiments have introduced the present invention in detail. Specific examples are used in this article to elaborate on the principles and implementation manners of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A printing quality detection method based on machine vision, characterized in that: The method includes the following steps: S1. Collect the original image of the printed image, and preprocess the original image to obtain a preprocessed image; S2. Calculate the first eigenvalue D based on the preprocessed image t and the second eigenvalue De x , based on the first eigenvalue D t and the second eigenvalue De x Get the pre-vector Q z , in S2, the specific implementation steps are as follows: S21, obtain the pixel value of any pixel point in the range image (A x , B y ) as the center point, and obtain L neighboring pixel points within the radius R of the center point, and calculate the reference value C used to obtain the binary result k ; S22, change the center point radius to S, repeat S21 to obtain multiple reference values C k , according to multiple reference values C k Calculate the first eigenvalue D t ; S23, obtaining gray levels O and Q of the pre-processed image by gray quantization method, and calculating the processing value Cl according to the gray levels O and Q OQ ; S24, according to the processing value Cl OQ Calculate the comparison value Bj of the preprocessed image respectively c , entropy value Sz e and relationship value Gx h ; S25, compare the value Bj c , entropy value Sz e and relationship value Gx h The second eigenvalue De is obtained by weighting method x ; S26, the first eigenvalue D t and the second eigenvalue De x Combined into the pre-processed image pre-vector Q z ; S3. Calculate the clarity threshold Qx used to distinguish the clarity of the pre-processed image y , and based on the clear threshold Qx y Get the image set to be detected. In S3, the specific implementation steps are as follows: S31, divide the preprocessed image into 8×8 image blocks, and obtain the DCT coefficient Dc of each image block by discrete cosine transform method s , and based on the DCT coefficient Dc s Identify high frequency areas S32, according to the DCT coefficient Dc s Calculate the prefix vector Q of the image block z Frequency energy value Pn z , the calculation formula is: Where N represents the DCT coefficient Dc s The number of frequency energy values Pn z Represents the energy value in a certain frequency domain; S33. Obtain a random number L between [3, 8] through a random generator, and calculate the non-zero minimum value δ according to the random number L; S34, according to the non-zero minimum value δ and the pre-vector Q z Calculate the spatial contrast Ky d ; S35, according to the frequency energy value Pn z and spatial contrast Ky d Calculate the multi-scale fusion value dc r ; S36, calculating the clarity threshold Qx used to distinguish the clarity of the pre-processed image y ; S37, according to the clear threshold Qx y Classify the clarity of the preprocessed images; like Then the preprocessed image is marked as a clear image, where Represents the pre-vector Q z The average value of like Then the preprocessed image is marked as a defective image; S38. Aggregate the defective images into a set of images to be detected; S4, calculate any image D to be detected in the set of images to be detected j The two-phase value Ex z Get the binary image, and based on the boundary value Bv of the binary image u Get the printing border; S5. Calculate the first detection threshold τ and the second detection threshold ω of the printing boundary, and screen out the printing missing positions based on the first detection threshold τ and the second detection threshold ω; S6. Obtain the quality pass value He for generating the quality detection result through an empirical method, and send the quality detection result to the display module.
2. The printing quality detection method based on machine vision according to claim 1, characterized in that: In S1, the specific implementation steps are as follows: S11. Convert the original image to the RGB space to obtain the RGB values of the pixel points in the original image, and calculate the gray value Gr(x, y) of the original image according to the RGB values; S12. Calculate the gray difference value Gc(f) according to the gray value Gr(x, y); S13. Integrate the gray difference value Gc(f) into a sharpness image Q(a, b), and calculate the median filter value Ml(a, b) of the sharpness image Q(a, b); S14, in the filter image formed by the filter value M1 (a, b), randomly select two pixel points α (a1, b1) and β (a2, b2) and calculate the correction angle θ c ; S15, according to the correction angle θ c The angle of the filtered image is corrected to obtain a corrected preprocessed image.
3. The printing quality detection method based on machine vision according to claim 1, characterized in that: In S4, the specific implementation steps are as follows: S41, randomly select an image D with defects in the image set to be detected. j , define the image to be detected D j The pixel coordinates are (E xa , F yb ); S42, in the image to be detected D j Define a radius R t The circular processing element Y c , where R t <[max(E xa )-min(E xa )] and R t <[max(F yb )-min(F yb )]; S43, according to the image to be detected D j Calculate the two-phase value Ex z ; S44, according to the two-phase value Ex z Generate a binary image and select any boundary pixel point B1 (Lx g , Ly i ), calculate the boundary pixel B1(Lx g , Ly i ) boundary value Bv u ; S45, according to the boundary value Bv u Get the printed border of the binary image.
4. The printing quality detection method based on machine vision according to claim 3 is characterized in that: The boundary value Bv u The calculation formula is: Among them, σ represents the standard deviation of the Gaussian kernel obtained based on the Gaussian function, Lx g and Ly i Respectively represent the boundary pixel point B1(Lx g , Ly i )’s pixel value.
5. The printing quality inspection method based on machine vision according to claim 1, characterized in that: In S5, the specific implementation steps are as follows: S51, select the pixel point in the upper left corner of the binary image as the origin, establish a global coordinate system and obtain the upper limit pixel point Jx of the printing boundary d The number of T; S52, obtaining multiple boundary pixel points Jx on the printing boundary d (α v , β w ), calculate the center coordinates of the printing boundary (Pj x , Pk y ); S53, according to the isocentric coordinates (Pj x , Pk y ) Calculate the mean center distance Jp i ; S54, according to the centroid distance Jp i Calculation is used to measure the center distance Jp i The mean value of the average case Xj n ; S55. Calculation for evaluating the mean center distance Jp i The standard deviation value Bc of the fluctuation m ; S56, according to the center distance Jp i Calculate the mean value of neighboring points Ld j ; S57. Calculate the first detection threshold τ and the second detection threshold ω for identifying the printing missing positions respectively; S58. Identify the printing missing positions in the binary image according to the first detection threshold τ and the second detection threshold ω; If Bc m >τ and Ld j >ω, then the boundary pixel point Jx at the corresponding position d (α v , β w ) is marked as a missing position in printing; Otherwise, no marking is performed; S59. Aggregate the marked printing missing positions into a printing missing set.
6. The printing quality inspection method based on machine vision according to claim 5 is characterized in that: The calculation formulas of the first detection threshold τ and the second detection threshold ω are respectively: Among them, max(Bc m ) and min(Bc m ) represent the standard deviation value Bc m The maximum and minimum values, max(Ld j ) and min(Ld j ) represent the neighboring point mean Ld j The maximum and minimum values of .
7. The printing quality inspection method based on machine vision according to claim 1, characterized in that: In S6, the specific implementation steps are as follows: S61. Count the number G of the printing missing positions in the printing missing set through a counting method; S62. Set the quality pass value He through an empirical method, and screen out the binary images that meet the requirements according to the quality pass value He; If G < He, it means the binary image is a qualified image; If G ≥ He, it means the binary image is an unqualified image; S63. Generate a quality detection result according to the screening result of the quality pass value He, and send the quality detection result to the display module.
Citation Information
Patent Citations
Method for detecting quality of printed matter
CN105844621A
Printed matter detection method and device based on machine vision
CN118674713A