Quality detection method and device and terminal equipment
Through image correction and registration technology combined with human eye visual difference model and SURF algorithm, the accuracy problem of print quality detection is solved and efficient print quality detection is achieved.
Patent Information
- Application Number
- CN202510546166.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-28
- Publication Date
- 2025-08-01
AI Technical Summary
The prior art cannot accurately detect the quality of printed materials, resulting in possible misleading or serious consequences.
The human eye visual difference model is used to correct the printed template images, and the image registration is carried out in combination with the SURF algorithm. The local standard deviation and grayscale threshold image detection quality data are detected, and the human eye visual perception characteristics are used to improve the detection accuracy.
It effectively avoids false alarms in high-grayscale areas and missed alarms in low-grayscale areas, significantly improving the accuracy of print quality inspection.
Smart Images

Figure CN120411048A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of quality inspection, and particularly relates to a quality inspection method, a quality inspection device, and a terminal device. Background Art
[0002] With the continuous improvement of living standards, people's requirements for the appearance quality of printed matter are also gradually increasing. Given the complexity of the printing process and the significant increase in printing speed, the appearance of surface quality defects in printed matter has become a common phenomenon. If these defects are not removed in a timely manner, serious consequences may occur. For example, printing defects in textbooks may mislead students. In specific printing fields such as stamps and banknotes, the negative impacts of unqualified products are particularly prominent. The types of printed matter defects are diverse, including but not limited to missing printing, spots, and uneven ink color. Therefore, how to accurately detect the quality of printed matter has become an urgent problem to be solved. Summary of the Invention
[0003] Embodiments of this application provide a quality inspection method, device, terminal device, and computer-readable storage medium, which can solve the problem that the quality of printed matter cannot be accurately detected currently.
[0004] In a first aspect, embodiments of this application provide a quality inspection method, including: correcting a printed matter template image based on a human eye visual difference model, where the human eye visual difference model is a function with the image pixel gray value as the input quantity and the human eye visual perception quantity as the output quantity; correcting a to-be-detected printed matter image based on the human eye visual difference model to obtain a first image, where the first image is the corrected to-be-detected printed matter image; performing image registration on the corrected printed matter template image and the first image to obtain a second image, where the second image is the registered first image, and detecting the second image to obtain quality data, where the quality data can reflect the quality of the printed matter corresponding to the to-be-detected printed matter image.
[0005] In a possible implementation manner of the first aspect, the human eye visual difference model is expressed as S = K ln( C / G max +1), where the S is used to represent the output quantity, the C is used to represent the input quantity, G max is used to represent the C maximum gray value that can be achieved by the image format of the image where the corresponding pixel is located, K is used to represent a specified coefficient.
[0006] In a possible implementation of the first aspect, before detecting the second image to obtain quality data, it includes: calculating the local standard deviation of the corrected printed matter template image, where the local standard deviation is used to measure the degree of dispersion of gray values within the local area of the corrected printed matter template image; generating an upper gray threshold image based on the local standard deviation, a preset upper gray threshold, and the corrected printed matter template image; generating a lower gray threshold image based on the local standard deviation, a preset lower gray threshold, and the corrected printed matter template image; correspondingly, detecting the second image to obtain quality data includes: detecting the second image based on the upper gray threshold image and the lower gray threshold image to obtain quality data.
[0007] In a possible implementation of the first aspect, before calculating the local standard deviation of the corrected printed matter template image, it includes: calculating the local mean of the corrected printed matter template image, where the local mean is used to represent the average gray value of the local area of the corrected printed matter template image; correspondingly, calculating the local standard deviation of the corrected printed matter template image includes: calculating the local standard deviation of the corrected printed matter template image based on the local mean.
[0008] In a possible implementation of the first aspect, detecting the second image based on the upper gray threshold image and the lower gray threshold image to obtain quality data includes: Performing the following operations for each first target pixel: comparing the gray value of the first target pixel with the gray value of the second target pixel, if the gray value of the first target pixel is greater than the gray value of the second target pixel, then determining that the gray value of the first target pixel is abnormal, where the first target pixel is a pixel of the second image, and the second target pixel is: the pixel of the upper gray threshold image having the same coordinate as the first target pixel; And, performing the following operations for each first target pixel: comparing the gray value of the first target pixel with the gray value of the third target pixel, if the gray value of the first target pixel is less than the gray value of the third target pixel, then determining that the gray value of the first target pixel is abnormal, where the third target pixel is: the pixel of the lower gray threshold image having the same coordinate as the first target pixel; Obtaining quality data based on all first target pixels with abnormal gray values.
[0009] In a possible implementation of the first aspect, the correction of the printed matter template image based on the human eye visual difference model includes: establishing a look-up table corresponding to the human eye visual difference model; correcting the printed matter template image based on the look-up table corresponding to the human eye visual difference model; correspondingly, the correction of the printed matter image to be detected based on the human eye visual difference model includes: correcting the printed matter image to be detected based on the look-up table corresponding to the human eye visual difference model.
[0010] In a possible implementation of the first aspect, the image registration of the corrected printed matter template image and the first image to obtain a second image includes: obtaining an affine transformation matrix based on the corrected printed matter template image, the first image, and the SURF algorithm, and transforming the first image based on the affine transformation matrix to obtain a second image, where the second image is aligned with the corrected printed matter template image.
[0011] In a second aspect, an embodiment of the present application provides a quality detection device, including: A first correction unit for correcting a printed matter template image based on a human eye visual difference model, where the human eye visual difference model is a function with the image pixel gray value as the input quantity and the human eye visual perception quantity as the output quantity; A second correction unit for correcting a printed matter image to be detected based on the human eye visual difference model to obtain a first image, where the first image is the corrected printed matter image to be detected; A data acquisition unit for performing image registration on the corrected printed matter template image and the first image to obtain a second image, where the second image is the registered first image, and detecting the second image to obtain quality data, where the quality data can reflect the quality of the printed matter corresponding to the printed matter image to be detected.
[0012] In a third aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the method described in any one of the above when executing the computer program.
[0013] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, where the computer program implements the method described in any one of the above when executed by a processor.
[0014] It can be understood that the beneficial effects of the second to fourth aspects above can refer to the relevant descriptions in the first aspect above, and will not be repeated here.
[0015] The beneficial effects of the embodiments of the present application compared with the prior art are as follows: The present application can correct the printed matter template image based on the human eye visual difference model, where the human eye visual difference model is a function with the image pixel gray value as the input quantity and the human eye visual perception quantity as the output quantity; correct the printed matter image to be detected based on the human eye visual difference model to obtain a first image, where the first image is the corrected printed matter image to be detected; perform image registration based on the corrected printed matter template image and the first image to obtain a second image, where the second image is the registered first image, and detect the second image to obtain quality data, where the quality data can reflect the quality of the printed matter corresponding to the printed matter image to be detected. As can be seen from the above, the present application utilizes the human eye visual perception characteristics to process the image. The human eye visual perception characteristics include: the high sensitivity of the human eye to the low gray level area and the low sensitivity to the high gray level area, that is, the present application can cleverly combine machine vision with the human eye visual perception characteristics, thereby avoiding false alarms for quality defects corresponding to high gray level areas and missing reports for quality defects corresponding to low gray level areas, and thus can greatly improve the accuracy of printed matter quality detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0017] Figure 1 is a flowchart of a quality detection method provided by an embodiment of the present application; Figure 2 is a schematic diagram of a quality detection device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0018] In the following description, specific details such as specific system structures and technologies are proposed for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. However, those skilled in the art should clearly understand that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of the present application.
[0019] It should be understood that when used in the specification of the present application and the appended claims, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.
[0020] It should also be understood that the term "and / or" used in the specification and appended claims of the present application refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0021] As used in the specification and appended claims of the present application, the term "if... then" can be interpreted as "when...", or "once", or "in response to determining", or "in response to detecting" according to the context. Similarly, the phrase "if it is determined" or "if [the described condition or event] is detected" can be interpreted as meaning "once it is determined" or "in response to determining" or "once [the described condition or event] is detected" or "in response to detecting [the described condition or event]" according to the context.
[0022] In addition, in the description of the specification and appended claims of the present application, the terms "first", "second", "third", etc. are only used for distinguishing descriptions, and cannot be understood as indicating or implying relative importance.
[0023] Referring to "one embodiment" or "some embodiments" described in the specification of the present application means that in one or more embodiments of the present application, specific features, structures or characteristics described in combination with the embodiment are included. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "comprising", "including", "having" and their variants all mean "including but not limited to", unless otherwise specifically emphasized in other ways. Embodiment 1
[0024] Figure 1 The flowchart of a quality inspection method provided by an embodiment of the present application is shown. The quality inspection method includes: step S101, step S102 and step S103, which are described in detail as follows: Step S101: Correct the printed matter template image based on the human eye visual difference model, where the human eye visual difference model is a function with the image pixel gray value as the input quantity and the human eye visual perception quantity as the output quantity.
[0025] Wherein, the printed matter template image is an image that can reflect the printed matter template.
[0026] Specifically, based on the human visual difference model, the human visual perception amounts corresponding to the gray values of the respective image pixels of the printed matter template image are determined, and based on the human visual perception amounts corresponding to the gray values of the respective image pixels of the printed matter template image, a gray value transformation is performed on the printed matter template image (updating the gray values of the respective image pixels of the printed matter template image to the corresponding human visual perception amounts), so as to correct the printed matter template image, making the corrected printed matter template image fit the human perception.
[0027] In some embodiments, the human visual difference model can be expressed as S = K ln( C / G max +1), where the S is used to represent the output amount, and the C is used to represent the input amount, G max is used to represent the C maximum gray value achievable by the image format of the image where the corresponding pixel is located, K is used to represent a specified coefficient.
[0028] By way of example and not limitation, K = G max / ln2, if the C image format of the image where the corresponding pixel is located is an 8-bit map, then G max is equal to 255.
[0029] In reality, there are differences in the human eye's perception of image gray value changes. Specifically, under different gray backgrounds, the same gray value change will cause differences in the human eye's perception intensity. S = K ln( C / G max +1) reflects the logarithmic relationship between the input amount and the output amount, that is, it satisfies the logarithmic relationship between the physical stimulus amount and the psychological amount, so as to accurately correct the printed matter template image, making the corrected printed matter template image highly fit the human perception.
[0030] Step S102, correct the to-be-detected printed matter image based on the human visual difference model to obtain a first image, where the first image is the corrected to-be-detected printed matter image.
[0031] Wherein, the to-be-detected printed matter image is an image that can reflect the to-be-detected printed matter.
[0032] Specifically, obtain the image of the printed matter to be detected, determine the human visual perception amounts corresponding to the gray values of each image pixel of the image of the printed matter to be detected based on the human visual difference model, and perform gray value transformation on the image of the printed matter to be detected based on the human visual perception amounts corresponding to the gray values of each image pixel of the image of the printed matter to be detected, so as to correct the image of the printed matter to be detected.
[0033] Optionally, the correction of the printed matter template image based on the human visual difference model includes: establishing a look-up table corresponding to the human visual difference model; correcting the printed matter template image based on the look-up table corresponding to the human visual difference model; correspondingly, the correction of the image of the printed matter to be detected based on the human visual difference model includes: correcting the image of the printed matter to be detected based on the look-up table corresponding to the human visual difference model.
[0034] Since the gray value of an image pixel is a discrete variable, a look-up table corresponding to the human visual difference model can be established. By correcting the printed matter template image and the image of the printed matter to be detected through the look-up table corresponding to the human visual difference model, the efficiency of image correction can be improved.
[0035] As an example but not a limitation, the establishment of the look-up table corresponding to the human visual difference model includes: inputting multiple gray values in the gray value set into the human visual difference model one by one to obtain multiple output amounts, performing integer quantization on the multiple output amounts, and saving the mapping relationship between the gray values in the gray value set and the output amounts after integer quantization as a look-up table, where the gray value set includes all possible gray values corresponding to the image format, and the gray value set can be expressed as { G min , G min + 1, G min + 2, ……, G max}, where the G min is used to represent the minimum gray value that can be achieved by the image format of the image where the pixel corresponding to the C is located. For example, if the image format of the image where the pixel corresponding to the C is located is an 8-bit map, then G min is equal to 0.
[0036] Step S103: Perform image registration on the corrected printed matter template image and the first image to obtain a second image, where the second image is the registered first image, and detect the second image to obtain quality data, where the quality data can reflect the quality of the printed matter corresponding to the printed matter image to be detected.
[0037] Since there may be a spatial position deviation between the corrected printed matter template image and the first image, in order to eliminate the influence of the deviation, therefore, the present application performs registration on the corrected printed matter template image and the first image, thereby improving the accuracy of the obtained quality data.
[0038] As an example but not a limitation, the quality data can reflect that the quality of the printed matter corresponding to the printed matter image to be detected is defective. For example, the quality data can reflect the image position corresponding to the defect of the printed matter quality; or, the quality data can reflect that the quality of the printed matter corresponding to the printed matter image to be detected is defect-free.
[0039] In some embodiments, step S103 includes: obtaining an affine transformation matrix based on the corrected printed matter template image, the first image, and the Speeded Up Robust Features (SURF) algorithm M , and based on the affine transformation matrix M transform the first image to obtain a second image, where the second image is aligned with the corrected printed matter template image. In the present application, high computing power can be achieved based on the SURF algorithm.
[0040] Among them, M can be expressed as , where a is the scaling coefficient corresponding to the first direction; b is the linear mapping coefficient of the second direction to the first direction; c is the scaling coefficient corresponding to the second direction, d is the linear mapping coefficient of the first direction to the second direction, t x 、t y are the parameters for controlling the translation along the first direction and the translation along the second direction respectively. The first direction and the second direction are perpendicular to each other. For example, the first direction is the direction where the horizontal side of the image is located, and the second direction is the direction where the vertical side of the image is located.
[0041] Optionally, before detecting the second image to obtain quality data, it includes: calculating the local standard deviation of the corrected printed template image, where the local standard deviation is used to measure the degree of dispersion of gray values within the local area of the corrected printed template image; generating an upper gray threshold image based on the local standard deviation, a preset upper gray threshold, and the corrected printed template image; generating a lower gray threshold image based on the local standard deviation, a preset lower gray threshold, and the corrected printed template image; correspondingly, detecting the second image to obtain quality data includes: detecting the second image based on the upper gray threshold image and the lower gray threshold image to obtain quality data.
[0042] Wherein, the preset upper gray threshold is greater than the preset lower gray threshold.
[0043] By way of example and not limitation, detecting the second image based on the upper gray threshold image and the lower gray threshold image to obtain quality data includes: comparing the upper gray threshold image with the second image to obtain a first comparison result; comparing the lower gray threshold image with the second image to obtain a second comparison result, and obtaining quality data based on the first comparison result and the second comparison result.
[0044] In this embodiment, by calculating the local standard deviation and then constructing an adaptive gray contrast model (the adaptive gray contrast model includes an upper gray threshold image and a lower gray threshold image), it has strong robustness to image imaging distortion. In addition, this embodiment does not need to pre-collect multiple printed template images for modeling. Based on a single corrected printed template image, this embodiment can construct an adaptive gray contrast model and then detect the second image. In this way, the detection efficiency can be improved, and the risk of missed judgment can be effectively reduced and false judgment can be reduced.
[0045] In some embodiments, before calculating the local standard deviation of the corrected printed template image, it includes: calculating the local mean of the corrected printed template image, where the local mean is used to represent the gray average value of the local area of the corrected printed template image; correspondingly, calculating the local standard deviation of the corrected printed template image includes: calculating the local standard deviation of the corrected printed template image based on the local mean.
[0046] By way of example and not limitation, the position of any pixel in the corrected printed template image is denoted as coordinates R ( i, j )), that is R ( i, j ) is used to represent the position in the corrected printed template image at thej row and located at the i column pixel, with R ( i, j ) as the center, the neighborhood window size is , m is a positive integer greater than or equal to 1, n is a positive integer greater than or equal to 1, and the gray values of all pixels within the neighborhood window can be represented by the set { x k,l}. Among them, , , calculate the local mean of the corrected printed matter template image through the first formula, and the first formula can be expressed as , where is used to represent the local mean corresponding to R ( i, j ). Correspondingly, calculating the local standard deviation of the corrected printed matter template image based on the local mean includes: calculating the local standard deviation of the corrected printed matter template image based on the local mean and the second formula, and the second formula can be expressed as , where is used to represent the local standard deviation corresponding to R ( i, j ).
[0047] Optionally, due to the dual reflection effects of printing pressure and the halftone dots on the substrate, combined with the influence of ink transparency, the phenomenon of halftone dot enlargement often occurs during the printing process after the dots are transferred from the printing plate to the substrate. If the two registered images are directly subtracted, a large number of contours will be misreported. To solve this problem, this embodiment introduces the local standard deviation, which can adaptively adjust the relative threshold according to the internal information of the image, and then combines the fixed thresholds (preset gray upper limit threshold, preset gray lower limit threshold), so as to accurately calculate the upper gray threshold image and the lower gray threshold image. Specifically, generating the upper gray threshold image based on the local standard deviation, the preset gray upper limit threshold, and the corrected printed matter template image includes: generating the upper gray threshold image based on the local standard deviation, the specified local standard deviation coefficient, the preset gray upper limit threshold, and the corrected printed matter template image; generating the lower gray threshold image based on the local standard deviation, the preset gray lower limit threshold, and the corrected printed matter template image includes: generating the lower gray threshold image based on the local standard deviation, the specified local standard deviation coefficient, the preset gray lower limit threshold, and the corrected printed matter template image.
[0048] By way of example and not limitation, the local standard deviation, the specified local standard deviation coefficient, the preset upper gray threshold, the corrected printed matter template image, and the upper gray threshold image satisfy the relational expression , where is used to represent the gray value of the pixel located in the j th row and the i th column in the upper gray threshold image, is used to represent the specified local standard deviation coefficient, is used to represent the gray value of the pixel located in the j th row and the i th column in the corrected printed matter template image, is used to represent the preset upper gray threshold; the local standard deviation, the specified local standard deviation coefficient, the preset lower gray threshold, the corrected printed matter template image, and the lower gray threshold image satisfy the relational expression , where is used to represent the gray value of the pixel located in the j th row and the i th column in the lower gray threshold image, is used to represent the preset lower gray threshold.
[0049] In some embodiments, the detecting the second image based on the upper gray threshold image and the lower gray threshold image to obtain quality data includes: Performing the following operations for each first target pixel: comparing the gray value of the first target pixel with the gray value of the second target pixel, and if the gray value of the first target pixel is greater than the gray value of the second target pixel, determining that the gray value of the first target pixel is abnormal, where the first target pixel is a pixel of the second image, and the second target pixel is: a pixel of the upper gray threshold image having the same coordinates as the first target pixel (the pixel in the upper gray threshold image); And, performing the following operations for each first target pixel: comparing the gray value of the first target pixel with the gray value of the third target pixel, and if the gray value of the first target pixel is less than the gray value of the third target pixel, determining that the gray value of the first target pixel is abnormal, where the third target pixel is: a pixel of the lower gray threshold image having the same coordinates as the first target pixel (the pixel in the lower gray threshold image); Obtaining quality data based on all first target pixels with abnormal gray values.
[0050] Among them, the second target pixel is: the upper gray threshold image pixel having the same coordinates as the first target pixel, that is, the position of the second target pixel in the upper gray threshold image is the same as the position of the first target pixel in the second image in this sentence.
[0051] In addition, the third target pixel is: the lower gray threshold image pixel having the same coordinates as the first target pixel, that is, the position of the third target pixel in the lower gray threshold image is the same as the position of the first target pixel in the second image in this sentence.
[0052] For the sake of easy understanding, the following example is given to illustrate the "perform the following operations for each first target pixel: compare the gray value of the first target pixel with the gray value of the second target pixel. If the gray value of the first target pixel is greater than the gray value of the second target pixel, it is determined that the gray value of the first target pixel is abnormal". The examples include: comparing the gray value of the pixel in the first row and first column of the second image with the gray value of the pixel in the first row and first column of the upper gray threshold image. If the gray value of the pixel in the first row and first column of the second image is greater than the gray value of the pixel in the first row and first column of the upper gray threshold image, it is determined that the gray value of the pixel in the first row and first column of the second image is abnormal; comparing the gray value of the pixel in the first row and second column of the second image with the gray value of the pixel in the first row and second column of the upper gray threshold image. If the gray value of the pixel in the first row and second column of the second image is greater than the gray value of the pixel in the first row and second column of the upper gray threshold image, it is determined that the gray value of the pixel in the first row and second column of the second image is abnormal, and so on, comparing other first target pixels with the pixels in the upper gray threshold image.
[0053] In addition, the coordinate systems corresponding to the corrected printed matter template image, the upper gray threshold image, and the lower gray threshold image can be established based on the same coordinate system establishment rules.
[0054] For example, assume that the origin of the coordinate system corresponding to the corrected printed matter template image is located at the upper left corner of the corrected printed matter template image, the positive direction of the first axis of the coordinate system corresponding to the corrected printed matter template image is horizontally to the right, and the positive direction of the second axis of the coordinate system corresponding to the corrected printed matter template image is vertically downward; correspondingly, the origin of the coordinate system corresponding to the upper limit gray threshold image is located at the upper left corner of the upper limit gray threshold image, the positive direction of the first axis of the coordinate system corresponding to the upper limit gray threshold image is horizontally to the right, and the positive direction of the second axis of the coordinate system corresponding to the upper limit gray threshold image is vertically downward; the origin of the coordinate system corresponding to the lower limit gray threshold image is located at the upper left corner of the lower limit gray threshold image, the positive direction of the first axis of the coordinate system corresponding to the lower limit gray threshold image is horizontally to the right, and the positive direction of the second axis of the coordinate system corresponding to the lower limit gray threshold image is vertically downward.
[0055] Optionally, obtaining quality data based on all first target pixels with abnormal gray values includes: generating data indicating that the printed matter corresponding to the to-be-detected printed matter image has defects based on all first target pixels with abnormal gray values.
[0056] In some embodiments, the data indicating that the printed matter corresponding to the to-be-detected printed matter image has defects includes a mask image.
[0057] By way of example and not limitation, the gray values of all fourth target pixels in the mask image are set to G max , where the fourth target pixel is: the pixel at the position corresponding to the first target pixel with an abnormal gray value in the mask image, that is, the position of the fourth target pixel in the mask image is the same as the position of the first target pixel with an abnormal gray value in the second image; the gray values of all fifth target pixels in the mask image are set to G min , that is, the gray values of the pixels in the mask image other than the fourth target pixels are set to G min , and the fifth target pixel is the pixel at the position corresponding to the first target pixel with a normal gray value in the mask image, that is, the fifth target pixel belongs to the pixels in the mask image, and the position of the first target pixel with a normal gray value in the second image is the same as the position of the fifth target pixel in the mask image. In this way, the generated mask image (fourth target pixel) can clearly show the position where the printed matter corresponding to the to-be-detected printed matter image has defects.
[0058] Optionally, the data indicating that the printed matter corresponding to the to-be-detected printed matter image has defects includes the marked to-be-detected printed matter image.
[0059] Among them, the marked area in the printed product image to be detected after marking is used to represent the position where the corresponding printed product has defects. In this way, the printed product image to be detected after marking can prominently show the position where the printed product corresponding to the printed product image to be detected has defects.
[0060] This application can correct the printed product template image based on the human eye visual difference model. Among them, the human eye visual difference model is: a function with the image pixel gray value as the input quantity and the human eye visual perception quantity as the output quantity; based on the human eye visual difference model, the printed product image to be detected is corrected to obtain a first image, and the first image is the corrected printed product image to be detected; based on the corrected printed product template image and the first image, image registration is performed to obtain a second image, and the second image is the registered first image, and, the second image is detected to obtain quality data, and the quality data can reflect the quality of the printed product corresponding to the printed product image to be detected. As can be seen from the above, this application uses the human eye visual perception characteristics to process the image. The human eye visual perception characteristics include: the high sensitivity of the human eye to the low gray level area and the low sensitivity to the high gray level area, that is, this application can skillfully combine machine vision with the human eye visual perception characteristics, thereby avoiding false alarms for quality defects corresponding to high gray level areas and missing reports for quality defects corresponding to low gray level areas, and thus can greatly improve the accuracy of printed product quality detection.
[0061] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution is prior or posterior. The execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of this application. Embodiment 2
[0062] Corresponding to the quality detection method described in the above embodiment, Figure 2 The schematic diagram of the quality detection device provided by the embodiment of this application is shown. For the convenience of description, only the part related to the embodiment of this application is shown.
[0063] The quality detection device includes: a first correction unit 201, a second correction unit 202, and a data acquisition unit 203.
[0064] The first correction unit 201 is used to correct the printed product template image based on the human eye visual difference model. Among them, the human eye visual difference model is: a function with the image pixel gray value as the input quantity and the human eye visual perception quantity as the output quantity.
[0065] A second correction unit 202 is configured to correct the printed matter image to be detected based on the human eye vision difference model to obtain a first image, where the first image is the corrected printed matter image to be detected.
[0066] A data acquisition unit 203 is configured to perform image registration on the corrected printed matter template image and the first image to obtain a second image, where the second image is the registered first image, and to detect the second image to obtain quality data, where the quality data can reflect the quality of the printed matter corresponding to the printed matter image to be detected.
[0067] Optionally, the quality detection device further includes: an image generation unit.
[0068] The image generation unit is configured to: before the data acquisition unit 203 performs the detection on the second image to obtain quality data, calculate the local standard deviation of the corrected printed matter template image, where the local standard deviation is used to measure the degree of dispersion of the gray values in the local area of the corrected printed matter template image; generate an upper gray threshold image based on the local standard deviation, a preset upper gray threshold, and the corrected printed matter template image; generate a lower gray threshold image based on the local standard deviation, a preset lower gray threshold, and the corrected printed matter template image; correspondingly, when the data acquisition unit 203 performs the detection on the second image to obtain quality data, it is specifically configured to: detect the second image based on the upper gray threshold image and the lower gray threshold image to obtain quality data.
[0069] In some embodiments, the image generation unit is further configured to: before performing the calculation of the local standard deviation of the corrected printed matter template image, calculate the local mean of the corrected printed matter template image, where the local mean is used to represent the average gray value of the local area of the corrected printed matter template image; correspondingly, the calculation of the local standard deviation of the corrected printed matter template image includes: calculating the local standard deviation of the corrected printed matter template image based on the local mean.
[0070] It should be noted that for the technical details not described in detail in this embodiment, reference can be made to the quality detection methods provided in the respective embodiments in the above-mentioned Embodiment 1. Embodiment 3
[0071] The terminal device 3 in this embodiment includes: at least one processor 31, a memory 32, and a computer program 33 stored in the memory 32 and executable on the at least one processor 31, and when the processor 31 executes the computer program 33, the steps in any of the above-mentioned quality detection method embodiments are implemented.
[0072] When the processor 31 executes the computer program 33, it implements the steps in the above-mentioned embodiments of various quality inspection methods. For example, Figure 1 the steps S101 to S103 shown. Alternatively, when the processor 31 executes the computer program 33, it implements the functions of each unit in the above-mentioned device embodiments. For example, Figure 2 the functions of the units 201 to 203 shown.
[0073] Those skilled in the art can understand that this embodiment is only an example of the terminal device 3 and does not constitute a limitation on the terminal device 3. It may include more or fewer components than shown in the figure, or combine some components, or different components. For example, it may also include input / output devices, network access devices, etc.
[0074] The so-called processor 31 may be a central processing unit (CPU). The processor 31 may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0075] In some embodiments, the memory 32 may be an internal storage unit of the terminal device 3, such as the hard disk or memory of the terminal device 3. In other embodiments, the memory 32 may also be an external storage device of the terminal device 3, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 3. Further, the memory 32 may also include both the internal storage unit and the external storage device of the terminal device 3. The memory 32 is used to store an operating system, application programs, a boot loader, data, and other programs, such as the program code of the computer program 33. The memory 32 may also be used to temporarily store data that has been output or will be output.
[0076] It should be noted that, for the content such as information interaction and execution process between the above-mentioned devices / units, since it is based on the same concept as the method embodiments of the present application, for its specific functions and the technical effects brought, reference can be specifically made to the method embodiment part, and details will not be repeated here.
[0077] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of the present application. The specific working process of the units and modules in the above system can refer to the corresponding process in the foregoing method embodiments, and details will not be repeated here.
[0078] The embodiment of the present application also provides a computer-readable storage medium, which stores a computer program 33. When the computer program 33 is executed by a processor 31, the steps in the above-mentioned method embodiments can be implemented.
[0079] The embodiment of the present application provides a computer program product. When the computer program product runs on a terminal device 3, the terminal device 3 is caused to execute the steps in the above-mentioned method embodiments.
[0080] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the above-described embodiment methods of the present application, a computer program 33 can be used to instruct relevant hardware to complete. The computer program 33 can be stored in a computer-readable storage medium. When the computer program 33 is executed by a processor 31, the steps of the above-described method embodiments can be implemented. Among them, the computer program 33 includes computer program 33 code, and the computer program 33 code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can at least include: any entity or device capable of carrying the computer program 33 code to the terminal device 3, a recording medium, a computer memory 32, a read-only memory 32 (ROM, Read-Only Memory), a random access memory 32 (RAM, Random Access Memory), an electrical carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk, or an optical disc, etc. In some jurisdictions, according to legislation and patent practice, the computer-readable medium cannot be an electrical carrier signal and a telecommunication signal.
[0081] In the above embodiments, the descriptions of the various embodiments have their own focuses. For parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0082] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0083] In the embodiments provided by the present application, it should be understood that the disclosed device / network device and method can be implemented in other ways. For example, the device / network device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in an electrical, mechanical, or other form.
[0084] The unit described as a separating component may or may not be physically separated. The component shown as a unit may or may not be a physical unit, that is, it may be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0085] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A quality inspection method, characterized in that, Including: Correcting a printed matter template image based on a human eye visual difference model, where the human eye visual difference model is a function with the gray value of the image pixel as the input quantity and the human eye visual perception quantity as the output quantity; Correcting the to-be-detected printed matter image based on the human eye visual difference model to obtain a first image, where the first image is the corrected to-be-detected printed matter image; Performing image registration based on the corrected printed matter template image and the first image to obtain a second image, where the second image is the registered first image, and detecting the second image to obtain quality data, where the quality data can reflect the quality of the printed matter corresponding to the to-be-detected printed matter image.
2. The quality inspection method according to claim 1, wherein The human eye visual difference model is expressed as S= K ln( C / G max + 1), where the S is used to represent the output quantity, and the C is used to represent the input quantity, G max is used to represent the C maximum gray value that can be achieved by the image format of the image where the corresponding pixel is located, K is used to represent the specified coefficient.
3. The quality inspection method according to claim 1, characterized in that, Before detecting the second image to obtain quality data, including: Calculating the local standard deviation of the corrected printed matter template image, where the local standard deviation is used to measure the degree of dispersion of the gray values within the local area of the corrected printed matter template image; Generating an upper gray threshold image based on the local standard deviation, a preset upper gray threshold, and the corrected printed matter template image; Generating a lower gray threshold image based on the local standard deviation, a preset lower gray threshold, and the corrected printed matter template image; Correspondingly, detecting the second image to obtain quality data includes: Detecting the second image based on the upper gray threshold image and the lower gray threshold image to obtain quality data.
4. The quality inspection method according to claim 3, wherein Before calculating the local standard deviation of the corrected printed matter template image, including: Calculating the local mean of the corrected printed matter template image, where the local mean is used to represent the gray average value of the local area of the corrected printed matter template image; Correspondingly, calculating the local standard deviation of the corrected printed matter template image includes: Calculating the local standard deviation of the corrected printed matter template image based on the local mean.
5. The quality inspection method according to claim 3, characterized in that Detecting the second image based on the upper gray threshold image and the lower gray threshold image to obtain quality data includes: Performing the following operations for each first target pixel: Comparing the gray value of the first target pixel with the gray value of the second target pixel. If the gray value of the first target pixel is greater than the gray value of the second target pixel, it is determined that the gray value of the first target pixel is abnormal, where the first target pixel is a pixel of the second image, and the second target pixel is: a pixel of the upper gray threshold image having the same coordinate as the first target pixel; And performing the following operations for each first target pixel: Comparing the gray value of the first target pixel with the gray value of the third target pixel. If the gray value of the first target pixel is less than the gray value of the third target pixel, it is determined that the gray value of the first target pixel is abnormal, where the third target pixel is: a pixel of the lower gray threshold image having the same coordinate as the first target pixel; Obtaining quality data based on all first target pixels with abnormal gray values.
6. The quality inspection method according to claim 1, characterized in that The correction of the printed matter template image based on the human visual difference model includes: Establishing a look-up table corresponding to the human visual difference model; Correcting the printed matter template image based on the look-up table corresponding to the human visual difference model; Correspondingly, the correction of the printed matter image to be detected based on the human visual difference model includes: correcting the printed matter image to be detected based on the look-up table corresponding to the human visual difference model.
7. The quality inspection method according to claim 1, wherein, The image registration of the corrected printed matter template image and the first image to obtain a second image includes: Obtaining an affine transformation matrix based on the corrected printed matter template image, the first image, and the SURF algorithm, and transforming the first image based on the affine transformation matrix to obtain a second image, where the second image is aligned with the corrected printed matter template image.
8. A quality inspection device, characterized in that, Including: A first correction unit for correcting the printed matter template image based on the human visual difference model, where the human visual difference model is a function with the image pixel gray value as the input quantity and the human visual perception quantity as the output quantity; A second correction unit for correcting the printed matter image to be detected based on the human visual difference model to obtain a first image, where the first image is the corrected printed matter image to be detected; A data acquisition unit for performing image registration on the corrected printed matter template image and the first image to obtain a second image, where the second image is the registered first image, and detecting the second image to obtain quality data, where the quality data can reflect the quality of the printed matter corresponding to the printed matter image to be detected.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, the method according to any one of claims 1 to 7 is implemented.