A paper identification detection method
By using halogen lamp light source and grayscale processing, combined with stain detection technology applied to paper surface, the problem of misjudgment caused by light changes and light reflection in traditional methods is solved, and more accurate stain detection is achieved.
Patent Information
- Application Number
- CN202510736914.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-04
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2045-06-04
AI Technical Summary
Traditional paper stain detection methods are prone to misjudgment or missed judgment under the influence of changes in lighting, background noise, and light reflection, making it difficult to achieve high-precision stain identification and classification.
Halogen lamps are used to illuminate the paper surface. By grayscale processing and grid division, the radius of stains and the length of stain appearance are calculated. The real stain grid is screened out, and the center point is connected to determine the stain area.
By avoiding external interference under different lighting conditions, the accuracy and reliability of stain detection are improved, false positives and false negatives are reduced, and comprehensive monitoring of paper surface quality is ensured.
Smart Images

Figure CN120490124B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of visual detection, and particularly relates to a paper quality recognition detection method. BACKGROUND
[0002] In the production and quality control process of paper products, the detection of stains on the surface of paper is an important link to ensure product quality. Traditional stain detection methods usually rely on manual visual inspection or simple image processing techniques. These methods are prone to misjudgment or missed judgment of stain recognition under the influence of factors such as light changes, surface unevenness and background noise. In addition, the detection of subtle stains on the surface of paper is often disturbed by changes in light reflection, resulting in image blurring, which in turn affects subsequent stain recognition and classification.
[0003] With the development of technology, the use of scanners and image processing technology for stain detection has gradually become the mainstream. However, existing technologies still face the following problems: first, the instability of light conditions makes the detection results inconsistent, making it difficult to achieve high-precision stain recognition; second, the interference of background noise and light reflection often leads to the neglect of small stains, thereby affecting the final quality assessment; finally, traditional methods lack in-depth analysis of stain characteristics, and cannot effectively distinguish between similar gray value stains and normal areas, leading to misjudgment.
[0004] Therefore, there is an urgent need for a new stain detection method that can maintain stable detection performance under different light conditions and improve the sensitivity to small stains on the surface of paper through effective visual detection and analysis techniques, ensuring the accuracy and reliability of stain detection. SUMMARY
[0005] The present application aims to at least partially solve one of the problems in the related art. To this end, the purpose of the present application is to propose a paper quality recognition detection method that can avoid stain misjudgment caused by external interference refraction under halogen light conditions, achieving more accurate visual detection of paper stains.
[0006] To achieve the above purpose, the present application proposes a paper quality recognition detection method, which comprises the following steps:
[0007] S100, illuminating the surface of the paper with a halogen lamp and acquiring an image of the surface of the paper;
[0008] S200, performing gray-scale processing on the image of the surface of the paper to obtain a paper gray-scale image;
[0009] S300, obtaining a stain impurity grid from the paper gray-scale image, and obtaining an impurity radius from the stain impurity grid;
[0010] S400, obtaining a stain length from the impurity radius;
[0011] S500, the true stain grid is screened out by the stain appearance length, and the center point of each true stain grid is connected with the center point of the grid corresponding to the impurity radius to obtain a stain area.
[0012] According to the detection method of the embodiment of the application, the false judgment of stains caused by the refraction of external interference can be avoided under the condition of halogen light, and more accurate visual detection of paper stains is achieved.
[0013] Further, the image of the paper surface obtained in step S100 includes: an illumination unit based on a halogen lamp light source, capturing the image of the paper surface by a scanner, wherein the scanner includes an optical scanning module and an image sensor; placing the paper on the scanner, the scanner detects the reflected light by projecting light onto the paper to capture the image of the paper, and the image of the paper is collected by an optical method to generate the image of the paper surface.
[0014] Further, in step S200, the paper grayscale image is obtained by grayscale processing the image of the paper surface, including:
[0015] The image of the paper surface is grayscale processed, and the image of the paper surface after grayscale processing is recorded as a first grayscale image. The first grayscale image is divided into K grids by a grid division algorithm, and the grid size is 800th of the first grayscale image. The first grayscale image is divided into K grids, wherein K=800. The grayscale value of the i-th grid of the first grayscale image is represented by GL(i), and i is [1, K]. K is the number of grids after the first grayscale image is divided. The median of the grayscale values in each grid in GL(i) is obtained and recorded as GLYT, and the average of the grayscale values in each grid in GL(i) is obtained and recorded as GLYTm. The stain grayscale value GLYTp is calculated by the first equation. The stain grayscale value is the grayscale value of the stain impurity in the illumination unit based on the halogen lamp light source. Due to the brightness difference between the stain of the paper and the normal area of the paper, the grayscale difference is determined whether it is a stain impurity.
[0016] The method for calculating the stain grayscale value GLYTp by the first equation is:
[0017] GLYTp = [(GLYT + GLYTm) / 3];
[0018] In step S300, the stain impurity grid is obtained according to the paper grayscale image, and the impurity radius is obtained by the stain impurity grid, specifically:
[0019] The grid with a gray value greater than GLYTp is obtained and recorded as a spot impurity grid, and YRD(j) represents the jth spot impurity grid in the first gray scale image, PD(j) represents the impurity radius of the jth spot impurity grid, j is a serial number, and j has a value of [1, G], where G is the number of spot impurity grids. The impurity radius of the jth spot impurity grid is the length value of the minimum length of the line segment between the center point of the jth spot impurity grid and all spot impurity grid center points.
[0020] Although the halogen lamp light source can provide a uniform light source, the fine spots on the paper surface can still cause image blurring or unclearness due to changes in light reflection, resulting in many abnormal spots with high gray value, which affects subsequent identification of the spots. In addition, the strong illumination provided by the halogen lamp light source can cause high-brightness areas to appear, increasing the reflection contrast between the spots and the normal surface. When the impurity radius is large, it means that the distance between the two spot impurity grids is far, indicating that the two spots may exist independently or be caused by changes in light reflection, and there is no obvious connectivity between them. Conversely, when the impurity radius is small, it means that the distance between the two spot impurity grids is very close, and the two points are essentially or visually connected, forming a spot area. In order to avoid the interference of the spots or misjudgment of the spots, it is necessary to calculate the stain length by the impurity radius to perform deeper spot identification.
[0021] Further, in step S400, the stain length is obtained by the impurity radius, including:
[0022] S401, obtaining the standard deviation of all impurity radii in the impurity radius sequence SYT;
[0023] Specifically, the obtained PD(j) is taken as an element of the impurity radius sequence SYT, and the impurity radius sequence SYT is composed of n impurity radii, which are {PD(1), PD(2), …, PD(j)}, PD(j) is the jth impurity radius in the impurity radius sequence SYT, j is a serial number, and j has a value range of j = 1, 2, …, n. The average value of all impurity radii in the impurity radius sequence SYT is denoted as PTM, and the standard deviation of all impurity radii in the impurity radius sequence SYT is obtained.
[0024] S402, classifying the impurity radius sequence internally by the standard deviation of all impurity radii in the impurity radius sequence SYT; the impurity radius less than or equal to the value of PTM minus the standard deviation is classified as the first impurity radius range PTF1; the impurity radius greater than the average value minus the standard deviation and less than the average value plus the standard deviation is classified as the second impurity radius range PTF2; and the impurity radius greater than or equal to the average value plus the standard deviation is classified as the third impurity radius range PTF3.
[0025] Specifically, the first impurity radius range PTF1 includes all impurity radii less than or equal to PTM minus the standard deviation, the distance between these grids is short, indicating that these grids are gathered together to represent more obvious impurities of the stain; the second impurity radius range PTF2 includes those impurity radii between PTM minus the standard deviation and PTM plus the standard deviation, the distance between these grids is within a reasonable range, and belongs to the relatively less obvious part of the stain impurities; the third impurity radius range PTF3 includes all impurity radii greater than or equal to PTM plus the standard deviation, the distance between these grids is large, meaning that these grids are the edge part of the stain, and the stain impurities are more sparse.
[0026] Further, the distance ranges of the values of the first impurity radius range PTF1, the second impurity radius range PTF2, and the third impurity radius range PTF3 are respectively denoted as [q, qs], [qn, qm], and [qg, p], where q represents the lower limit of the first impurity radius range PTF1; this value is the starting point of the stain radius range, indicating the smallest impurity distance. qs represents the upper limit of the first impurity radius range PTF1, which is the maximum distance between impurity grids with a larger stain severity, indicating the radius value of a more serious stain. qn represents the minimum value of the second impurity radius range PTF2, which is the starting value of the radius of a relatively light stain; qm represents the maximum value of the second impurity radius range PTF2, which is the maximum radius value of a relatively light stain; qg represents the minimum value of the third impurity radius range PTF3, which corresponds to the starting point of the radius of a light stain. p represents the maximum value of the third impurity radius range PTF3, which is the maximum radius value of a very light or almost invisible stain.
[0027] S403, calculate a first impurity appearance radius SYTTF1 and a second impurity appearance radius SYTTF2 through the first impurity radius range PTF1, the second impurity radius range PTF2, and the third impurity radius range PTF3;
[0028] wherein SYTTF1 is the maximum value qs in the first impurity radius range qm minus the minimum distance range difference, wherein the minimum radius range difference is the product of qn and the radius stable balance ratio, wherein the radius stable balance ratio is the ratio of qs×GLYT to qn×GLYTp; wherein SYTTF2 is the maximum value qs in the first impurity radius range qm plus the maximum radius range difference, wherein the maximum radius range difference is the product of qn and the radius anomaly balance ratio, wherein the radius anomaly balance ratio is the ratio of qm×GLYT to (qg+qm)×GLYTp;
[0029] Wherein, the first impurity appearance radius SYTTF1 is used to identify the minimum impurity radius of more obvious and serious stains, and the second impurity appearance radius SYTTF2 is used to identify the minimum impurity radius of less obvious but still need to be concerned stains; GLYT is the median of the gray values of all grids in the first gray map, and GLYTp is the stain gray value.
[0030] In step S404, the stain appearance length SD is calculated by the first impurity appearance radius SYTTF1 and the second impurity appearance radius SYTTF2.
[0031] Specifically, the method for calculating the stain appearance length SD by the first impurity appearance radius SYTTF1 and the second impurity appearance radius SYTTF2 is as follows: taking the difference between qm and qs as QG; taking the difference between p and qm as QK; when SYTTF1 and SYTTF2 are smaller, taking the smaller value as the numerator, and taking the larger value as the denominator, if QK is less than or equal to QG, the stain appearance length SD is set to qsxK, otherwise, the stain appearance length SD of the close-range point cloud is set to qmxK.
[0032] The beneficial effect of this step is that step S405 can accurately identify the position and range of stains on the paper surface by introducing the first impurity appearance radius and the second impurity appearance radius, combining difference calculation and dynamic adjustment of the virtualization coefficient K. Especially under halogen light source illumination, although the strong light provides a uniform light source, the detection of fine stains still faces the influence of noise points and errors caused by changes in light reflection. By calculating the stain appearance length, the detection process not only improves the sensitivity to small stains, but also effectively avoids misjudgment caused by changes in light, thereby preventing the occurrence of over-detection. The flexibility and adaptability of this method enable it to maintain efficient detection performance under different conditions, ensuring comprehensive monitoring of the quality of the paper surface.
[0033] Further, due to the influence of light changes and surface unevenness, the traditional method is prone to misjudgment or omission of stain identification. Secondly, frequent changes in lighting conditions make the detection effect unstable and difficult to maintain accuracy. Background noise and light reflection often interfere with the real detection of stains, causing small stains to be ignored. In order to solve this problem, the present application proposes step S500.
[0034] In step S500, the real stain grid is selected by the stain appearance length, and the center point of each real stain grid is connected with the center point of the grid corresponding to the impurity radius to obtain a stain area, including:
[0035] The grid with PD(j) less than SD in the stain impurity grid is recorded as a real stain grid, the center point of each real stain grid is connected with the center point of the grid with the corresponding impurity radius by a line segment, all the grids in the first gray scale diagram that are passed by the line segment are recorded as stain distribution grids, and the area composed of all the stain distribution grids is recorded as a stain area.
[0036] The present application has the advantages that the stain area is accurately reflected through the gray scale processing and impurity grid analysis, and the accuracy and reliability of the stain detection are improved. BRIEF DESCRIPTION OF DRAWINGS
[0037] Figure 1 A flowchart of a paper quality identification detection method is shown. DETAILED DESCRIPTION
[0038] Embodiments of the present application are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference signs represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by reference to the accompanying drawings are exemplary and are intended to explain the present application, and cannot be understood as limiting the present application.
[0039] Figure 1 A flowchart of a paper quality identification detection method is shown.
[0040] Reference Figure 1 The present application proposes a paper quality identification detection method, which comprises the following steps:
[0041] S100, irradiating the surface of the paper with a halogen lamp and acquiring an image of the surface of the paper;
[0042] S200, performing gray scale processing on the image of the surface of the paper to acquire a paper gray scale diagram;
[0043] S300, acquiring a stain impurity grid according to the paper gray scale diagram, and acquiring an impurity radius through the stain impurity grid;
[0044] S400, acquiring a stain appearance length through the impurity radius;
[0045] S500, screening out real stain grids through the stain appearance length, connecting the center point of each real stain grid with the center point of the grid with the corresponding impurity radius to obtain a stain area.
[0046] According to the detection method of the embodiments of the present application, the stain misjudgment caused by the refraction of external interference can be avoided under the condition of halogen light, and more accurate visual detection of paper stains is achieved.
[0047] Further, the image of the paper surface in step S100 is obtained by a scanning device (Epson Perfection V600 Photo Scanner) including an optical scanning module and an image sensor, and the paper is placed on the scanning device, the scanning device projects light onto the paper, detects reflected light to capture the image of the paper, and generates the image of the paper surface by an optical method.
[0048] Further, the image of the paper surface in step S200 is obtained by a scanning device (Epson Perfection V600 Photo Scanner) including an optical scanning module and an image sensor, and the paper is placed on the scanning device, the scanning device projects light onto the paper, detects reflected light to capture the image of the paper, and generates the image of the paper surface by an optical method.
[0049] The image of the paper surface is processed by a grayscale processing, and the image of the paper surface after the grayscale processing is recorded as a first grayscale image. The first grayscale image is divided into K grids by a grid division algorithm, and the size of the grid is 800th of the first grayscale image. The first grayscale image is divided into K grids, where K=800. The grayscale value of the i-th grid of the first grayscale image is represented by GL(i), and the value of i is [1, K]. The number of grids after the division of the first grayscale image is K. The median of the grayscale values in each grid GL(i) is obtained and recorded as GLYT, and the average of the grayscale values in each grid GL(i) is obtained and recorded as GLYTm. The stain grayscale value GLYTp is calculated by the first equation. The stain grayscale value is the grayscale value of the stain impurity determined by the difference in brightness between the stain and the normal area of the paper under the illumination unit based on the halogen lamp light source.
[0050] The method for calculating the stain grayscale value GLYTp by the first equation is:
[0051] GLYTp = [(GLYT + GLYTm) / 3];
[0052] In step S300, the stain impurity grid is obtained from the paper grayscale image, and the impurity radius is obtained from the stain impurity grid. Specifically:
[0053] The grid with a grayscale value greater than GLYTp is obtained and recorded as a stain impurity grid. The j-th stain impurity grid in the first grayscale image is represented by YRD(j), and the impurity radius of the j-th stain impurity grid is represented by PD(j). The value of j is [1, G], and G is the number of stain impurity grids. The impurity radius of the j-th stain impurity grid is the length of the shortest line segment among all the line segments between the center point of the j-th stain impurity grid and the center points of all the stain impurity grids.
[0054] Further, in step S400, the stain length is obtained by the impurity radius, which includes:
[0055] S401, obtaining the standard deviation of all impurity radii in the impurity radius sequence SYT;
[0056] Specifically, the obtained PD(j) is taken as an element of the impurity radius sequence SYT, and the impurity radius sequence SYT is composed of n impurity radii, i.e., {PD(1), PD(2), …, PD(j)}, PD(j) is the jth impurity radius in the impurity radius sequence SYT, j is a serial number, and j takes a value in the range of j = 1, 2, …, n. The average value of all impurity radii in the impurity radius sequence SYT is denoted as PTM, and the standard deviation of all impurity radii in the impurity radius sequence SYT is obtained.
[0057] S402, classifying the impurity radius sequence internally by the standard deviation of all impurity radii in the impurity radius sequence SYT; the impurity radius less than or equal to the value of PTM minus the standard deviation is classified as the first impurity radius range PTF1; the impurity radius greater than the average value minus the standard deviation and less than the average value plus the standard deviation is classified as the second impurity radius range PTF2; and the impurity radius greater than or equal to the average value plus the standard deviation is classified as the third impurity radius range PTF3.
[0058] Specifically, the first impurity radius range PTF1 contains all impurity radii less than or equal to PTM minus the standard deviation, and the distance between these grids is short, indicating that these grids are clustered together to represent more obvious impurities; the second impurity radius range PTF2 contains impurity radii between PTM minus the standard deviation and PTM plus the standard deviation, and the distance between these grids is within a reasonable range, belonging to the relatively less obvious part of the impurity of the stain; and the third impurity radius range PTF3 contains all impurity radii greater than or equal to PTM plus the standard deviation, and the distance between these grids is large, meaning that these grids are the edge part of the stain and the relatively sparse impurity of the stain.
[0059] Further, the distance range of the first impurity radius range PTF1, the second impurity radius range PTF2, and the third impurity radius range PTF3 is respectively denoted as [q, qs], [qn, qm], [qg, p], wherein q represents the lower limit (minimum value) of the first impurity radius range PTF1; this value is the starting point of the radius range of the stain, representing the minimum impurity distance. qs represents the upper limit (maximum value) of the first impurity radius range PTF1, which is the maximum distance between the impurity grids with a larger stain severity, representing the radius value of a more serious stain. qn represents the minimum value of the second impurity radius range PTF2, i.e., the starting value of the radius of a relatively slight stain; qm represents the maximum value of the second impurity radius range PTF2, i.e., the maximum radius value of a relatively slight stain; qg represents the minimum value of the third impurity radius range PTF3, corresponding to the starting point of the radius of a slight stain. p represents the maximum value of the third impurity radius range PTF3, i.e., the maximum radius value of a very slight or almost invisible stain.
[0060] S403, calculating a first impurity appearance radius SYTTF1 and a second impurity appearance radius SYTTF2 through the first impurity radius range PTF1, the second impurity radius range PTF2, and the third impurity radius range PTF3;
[0061] wherein SYTTF1 is the maximum value qs in the first impurity radius range qm minus the minimum distance range difference, wherein the minimum radius range difference is the product of qn and the radius stable balance ratio, wherein the radius stable balance ratio is the ratio of qs×GLYT to qn×GLYTp; wherein SYTTF2 is the maximum value qs in the first impurity radius range qm plus the maximum radius range difference, wherein the maximum radius range difference is the product of qn and the radius abnormal balance ratio, wherein the radius abnormal balance ratio is the ratio of qm×GLYT to (qg+qm)×GLYTp;
[0062] wherein the first impurity appearance radius SYTTF1 is used to identify the minimum impurity radius of a more obvious and serious stain, and the second impurity appearance radius SYTTF2 is used to identify the minimum impurity radius of a less obvious but still noticeable stain; GLYT is the median of the gray values in all grids in the first gray image, and GLYTp is the stain gray value.
[0063] S404, calculating a stain appearance length SD through the first impurity appearance radius SYTTF1 and the second impurity appearance radius SYTTF2;
[0064] Specifically, the method for calculating the stain appearance length SD through the first impurity appearance radius SYTTF1 and the second impurity appearance radius SYTTF2 is as follows:
[0065] Take the difference between qm and qs as QG; take the difference between p and qm as QK: take the smaller value of SYTTF1 and SYTTF2 as the numerator, and take the larger value of SYTTF1 and SYTTF2 as the denominator ≤QK, set the length of the stain SD to qmxK, otherwise, set the length of the stain SD of the close-range point cloud to qmxK.
[0066] Further, due to the influence of illumination change and surface unevenness, the conventional method is prone to misjudgment or omission of stain identification; secondly, the frequent change of illumination conditions makes the detection effect unstable, and it is difficult to maintain accuracy, background noise and light reflection often interfere with the real detection of stains, causing small stains to be ignored, in order to solve this problem, the present application proposes step S500.
[0067] In step S500, the real stain grid is screened out by the length of the stain, and the center point of each real stain grid is connected with the center point of the grid corresponding to the impurity radius to obtain a stain area, including:
[0068] The grid with PD(j) less than SD in the stain impurity grid is recorded as a real stain grid, the center point of each real stain grid is connected with the center point of the grid corresponding to the impurity radius by a line segment, all the grids in the first gray image that are passed by the line segment are recorded as stain distribution grids, and the area composed of all the stain distribution grids is recorded as a stain area.
[0069] It is to be appreciated that the above description and the examples that follow are intended to be illustrative only and that changes can be made to the description, as represented by the above listed elements, by the steps recited in the flow charts, and by the examples that follow, without departing from the spirit of the application. Accordingly, the scope of the present application is intended to be defined only by the appended claims.
[0070] It should be understood that aspects of the application can be implemented in hardware, software, firmware or a combination thereof. In the above embodiments, various steps or methods can be implemented in software or firmware that is stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any of the following techniques, which are well known in the art of hardware implementation, can be used: a hybrid of the above techniques, a mixture of two or more of the above techniques, or a combination of the above techniques with other techniques not listed above.
[0071] In the description of the present application, the terms "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" are intended to mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. The illustrative appearances of the above-mentioned terms in various places in the specification are not intended to exclude that the terms in one place can refer to the same or similar features, structures, materials, or characteristics as other instances of the same term found in another location in the specification. Furthermore, the description of a particular feature, structure, material, or characteristic, as described in connection with an embodiment or example, is not intended to be taken as a representation that the described feature, structure, material, or characteristic is included in every embodiment or example of the present application. In addition, the description of a particular feature, structure, material, or characteristic is intended to be taken as a representation that the described feature, structure, material, or characteristic is included in at least one embodiment or example of the present application.
[0072] In the description of the present application, it needs to be understood that the terms "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", "axial", "radial", "circumferential" and the like indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, which are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as limiting the present application.
[0073] In addition, the terms "first", "second", and the like used in the embodiments of the present application are only for the purpose of description, and cannot be understood as indicating or implying relative importance, or implicitly indicating the number of technical features referred to in the embodiments. Therefore, the features defined with "first", "second" and the like in the embodiments of the present application can be explicitly or implicitly indicated to include at least one of the features. In the description of the present application, the meaning of the word "plurality" is at least two or two or more, such as two, three, four, etc., unless otherwise specifically limited in the embodiments.
[0074] In the present application, unless otherwise specifically provided or limited in the embodiments, the terms "mounting", "connecting", "connecting" and "fixing" and the like appearing in the embodiments should be understood broadly, for example, the connection can be fixed connection, or detachable connection, or integral, which can be understood, or can be mechanical connection, electrical connection, etc. Of course, it can also be directly connected, or indirectly connected through an intermediate medium, or the internal communication of two elements, or the interaction relationship between two elements. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific implementation situation.
[0075] In the present application, unless otherwise specifically provided and limited, the first feature "on" or "under" the second feature can be that the first and second features are in direct contact, or the first and second features are indirectly in contact through an intermediate medium. Moreover, the first feature "above", "above" and "above" the second feature can be that the first feature is directly above or obliquely above the second feature, or only indicates that the horizontal height of the first feature is higher than that of the second feature. The first feature "below", "below" and "below" the second feature can be that the first feature is directly below or obliquely below the second feature, or only indicates that the horizontal height of the first feature is less than that of the second feature.
[0076] Although the embodiments of the present application have been shown and described above, it is understood that the above-described embodiments are exemplary and are not to be construed as limiting the present application, and that changes, modifications, substitutions and variations can be made by those skilled in the art without departing from the scope of the present application.
Claims
1. A paper identification and detection method, characterized in that, The method includes the following steps: S100, uses a halogen lamp to illuminate the paper surface and acquires an image of the paper surface; S200: Convert the image on the paper surface to grayscale to obtain a grayscale image of the paper. S300: Obtain the stain and impurity grid based on the paper grayscale image, and obtain the impurity radius through the stain and impurity grid; S400, obtain the stain manifestation length through the impurity radius; wherein step S400 includes: S401, obtain the standard deviation of all impurity radii in the impurity radius sequence; S402, internally classify the impurity radius sequence through the standard deviation of all impurity radii; impurity radii less than or equal to the PTM minus the standard deviation are classified as the first impurity radius range PTF1; impurity radii greater than the average minus the standard deviation and less than the average plus the standard deviation are classified as the second impurity radius range PTF2; impurity radii greater than or equal to the average plus the standard deviation are classified as the third impurity radius range PTF3; S403, calculate the first impurity manifestation radius SYTTF1 and the second impurity manifestation radius SYTTF2 through the first impurity radius range PTF1, the second impurity radius range PTF2, and the third impurity radius range PTF3; S404, calculate the stain manifestation length SD through the first impurity manifestation radius SYTTF1 and the second impurity manifestation radius SYTTF2. S500 filters out real stain meshes by stain display length, and connects the center point of each real stain mesh with the center point of the corresponding impurity radius mesh to obtain the stain area.
2. The paper identification and detection method according to claim 1, characterized in that, The process of acquiring an image of the paper surface in step S100 includes: using an illumination unit based on a halogen lamp light source; capturing an image of the paper surface using a scanner, wherein the scanner includes an optical scanning module and an image sensor; placing the paper on the scanner; the scanner capturing the paper image by projecting light onto the paper and detecting the reflected light; and acquiring the image of the paper using optical methods to generate an image of the paper surface.
3. The paper identification and detection method according to claim 1, characterized in that, Step S200 includes: performing grayscale processing on the image of the paper surface, and recording the image of the paper surface after grayscale processing as the first grayscale image; dividing the first grayscale image into grids using a grid division algorithm, with the grid size being 1 / 800 of the first grayscale image, dividing the first grayscale image into K grids, where K=800; denoting GL(i) as the grayscale value of the i-th grid of the first grayscale image, where i takes the value [1, K], and K is the number of grids after the first grayscale image is divided; obtaining the median of the grayscale values in each grid in GL(i) and recording it as GLYT, and obtaining the average value of the grayscale values in each grid in GL(i) and recording it as GLYTm; calculating the stain grayscale value GLYTp using the first equation; wherein the stain grayscale value is the grayscale value used to determine whether a stain is a stain or impurity in the grayscale difference caused by the brightness difference between the stain and the normal area of the paper under a halogen lamp-based lighting unit; The method for calculating the gray value GLYTp of the stain in the first equation is: GLYTp=[(GLYT+GLYTm) / 3].
4. The paper identification and detection method according to claim 1, characterized in that, Step S401 includes: using the obtained PD(j) as an element of the impurity radius sequence SYT, wherein the impurity radius sequence SYT consists of n impurity radii, namely {PD(1), PD(2), ..., PD(j)}, where PD(j) is the j-th impurity radius in the impurity radius sequence SYT, j is the index, and the value range of j is j=1, 2, ..., n; the average value of all impurity radii in the impurity radius sequence SYT is denoted as PTM; and the standard deviation of all impurity radii in the impurity radius sequence SYT is obtained.
5. The paper identification and detection method according to claim 1, characterized in that, Step S403 includes: where SYTTF1 is the maximum value qs in the first impurity radius range qm minus the minimum distance range difference, where the minimum radius range difference is the product of qn and the radius stable balance ratio, where the radius stable balance ratio is the ratio of qs×GLYT to qn×GLYTp; where SYTTF2 is the maximum value qs in the first impurity radius range qm plus the maximum radius range difference, where the maximum radius range difference is the product of qn and the radius abnormal balance ratio, where the radius abnormal balance ratio is the ratio of qm×GLYT to (qg+qm)×GLYTp.
6. The paper identification and detection method according to claim 1, characterized in that, Step S404 includes: the method for calculating the stain manifestation length SD using the first impurity manifestation radius SYTTF1 and the second impurity manifestation radius SYTTF2 is as follows: The difference between qm and qs is taken as QG; the difference between p and qm is taken as QK. The smaller value of SYTTF1 and SYTTF2 is used as the numerator, and the larger value of SYTTF1 and SYTTF2 is used as the denominator. The ratio of the numerator to the denominator is used as the spatial edge blurring coefficient K. When QG≤QK, the stain appearance length SD is set to qs×K; otherwise, the stain appearance length SD of the near-distance point cloud is set to qm×K.
7. The paper identification and detection method according to claim 1, characterized in that, Step S500 includes: In the taint impurity grid, the grids with PD(j) less than SD are denoted as real taint grids. The center point of each real taint grid is connected to the center point of the grid with the corresponding impurity radius by a line segment. All grids in the first grayscale image that are passed through by the line segment are denoted as taint distribution grids. The region composed of all taint distribution grids is denoted as taint region.
Citation Information
Patent Citations
Camera device stain detection method and device based on gradient direction
CN116958003A
Optical lens surface scratch detection method and system
CN119379620A