Pattern printing defect detection method for medicine packaging box

By calculating the comparison of multiple indexes and thresholds in the printing data of the drug packaging box, the problems of low efficiency of traditional manual inspection and difficulty in identifying subtle defects are solved, efficient and accurate printing defect detection is achieved, and the printing quality inspection capability of the drug packaging box is improved.

CN119540233AInactive Publication Date: 2025-02-28ZHUHAI WANJIANG PRINTING CO LTD

Patent Information

Application Number
CN202510091937.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-21
Publication Date
2025-02-28
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional manual visual inspection of drug packaging boxes has low quality and efficiency, is susceptible to subjective factors, and is difficult to accurately identify subtle printing defects, which cannot meet the high-quality and high-precision testing needs of modern drug packaging.

Method used

By collecting the printed data to be tested and the standard template data, calculate the index of the text and pattern in positions, colors, edges, etc., and compare them with the corresponding threshold to determine whether there are printing defects.

Benefits of technology

It realizes efficient, accurate and objective printing defect detection, and can accurately identify subtle differences in the position and color of text and patterns, improving the detection accuracy and reliability of the printing quality of pharmaceutical packaging boxes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119540233A_ABST
    Figure CN119540233A_ABST
Patent Text Reader

Abstract

The invention discloses a medicine packaging box pattern printing defect detection method, and relates to the technical field of printing quality detection, and the main scheme is as follows: collecting to-be-detected printing data and standard printing packaging box template data, and then calculating a character deviation index, a pattern position coordinate index and a to-be-detected color index according to the data; wherein the character deviation index is obtained by the pixel and format similarity index of the character area; the pattern position coordinate index is calculated based on the standard position coordinate system number and the data to be measured; a color index to be detected is calculated by a deviation color coefficient and the like, then text, position and color index thresholds are set, whether a text area, a pattern position and a pattern color are qualified or not is judged by comparing each index with a corresponding threshold, the printing defect is judged to exist as long as one of the indexes is unqualified, and the method can effectively detect the printing defect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of printing quality detection, and in particular to a method for detecting printing defects of patterns on medicine packaging boxes. Background Art

[0002] In the field of pharmaceutical packaging, the quality of pattern printing on the packaging box is crucial. It is directly related to the brand image of the drug and consumers' trust and recognition of the drug. Printing defects may lead to inaccurate information transmission, appearance defects and other problems, seriously affecting the market competitiveness and safety of the drug.

[0003] The traditional method of inspecting the printing quality of pharmaceutical packaging boxes mainly relies on manual visual inspection. Inspectors rely on their own experience and naked eye observation to compare with standard samples to judge the clarity of text, integrity of patterns, color accuracy, and position accuracy. This method can detect more obvious printing defects to a certain extent, but it has many limitations. Manual inspection is inefficient and is greatly affected by the subjective factors of inspectors. Moreover, for some subtle printing defects, such as slight color deviations, manual inspection is difficult to accurately identify, which cannot meet the high-quality and high-precision inspection requirements of modern pharmaceutical packaging. There is an urgent need for a more efficient, accurate and objective printing defect detection method. Summary of the Invention

[0004] (1) Technical problems solved In response to the shortcomings of the existing technology, the present invention provides a method for detecting printing defects in patterns on pharmaceutical packaging boxes. By collecting the printed data to be tested and the standard template data, the indexes of the text and pattern in terms of position, color, edge, etc. are calculated and compared with the corresponding thresholds. This solves the problems of traditional manual visual inspection of the printing quality of pharmaceutical packaging boxes, which is inefficient, easily affected by subjective factors, and difficult to accurately identify subtle printing defects.

[0005] (2) Technical solution To achieve the above objectives, the present invention is implemented through the following technical solutions: A method for detecting pattern printing defects on a pharmaceutical packaging box, comprising: Collect the printing data to be tested and the template data of the standard printed packaging box; collect the drug information data and regulatory code data of the drug packaging box to be tested; Calculate the pixel similarity index W1 and format similarity index W2 of the text area based on the template data and the printed data to be tested, and further calculate the text deviation index Ip; calculate the standard position coordinate coefficient Co based on the template data, and further calculate the pattern position coordinate index pu based on the printed data to be tested; calculate the deviation color coefficient based on the template data and the printed data to be tested , pixel deviation value And ink layer thickness deviation value ; According to the deviation color coefficient , pixel deviation value And ink layer thickness deviation value Calculating the color index RCI to be tested; wherein the template data also includes a standard text area value S1, a standard text pixel height average H1, and a standard character spacing pixel distance average J1 of the text area; the printed data to be tested also includes a text area value S2 to be tested, a text pixel height value H2 to be tested, and a pixel distance value J2 corresponding to the character spacing of the text area; calculating a format similarity index W2 based on the standard text area value S1, the standard text pixel height average H1, the standard character spacing pixel distance average J1, the text area value S2 to be tested, the text pixel height value H2 to be tested, and the pixel distance value J2 corresponding to the character spacing; Set the text deviation index threshold JV, position coordinate index threshold GV and color index threshold FV; Based on the comparison result of the character deviation index Ip and the character deviation index threshold JV, the text area is judged to be qualified; based on the comparison result of the pattern position coordinate index pu and the position coordinate index threshold GV, the pattern position is judged to be qualified; based on the comparison result of the color index to be tested RCI and the color index threshold FV, the pattern color is judged to be qualified; when any one of the comparison results is unqualified, it is judged that there is a printing defect; when all three comparison results are qualified, it is preliminarily judged that there is no printing defect; When it is preliminarily determined that there is no printing defect, the name and dosage form matching degree M is calculated based on the drug information data and regulatory code data. N , specification matching degree M S Matching degree with approval number M A , and further calculate the matching value M between drug information and regulatory code total ; Set the matching threshold M t , according to the matching value M of drug information and regulatory code total and matching threshold M t The comparison results can be used to further determine whether there are printing errors between the drug information and the regulatory code.

[0006] In the preferred embodiment of the above-mentioned method for detecting printing defects of drug packaging boxes, the specific steps of calculating the pixel similarity index W1 are as follows: The template data also includes the standard pixel value f(x,y) of the text area and the average pixel value of the text ; The printed data to be tested also includes the pixel value g(x,y) of the text area to be tested and the average pixel value of the text to be tested. ; According to the text standard pixel value f(x,y), the text pixel average , the pixel value g(x,y) of the text to be tested and the average value of the pixels of the text to be tested , calculate the pixel similarity index W1, based on the following specific formula:

[0007] Among them, x represents the horizontal coordinate of the sampling point in the text area, y represents the vertical coordinate of the sampling point in the text area, the value range of the standard pixel value f(x,y) of the text is [0,255], and the value range of the pixel value g(x,y) of the text to be tested is [0,255].

[0008] In the preferred embodiment of the above-mentioned method for detecting pattern printing defects on pharmaceutical packaging boxes, the specific formula for calculating the format similarity index W2 is as follows:

[0009] in, represent The weight coefficient is 0.1≤ ≤0.4, represent The weight coefficient is 0.2≤ ≤0.5, represent The weight coefficient is 0.3≤ ≤0.4, and .

[0010] In the preferred embodiment of the above-mentioned method for detecting printing defects of drug packaging boxes, the method for calculating the text deviation index Ip is: The text deviation index Ip is calculated based on the pixel similarity index W1 and the format similarity index W2. The specific formula is as follows:

[0011] Wherein, b1 represents the weight coefficient of the pixel similarity index w1, and its value is 0.4≤b1≤0.6; b2 represents the weight coefficient of the format similarity index W2, and its value is 0.5≤b2≤0.6, and b1+b2=1.

[0012] In the preferred embodiment of the above-mentioned method for detecting pattern printing defects on pharmaceutical packaging boxes, the specific steps for calculating the standard position coordinate coefficient Co are as follows: The template data also includes the standard boundary coordinates of different pattern areas ; Set the reference coordinate point (x0, y0); According to the standard boundary coordinates And the reference coordinate point (x0, y0), calculate the standard position coordinate coefficient Co, based on the following specific formula:

[0013] in, Represents the jth boundary horizontal coordinate of the i-th pattern area on the packaging box template, Represents the jth boundary vertical coordinate of the i-th pattern area on the packaging box template; i is the serial number of the pattern area on the packaging box template, and its value is [1,n]; j is the serial number of the boundary coordinate, and its value is [1,m], where m is the total number of boundary coordinates.

[0014] In the preferred embodiment of the above-mentioned method for detecting pattern printing defects on a medicine packaging box, the specific steps for calculating the pattern position coordinate index pu are as follows: The printed data to be tested also includes the standard boundary coordinates to be tested , the reference coordinate point (x0, y0) and the standard position coordinate coefficient Co, calculate the pattern position coordinate index pu, based on the specific formula as follows:

[0015] in, represents the jth boundary horizontal coordinate of the i-th pattern area, Represents the jth boundary ordinate of the i-th pattern area.

[0016] In the preferred embodiment of the above-mentioned method for detecting printing defects of drug packaging boxes: calculating the deviation color coefficient The method is: The template data also includes standard color values , standard brightness value and standard color .

[0017] The printing data to be tested also includes the tone value of the printed product to be tested , lightness value and chromaticity values ; According to the standard hue value , standard brightness value , standard chromaticity , hue value , lightness value and chromaticity values , calculate the deviation color coefficient , the specific formula is as follows:

[0018] in, is the hue value of the i-th pattern area of ​​the packaging box template, is the brightness value of the i-th pattern area of ​​the packaging box template, Represents the standard chromaticity of the i-th pattern area of ​​the packaging box template, represents the hue value of the i-th pattern area of ​​the printed product to be detected, Represents the brightness value of the i-th pattern area of ​​the printed product to be detected, Represents the standard chromaticity of the i-th pattern area of ​​the printed product to be tested.

[0019] In the preferred embodiment of the above-mentioned method for detecting printing defects of drug packaging boxes: calculating the pixel deviation value And ink layer thickness deviation value The method is: Template data also includes standard pixel values ​​for different pattern areas and standard ink layer thickness values ; The printed data to be tested also includes the standard pixel values ​​to be tested in different pattern areas and the ink layer thickness to be measured ; According to the standard pixel value and the standard pixel value to be tested Calculate pixel deviation value , the specific formula is as follows:

[0020] in, is the t-th pixel value representing the i-th pattern area on the packaging box template, Represents the t-th pixel value of the i-th pattern area on the packaging box template to be tested, t represents the number of pixel values, and its value is [1,q], where q represents the total number of pixel values.

[0021] According to the standard ink layer thickness value and the ink layer thickness to be measured Calculate ink layer thickness deviation , based on the following formula:

[0022] in, is the ink layer thickness value of the i-th pattern area on the packaging box template, is the ink thickness value of the i-th pattern area on the packaging box to be tested.

[0023] In the preferred embodiment of the above-mentioned method for detecting pattern printing defects on pharmaceutical packaging boxes, the specific steps of calculating the color index RCI to be tested are as follows: According to the deviation color coefficient , pattern pixel deviation coefficient And ink layer thickness deviation value , calculate the color index RCI to be measured, based on the following formula:

[0024] in, Represents the deviation color coefficient The weight coefficient is 0.1≤ ≤0.4, Represents the pattern pixel deviation coefficient The weight coefficient is 0.2≤ ≤0.5, Represents the ink layer thickness deviation value The weight coefficient is 0.3≤ ≤0.4, and .

[0025] In the preferred embodiment of the above-mentioned method for detecting pattern printing defects on pharmaceutical packaging boxes, the specific steps for determining whether the packaging box is qualified are as follows: When the character deviation index Ip>the character deviation index threshold JV, the character area is judged as unqualified; When the character deviation index Ip≤the character deviation index threshold JV, the character area is determined to be qualified; When the pattern position coordinate index pu> the position coordinate index threshold GV, it is determined that the pattern position coordinate is unqualified; When the pattern position coordinate index pu ≤ the position coordinate index threshold GV, the pattern position coordinate is determined to be qualified; When the color index RCI to be tested is greater than the color index threshold FV, the pattern color is judged to be unqualified; When the color index RCI to be tested is less than or equal to the color index threshold FV, the pattern color is judged to be qualified; The method for determining whether there are printing errors in drug information and regulatory codes is: Drug information data includes name and dosage form strings. 、Specification string 1 and approval number string ; Regulatory code data includes name and dosage form string 2 、Specification string 2 and approval number string 2 ; Calculate the name and dosage form matching degree based on drug information data and regulatory code data , specification matching Matching degree with approval document number , the method is as follows: Use Boolean function to calculate the matching degree between name and dosage form , based on the following formula:

[0026] Setting the specification matching threshold ; According to the specification string one 、Specification string 2 and specification matching threshold , calculate the specification matching degree , based on the following formula:

[0027] Use Boolean function to calculate the matching degree of approval document number , based on the following formula:

[0028] According to the matching degree of name and dosage form , specification matching Matching degree with approval document number Calculate the matching value between drug information and regulatory code , based on the following formula:

[0029] in, Representative name and dosage form matching The weight coefficient is 0.1≤ ≤0.4; Representative specification matching The weight coefficient is 0.1≤ ≤0.4, Representative approval number matching degree The weight coefficient is 0.1≤ ≤0.4; When the drug information matches the regulatory code ≥ matching threshold When the drug information and the regulatory code are printed correctly, it is determined that the drug information and the regulatory code are printed correctly; when the drug information and the regulatory code match value <Matching threshold When the drug information and regulatory code are printed incorrectly, it is determined that the drug information and regulatory code are printed incorrectly.

[0030] (3) Beneficial effects The present invention provides a method for detecting printing defects on pharmaceutical packaging boxes, which has the following beneficial effects: (1) Collect the printed data to be tested and the standard template data to provide a basis for subsequent accurate analysis and judgment, so that the test has an objective data basis and avoids the subjectivity and arbitrariness of manual testing.

[0031] (2) By calculating the pixel similarity index, format similarity index and text deviation index of the text area, the accuracy of text printing can be accurately measured, and defects such as deformation and dislocation of text can be effectively detected to ensure the accuracy of drug information transmission. Compared with manual detection, it is more accurate and detailed, and can avoid information misunderstandings caused by text problems.

[0032] (3) Calculate the pattern position coordinate index based on the standard position coordinate index and the data to be measured, accurately determine whether the pattern position is offset, ensure the layout of the pattern on the packaging box is standardized, improve the overall aesthetics and professionalism of the packaging box, and overcome the problem that it is difficult for humans to accurately judge the tiny position deviation of the pattern.

[0033] (4) Calculate the text deviation index, pattern position coordinate index and the color index to be tested, which can keenly capture the subtle differences in the position and color of text and patterns, ensure the consistency of printed colors, improve the visual effect of pharmaceutical packaging, and solve the problem of manual detection being insensitive to color.

[0034] (5) Collect the test and standard printing data and calculate various indexes. The text deviation index is compared with the threshold. If the text deviation index exceeds the text deviation index threshold, the text area is defective; the pattern position coordinate index is similar. If it does not meet the threshold, the coordinate position of the pattern is defective; if the color index to be tested is not within the color index threshold range, there is a problem with the color of the pattern; it solves the problems of low efficiency and poor accuracy of manual inspection, and printing defects will make the drug information incomplete and may also bring safety risks. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 The figure is a flow chart of a method for detecting pattern printing defects on a medicine packaging box according to the present invention. DETAILED DESCRIPTION

[0036] The following will provide a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0037] See also Figure 1 The present invention provides a method for detecting pattern printing defects on a medicine packaging box, comprising: Step 1: Collect the printing data to be tested and the template data of the standard printed packaging box; collect the drug information data and regulatory code data of the drug packaging box to be tested;

[0038] Step 2: Calculate the pixel similarity index W1 and format similarity index W2 of the text area based on the template data and the printed data to be tested, and further calculate the text deviation index Ip; calculate the standard position coordinate coefficient Co based on the template data, and further calculate the pattern position coordinate index pu based on the printed data to be tested; calculate the deviation color coefficient based on the template data and the printed data to be tested , pixel deviation value And ink layer thickness deviation value ; According to the deviation color coefficient , pixel deviation value And ink layer thickness deviation value Calculate the color index RCI to be tested.

[0039] Step 201: The specific steps of calculating the pixel similarity index W1 are: The template data includes the standard pixel value f(x,y) of the text area and the average pixel value of the text .

[0040] The printed data to be tested includes the pixel value g(x,y) of the text area to be tested and the average pixel value of the text to be tested. .

[0041] It should be noted that the standard pixel value f(x,y) of the text refers to the pixel value at the coordinate (x,y) of the drug packaging box template, which can be obtained through tools such as scanners. (x,y) is a set of coordinate points; the average value of the text pixel is It is obtained by summing up all the obtained text standard pixel values ​​f(x, y) and further calculating the average value.

[0042] According to the text standard pixel value f(x,y), the text pixel average , the pixel value g(x,y) of the text to be tested and the average value of the pixels of the text to be tested , calculate the pixel similarity index W1, based on the following specific formula:

[0043] Among them, x represents the horizontal coordinate of the sampling point in the text area, y represents the vertical coordinate of the sampling point in the text area, the value range of the standard pixel value f(x,y) of the text is [0,255], and the value range of the pixel value g(x,y) of the text to be tested is [0,255].

[0044] It should be noted that the purpose of this formula is to quantify the similarity between the template data and the text area in the test data by comparing the pixel value difference between the two. The closer the value of the pixel similarity index W1 is to 1, the more similar the test data is to the template data, that is, the higher the accuracy of the text printing; conversely, the smaller the W1 value is, the greater the deviation in the text printing.

[0045] This formula calculates the pixel similarity index, which can accurately quantify the pixel differences between the template data and the text area of ​​the data to be tested. By summing the products of the corresponding pixel values ​​and the mean differences in the numerator and normalizing the denominator, it objectively reflects the similarity between the two. Its beneficial effect is to provide an accurate numerical basis for the evaluation of text printing accuracy, effectively distinguish between qualified and unqualified printing, improve detection accuracy, overcome the limitation of manual detection that is difficult to quantify and judge text pixel deviations, and ensure the quality of text printing on pharmaceutical packaging.

[0046] Step 202: The method for calculating the format similarity index W2 is: The template data also includes a standard text area value S1, a standard text pixel height average value H1, and a standard character spacing pixel distance average value J1 of the text area.

[0047] It should be noted that the standard text area value S1 is determined by using professional image editing software or printing design software, such as Adobe Illustrator, when making a template for a standard printed packaging box, to determine the boundary of the text area and calculate the area occupied by the text using Adobe Illustrator.

[0048] The standard text pixel height average H1 is determined by calculating the average pixel height of all characters within a text area. The pixel height of the characters can be obtained using Adobe Illustrator software.

[0049] The standard character spacing pixel distance average value J1 is a pixel distance determined in units of the number of pixels, such as the pixel distance between the rightmost pixel point of the previous character and the leftmost pixel point of the next character. It can be measured using software such as Adobe Illustrator, which counts all character spacings and calculates the average value to obtain the standard character spacing pixel distance average value J1.

[0050] The printing data to be tested also includes the area value S2 of the text to be tested, the pixel height value H2 of the text to be tested, and the pixel distance value J2 corresponding to the character spacing.

[0051] It should be noted that the text area value S2 to be measured refers to the area of ​​the text area of ​​the drug packaging box to be measured. After scanning the drug packaging box to be measured with a scanner to obtain an image, Adobe Illustrator image editing software is used to determine the boundary of the text area and calculate the text area value S2 to be measured.

[0052] The pixel height value H2 of the text to be tested refers to the pixel height value of the text on the packaging box of the drug to be tested. Use Adobe Illustrator image editing software to measure the pixel height value H2 of the text to be tested. After selecting the text area, use the measurement tool in the software to measure the height of the text and record the height value in pixels.

[0053] The pixel distance value J2 refers to the pixel distance value of the drug packaging box to be tested. Use Adobe Illustrator image editing software to measure the pixel distance value J2 corresponding to the character spacing. After selecting the text area, use the measurement tool in the software to measure the distance between adjacent characters and record the distance value in pixels.

[0054] The format similarity index W2 is calculated based on the standard text area value S1, the standard text pixel height average H1, the standard character spacing pixel distance average J1, the test text area value S2, the test text pixel height value H2 and the character spacing corresponding pixel distance value J2. The specific formula is as follows:

[0055] in, represent The weight coefficient is 0.1≤ ≤0.4, represent The weight coefficient is 0.2≤ ≤0.5, represent The weight coefficient is 0.3≤ ≤0.4, and .

[0056] It should be noted that , used to measure the proportion of text area deviation in the entire text deviation index. Similarly, it is used to measure the proportion of text pixel height deviation. It is used to measure the proportion of character spacing deviation. Finally, the three items are added together to obtain the format similarity index W2. This index comprehensively considers the deviation of text area, pixel height and character spacing, and is used to evaluate the overall deviation degree of text printing.

[0057] This formula comprehensively considers text area, pixel height and character spacing deviation. By comparing each parameter with the corresponding standard value and taking weighted summation, it accurately quantifies the overall deviation of the text. It can comprehensively and meticulously reflect the quality of text printing, and effectively detect defects such as text deformation, size change and abnormal spacing. Compared with single indicator evaluation, it provides more comprehensive and accurate judgment, greatly improves detection reliability, and ensures the accuracy of text printing standards and information transmission on pharmaceutical packaging.

[0058] Step 203: The method for calculating the character deviation index Ip is: The text deviation index Ip is calculated based on the pixel similarity index W1 and the format similarity index W2. The specific formula is as follows:

[0059] Wherein, b1 represents the weight coefficient of the pixel similarity index W1, and its value is 0.4≤b1≤0.6; b2 represents the weight coefficient of the format similarity index W2, and its value is 0.5≤b2≤0.6, and b1+b2=1.

[0060] It should be noted that if the value of the pixel similarity index W1 is large and b1 is close to the upper limit of its value range, then the contribution of the pixel similarity to will be greater; conversely, if the value of the format similarity index W2 is large b2 and close to the upper limit of its value range, then the contribution of the format similarity to will be greater. In this way, the formula comprehensively considers the similarities of both pixels and formats to evaluate text deviation.

[0061] This formula, by weighting the pixel similarity index and format similarity index and comprehensively considering both the pixel and format characteristics of text, can accurately capture deviations in text presentation and layout, avoiding the limitations of single-factor evaluation. It can effectively detect text defects such as blurriness, deformation, and abnormal spacing and size, improving detection accuracy and comprehensiveness. This provides a reliable basis for evaluating the quality of printed text on pharmaceutical packaging, ensuring the standardization and integrity of packaging text information.

[0062] Step 204: The specific steps for calculating the standard position coordinate coefficient Co are: The template data also includes the standard boundary coordinates of different pattern areas .

[0063] Set the base coordinate point (x0, y0).

[0064] It should be noted that the standard boundary coordinates Refers to the boundary coordinates of different patterns in the drug packaging box template, representing the precise position of the pattern on the packaging box template, obtained through Adobe Illustrator software, where Represents the jth boundary horizontal coordinate of the i-th pattern area on the packaging box template, Represents the jth boundary vertical coordinate of the i-th pattern area on the packaging box template; i is the serial number of the pattern area on the packaging box template, and its value is [1,n]; j is the serial number of the boundary coordinate, and its value is [1,m]; m represents the serial number of the pattern number, and the total number of (x0,y0) boundary coordinates.

[0065] The reference coordinate point (x0, y0) is determined by selecting a fixed geometric center or a specific corner point of the box when making a template for a standard printed box through professional image editing software or print design software such as Adobe Illustrator. For example, for a box with a regular shape, its geometric center is used as the reference coordinate point. If the box is a square with side lengths io and uk, then the coordinates of the geometric center (x0, y0) can be .

[0066] According to the standard boundary coordinates And the reference coordinate point (x0, y0), calculate the standard position coordinate coefficient Co, based on the following specific formula:

[0067] It should be noted that through double summation , sum the squares of the distances from all boundary coordinate points of all pattern areas to the reference coordinate points, thus obtaining a quantity reflecting the overall dispersion of the boundary coordinates of all standard patterns relative to the reference coordinate points; n×m is the total number of boundary coordinate points of all pattern areas; As a normalization factor, the purpose is to normalize the sum of the molecules so that the calculated standard position coordinate coefficient Co is in a reasonable range, such as between 0 and 1, to facilitate comparison and calculation.

[0068] This formula quantifies the relationship between the standard pattern boundary coordinates and the reference coordinates, mathematically summarizing the standard position characteristics. This formula accurately determines the standard layout pattern on the packaging box, providing a reliable reference for subsequent position comparisons with the pattern under test. This effectively detects defects such as pattern offset and tilt, improving position detection accuracy, ensuring the standardization and consistency of pattern layout on pharmaceutical packaging, and enhancing overall packaging quality.

[0069] Step 205: The specific steps of calculating the pattern position coordinate index pu are: The printed data to be tested also includes the standard boundary coordinates to be tested And the reference coordinate point (x0, y0).

[0070] It should be noted that the standard boundary coordinates to be measured The boundary coordinates of different patterns in the drug packaging box to be tested are obtained by scanning the image data of the drug packaging box to be tested using a scanner, and then obtaining the standard boundary coordinates to be tested from the image data using Adobe Illustrator software. ,in, Represents the jth boundary horizontal coordinate of the i-th pattern area on the packaging box to be tested, Represents the jth boundary ordinate of the i-th pattern area on the packaging box to be tested.

[0071] The printed data also includes the standard coordinates to be measured , the reference coordinate point (x0, y0) and the standard position coordinate coefficient Co, calculate the pattern position coordinate index pu, based on the specific formula as follows:

[0072] It should be noted that This part reflects the dispersion degree of the boundary of the pattern to be measured relative to the reference coordinate point. n×m is the total number of boundary coordinate points of the pattern to be measured. The difference between the position of the pattern to be tested and the position of the standard pattern can be further compared.

[0073] The entire formula calculates the color index (pu) of the color being tested. A larger pu value indicates a greater difference between the test pattern and the standard pattern; a smaller pu value indicates a greater difference between the test pattern and the standard pattern. By comparing the pu value with a preset color index threshold, the qualified color can be determined.

[0074] This formula accurately quantifies the degree of dispersion of the boundary of the pattern to be measured relative to the reference coordinates, and intuitively presents the pattern position deviation in numerical form. With the help of normalization of the denominator, fair comparison between patterns of different sizes can be achieved. By comparing the calculated index with the threshold, it can effectively determine whether the pattern color is qualified. It plays a key role in controlling the quality of pharmaceutical packaging and printing, which is conducive to ensuring the accuracy and consistency of product pattern position and improving the overall packaging quality.

[0075] Step 206: Calculate the deviation color coefficient The method is: The template data also includes standard color values , standard brightness value and standard color .

[0076] The printing data to be tested also includes the tone value of the printed product to be tested , lightness value and chromaticity values .

[0077] It should be noted that the brightness value It is a parameter that describes the brightness of a color. The brightness of a color is a gradient scale from black to white. It reflects the brightness of the printed color. The brightness value can be obtained by spectrophotometer. and standard hue values .

[0078] tone Usually refers to the type of color, such as red, blue, green, etc. In this method for detecting printing defects of pharmaceutical packaging boxes, the hue value of the printed matter to be detected is It reflects the quantitative value related to the color type presented by the printed product. The hue value can be obtained through a colorimeter. And the standard brightness value .

[0079] Chromaticity value It is a parameter that describes the color purity of a color, reflecting the proportion of color components contained in the color. A high chroma value indicates that the color is more vivid and pure, while a low chroma value indicates that the color is darker or close to gray. It reflects the color purity of the printed product. The chromaticity value can be obtained through the color analyzer. and standard color .

[0080] Calculate the deviation color coefficient based on the standard hue value L2, standard lightness value a2, standard chroma b2, hue value L1, lightness value a1 and chroma value b1 , the specific formula is as follows: .

[0081] in, is the hue value of the i-th pattern area of ​​the packaging box template, is the brightness value of the i-th pattern area of ​​the packaging box template, Represents the standard chromaticity of the i-th pattern area of ​​the packaging box template, represents the hue value of the i-th pattern area of ​​the printed product to be detected, Represents the brightness value of the i-th pattern area of ​​the printed product to be detected, Represents the standard chromaticity of the i-th pattern area of ​​the printed product to be tested.

[0082] It should be noted that the calculation , this part is to calculate the sum of the squares of the differences between the pixel block and the standard values ​​in the three dimensions of hue, lightness, and chroma; then take the square root of this sum , get the Euclidean distance of the pixel block in the color space, that is, the color deviation of the pixel block, and finally sum the color deviations of all pixel blocks and divide it by the number of pixel blocks n to get the average deviation color coefficient , can be used to measure the average degree of color deviation between printed matter and standard template, the deviation color coefficient The larger the value, the greater the color deviation.

[0083] This formula comprehensively considers the differences between pixel blocks and standard values ​​in terms of hue, brightness, and chroma, and derives the average degree of deviation through precise mathematical calculations. It can intuitively reflect the deviation of printed colors from the standard with quantitative values, and effectively detect color defects such as color cast and fading. In pharmaceutical packaging printing inspection, it can accurately control color quality, ensure the consistency and accuracy of product packaging colors, and enhance the stability of the brand's visual image.

[0084] Step 207: The template data also includes standard pixel values ​​of different pattern areas and standard ink layer thickness values .

[0085] It should be noted that the standard pixel value It is the t-th pixel value of the ith image area in the packaging box template; it can be obtained through professional image editing software or print design software, such as Adobe Illustrator, when making a template for a standard printed packaging box.

[0086] Standard pixel value to be tested The pixel value of the tth pixel in the i-th pattern area on the packaging box template to be tested under ideal conditions is obtained by scanning the printed product to be tested with a high-resolution flatbed scanner and using image processing software to extract the pixel value of the specified pattern area as the standard pixel value to be tested. .

[0087] The printed data to be tested also includes the standard pixel values ​​to be tested in different pattern areas and the ink layer thickness to be measured .

[0088] Standard ink layer thickness value is the ink layer thickness value of the i-th image area of ​​the packaging box template; it can be obtained based on the optical coherence tomography scanner, and the scanning data can be analyzed using OCT software to extract the ink layer thickness value of the specified pattern area.

[0089] The thickness of the ink layer to be measured is the ink layer thickness value of the i-th image area of ​​the packaging box to be tested. The ink layer thickness value of the specified pattern area can be extracted by scanning the printed product to be tested using an optical coherence tomography scanner and analyzing the scan data using OCT software.

[0090] According to the standard pixel value Calculate the pixel deviation value with the standard pixel value v to be tested , the specific formula is as follows:

[0091] in, is the tth standard pixel value representing the i-th pattern area on the packaging box template, Represents the t-th pixel value of the i-th pattern area on the tested packaging box template, t represents the number of pixels, and its value is [1,q], where q represents the total number of standard pixels.

[0092] It should be noted that Get the difference between the pixel value to be tested and the pixel value, then sum all these differences to get the total difference of all pixel values ​​in all pattern areas; the product of n×g represents the total number of pixels; divide the total difference in the numerator by the total number of pixels in the denominator to get the average pixel value deviation , this value reflects the average deviation in pixel value between the tested packaging box template and the standard packaging box template.

[0093] Through precise mathematical calculations, this formula comprehensively considers the differences between the standard and measured pixel values ​​in each pattern area and numerous pixel points. It can effectively quantify the deviation of printed products from the standard template at the pixel level and accurately detect defects such as missing pixels and errors. In the field of pharmaceutical packaging printing inspection, it helps to strictly control printing quality, ensure the clarity and accuracy of packaging images, improve the standardization and professionalism of product packaging, and enhance consumers' trust in the products.

[0094] Step 208: According to the standard ink layer thickness value and the ink layer thickness to be measured , calculate the ink layer thickness deviation value , based on the following formula:

[0095] in, is the thickness value of the i-th pattern area on the packaging box template, is the thickness value of the i-th pattern area.

[0096] It should be noted that the ink layer thickness deviation value It reflects the average deviation in ink layer thickness between the tested packaging box template and the standard packaging box template.

[0097] This formula calculates the ink layer thickness deviation value, which can accurately quantify the difference between the measured and standard ink layer thicknesses. It can effectively detect whether the printed ink layer thickness meets the standard, avoiding problems such as color deviation, blurred patterns, and abnormal ink drying time caused by excessively thick or thin ink layers. It effectively guarantees the printing quality of pharmaceutical packaging and ensures that the visual effect of product packaging is stable and meets specifications.

[0098] Step 209: The specific steps of calculating the color index RCI to be measured are: According to the deviation color coefficient , pattern pixel deviation coefficient Ink layer thickness deviation , calculate the color index RCI to be measured, based on the following formula:

[0099] in, Represents the deviation color coefficient The weight coefficient is 0.1≤ ≤0.4, Represents the pattern pixel deviation coefficient The weight coefficient is 0.2≤ ≤0.5, Represents the ink layer thickness deviation value The weight coefficient is 0.3≤ ≤0.4, and .

[0100] It should be noted that this formula is based on the deviation color coefficient , pattern pixel deviation coefficient And ink layer thickness deviation value A weighted summation is performed to calculate the color index to be tested, ensuring that the sum of the weight coefficients is 1, so that the influence of each deviation coefficient can be reasonably distributed. In this way, the color deviation, pixel deviation and ink layer thickness deviation of the color to be tested can be comprehensively evaluated to obtain a comprehensive color index.

[0101] This formula derives the RCI of the color to be tested through weighted summation, comprehensively considering color, pixel, and ink layer thickness deviations to fully and accurately reflect the color condition of pharmaceutical packaging printing. It can effectively detect various printing defects, assist in determining whether the printing quality is qualified, help companies efficiently screen defective products, ensure product packaging color consistency, and enhance the brand's visual image.

[0102] Step 3: Set the text deviation index threshold JV, position coordinate index threshold GV, and color index threshold FV.

[0103] The text deviation index threshold JV can be obtained by obtaining the printing data of the medicine packaging box that meets the production standards, calculating the text deviation index of each medicine packaging box that meets the standards and the medicine packaging box template, summing up all the calculated values, and further averaging them to serve as the text deviation index threshold JV; the position coordinate index threshold GV can be obtained by obtaining the printing data of the medicine packaging box that meets the production standards, calculating the position coordinate index of each medicine packaging box that meets the standards and the medicine packaging box template, summing up all the calculated values, and further averaging them to serve as the position coordinate index threshold GV; the color index threshold FV can be obtained by obtaining the printing data of the medicine packaging box that meets the production standards, calculating the color index of each medicine packaging box that meets the standards and the medicine packaging box template, summing up all the calculated values, and further averaging them to serve as the color index threshold FV.

[0104] Step 4: Determine whether the text area is qualified based on the comparison result of the text deviation index Ip and the text deviation index threshold JV; determine whether the pattern position is qualified based on the comparison result of the pattern position coordinate index pu and the position coordinate index threshold GV; determine whether the pattern color is qualified based on the comparison result of the color index RCI to be tested and the color index threshold FV; when any one of the comparison results is unqualified, it is determined that there is a printing defect; when all three comparison results are qualified, it is preliminarily determined that there is no printing defect.

[0105] The specific steps to determine eligibility are: The pixel index threshold JV is set based on the average value of the historical pixel index; the position coordinate index threshold GV is set based on the average value of the historical position coordinate index; the color index threshold FV is set based on the average value of the historical color index; and the edge fuzzy index threshold DV is set based on the average value of the historical edge fuzzy index.

[0106] The specific steps to determine eligibility are: When the character deviation index Ip>the character deviation index threshold JV, the character area is determined to be unqualified.

[0107] When the character deviation index Ip≤character deviation index threshold JV, the character area is determined to be qualified.

[0108] When the pattern position coordinate index pu>the position coordinate index threshold GV, it is determined that the pattern position coordinates are unqualified.

[0109] When the pattern position coordinate index pu≤the position coordinate index threshold GV, it is determined that the pattern position coordinates are qualified.

[0110] When the color index RCI to be measured is greater than the color index threshold FV, it is determined that the pattern color is unqualified.

[0111] When the color index to be measured RCI ≤ the color index threshold FV, the pattern color is determined to be qualified.

[0112] It should be noted that by setting different index thresholds and comparing them with the index to be tested, quality problems in pixels, position coordinates, colors and edge blur of printed products can be discovered in a timely and accurate manner. During the production process, once the indicators exceed the threshold range, an early warning will be triggered, allowing operators to quickly take measures to adjust, effectively reducing the production of defective products and ensuring the stability and consistency of printed quality.

[0113] Step 5: If it is initially determined that there is no printing defect, the name and dosage form matching degree is calculated based on the drug information data and regulatory code data. , specification matching Matching degree with approval document number , and further calculate the matching value between drug information and regulatory code ; Set the matching threshold , according to the matching value between drug information and regulatory code Matching threshold The comparison results can be used to further determine whether there are printing errors between the drug information and the regulatory code.

[0114] Step 501: Calculate the matching value between drug information and regulatory code The method is: Drug information data includes name and dosage form strings. 、Specification string 1 and approval number string ;.

[0115] It should be noted that after capturing an image of the drug packaging box to be tested through camera capture, the image must first be pre-processed to grayscale, converting the color image into a grayscale image. This ensures text extraction while improving processing efficiency. Noise reduction pre-processing, such as Gaussian filtering, is then performed. The drug name, dosage form, specification information, and approval number from the noise reduction pre-processed image are then extracted using an OCR algorithm trained on a large number of drug packaging box samples. The identified drug name, dosage form, and approval number are then processed using the string processing function StrClean(s) to remove extra spaces and line breaks, converting the characters to the same format, and generating the name and dosage form strings. and approval number string ; Use the function NumConvert(s) to extract the numerical part of the specification information and convert it into a pure numerical value to form a specification string. , which is convenient for subsequent numerical calculations.

[0116] Regulatory code data includes name and dosage form string 2 、Specification string 2 and approval number string 2 ; It should be noted that a professional barcode / QR code scanning device is used to scan the drug regulatory code at the device's standard scanning speed. The scanning process of the scanning device follows the decoding algorithm D (c), which depends on the device and the regulatory code. From the decoded regulatory code information, the complete drug information corresponding to the regulatory code is obtained based on the decoded unique identification ID. The drug name, dosage form, specification information and approval number are extracted from the complete drug information. The identified drug name, dosage form and approval number are used to generate the name and dosage form string using the string processing function StrClean(s). and approval number string 2 , use the function NumConvert(s) to extract the numerical part of the specification information, convert it into a pure numerical value, and generate the specification string 2 .

[0117] Calculate the name and dosage form matching degree based on drug information data and regulatory code data , specification matching Matching degree with approval document number , the method is as follows: Use Boolean function to calculate the matching degree between name and dosage form , based on the following formula:

[0118] Setting the specification matching threshold ; According to the specification string one 、Specification string 2 and specification matching threshold , calculate the specification matching degree , based on the following formula:

[0119] Use Boolean function to calculate the matching degree of approval document number , based on the following formula:

[0120] According to the matching degree of name and dosage form , specification matching Matching degree with approval document number Calculate the matching value between drug information and regulatory code , based on the following formula:

[0121] in, Representative name and dosage form matching The weight coefficient is 0.1≤ ≤0.4; Representative specification matching The weight coefficient is 0.1≤ ≤0.4, Representative approval number matching degree The weight coefficient is 0.1≤ ≤0.4; It should be noted that 、 and , used to measure the matching degree of name and dosage form respectively , specification matching Matching degree with approval document number Calculate the matching value between drug information and regulatory code The contribution value made can adjust the proportion of each item according to different focuses.

[0122] It should be noted that the specification matching threshold The drug information data and regulatory code data of the previously compliant medicine box printing products can be used to calculate the corresponding specification string. and specification string two By calculating the difference between the two, we can get the specification matching deviation, and calculate the mean of several specification matching deviations as the specification matching threshold. .

[0123] It should be noted that the matching threshold The drug information data and regulatory code data of previously compliant medicine box printing products can be used to calculate the corresponding drug information and regulatory code matching value, and the average of several drug information and regulatory code matching values ​​can be calculated as the matching threshold. .

[0124] When the drug information matches the regulatory code ≥ matching threshold When the drug information and the regulatory code are printed correctly, it is determined that the drug information and the regulatory code are printed correctly; when the drug information and the regulatory code match value <Matching threshold When the drug information and regulatory code are printed incorrectly, an early warning is issued and an error report is sent to the staff.

[0125] The content of the error report is: Statistics on the matching degree of the name and dosage form of the drug packaging box to be tested , specification matching Matching degree with approval document number The value of the name and dosage form matches =1, it is marked as the name and dosage form matching is correct. =0, it is marked as a mismatch between the name and dosage form; when the specification matches =1, it is marked as specification matching correct. =0, it is marked as specification matching error; when the name and dosage form match =1, it is marked as the name and dosage form matching is correct. =0, it is marked as a mismatch between the name and dosage form.

[0126] It should be noted that after the initial judgment that there are no printing defects, the calculation and comparison of the matching degree between the drug information and the regulatory code is carried out, which is equivalent to a secondary verification of the test results. Some minor problems may be missed during the initial judgment process due to various reasons. Through this verification based on data matching, potential printing errors can be discovered, further improving the reliability of the test. Moreover, as a special commodity, the accuracy of drug information is of vital importance. Through this rigorous matching calculation and comparison mechanism, the risk of drugs entering the market due to printing errors can be effectively reduced. For example, if the name of the drug is printed incorrectly, it may lead to patients taking it by mistake; if the specifications are printed incorrectly, it may affect the dosage of the drug and endanger the health of the patient. Therefore, this mechanism provides a strong guarantee for the quality and safety of drugs and enhances the risk prevention and control capabilities of the entire drug production and circulation link.

[0127] The above embodiments can be implemented in whole or in part by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. Those skilled in the art will appreciate that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution.

[0128] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of the solution of this embodiment according to actual needs.

[0129] The above is only a specific implementation method of the present application, but the scope of protection of the present application is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed in this application, which should be covered by the scope of protection of the present application.

Claims

1. A method for detecting pattern printing defects on a drug packaging box, characterized in that: include: Collect the printing data to be tested and the template data of the standard printing packaging box; Collect drug information data and regulatory code data of the drug packaging box to be tested; Calculate the pixel similarity index W1 and format similarity index W2 of the text area according to the template data and the printed data to be tested, and further calculate the text deviation index Ip; calculate the standard position coordinate coefficient Co according to the template data, and further calculate the pattern position coordinate index pu in combination with the printed data to be tested; calculate the deviation color coefficient according to the template data and the printed data to be tested , pixel deviation value And ink layer thickness deviation value ; According to the deviation color coefficient , pixel deviation value And ink layer thickness deviation value Calculate the color index RCI to be tested; wherein the template data includes the standard text area value S1, the standard text pixel height average value H1 and the standard character spacing pixel distance average value J1 of the text area; the printed data to be tested includes the text area value S2 to be tested, the text pixel height value H2 to be tested and the pixel distance value J2 corresponding to the character spacing of the text area; calculate the format similarity index W2 according to the standard text area value S1, the standard text pixel height average value H1, the standard character spacing pixel distance average value J1, the text area value S2 to be tested, the text pixel height value H2 to be tested and the pixel distance value J2 corresponding to the character spacing; Set the text deviation index threshold JV, position coordinate index threshold GV and color index threshold FV; According to the comparison result of the text deviation index Ip and the text deviation index threshold JV, it is judged whether the text area is qualified; according to the comparison result of the pattern position coordinate index pu and the position coordinate index threshold GV, it is judged whether the pattern position is qualified; according to the comparison result of the color index RCI to be tested and the color index threshold FV, it is judged whether the pattern color is qualified; when any of the comparison results is unqualified, it is judged that there is a printing defect, and when all three comparison results are qualified, it is preliminarily judged that there is no printing defect; When it is initially determined that there is no printing defect, the name and dosage form matching degree M are calculated based on the drug information data and regulatory code data. N 、Specification matching degree M S Matching degree with approval number M A , and further calculate the matching value M between drug information and regulatory code total ; Set the matching threshold M t , according to the matching value M between drug information and regulatory code total And the matching threshold M t The comparison results can be used to further determine whether there are printing errors in the drug information and regulatory code.

2. A method for detecting pattern printing defects on a medicine packaging box according to claim 1, characterized in that: The specific steps for calculating the pixel similarity index W1 are: The template data also includes the standard pixel value f(x,y) and the average pixel value of the text area. ; The print data to be tested also includes the pixel value g(x,y) of the text area to be tested and the average pixel value of the text to be tested. ; According to the standard pixel value f(x,y) of the text, the average value of the pixel value of the text , the pixel value g(x,y) of the text to be tested and the average pixel value of the text to be tested , calculate the pixel similarity index W1, the specific formula is as follows: Among them, x represents the horizontal coordinate of the sampling point in the text area, y represents the vertical coordinate of the sampling point in the text area, the value range of the standard pixel value f(x,y) of the text is [0,255], and the value range of the pixel value g(x,y) of the text to be tested is [0,255].

3. A method for detecting pattern printing defects on a medicine packaging box according to claim 2, characterized in that: The specific formula for calculating the format similarity index W2 is as follows: in, represent The weight coefficient is 0.1≤ ≤0.4, represent The weight coefficient is 0.2≤ ≤0.5, represent The weight coefficient is 0.3≤ ≤0.4, and .

4. A method for detecting pattern printing defects on a drug packaging box according to claim 3, characterized in that: The method for calculating the text deviation index Ip is: According to the pixel similarity index W1 and the format similarity index W2, the text deviation index Ip is calculated, and the specific formula is as follows: Wherein, b1 represents the weight coefficient of the pixel similarity index W1, and its value is 0.4≤b1≤0.6; b2 represents the weight coefficient of the format similarity index W2, and its value is 0.5≤b2≤0.6, and b1+b2=1.

5. A method for detecting pattern printing defects on a medicine packaging box according to claim 4, characterized in that: The specific steps for calculating the standard position coordinate coefficient Co are: The template data also includes the standard boundary coordinates of different pattern areas ; Set the base coordinate point (x0, y0); According to the standard boundary coordinates And the reference coordinate point (x0, y0), calculate the standard position coordinate coefficient Co, the specific formula based on which is as follows: in, Represents the jth boundary horizontal coordinate of the i-th pattern area on the packaging box template, Represents the jth boundary ordinate of the i-th pattern area on the packaging box template; i is the serial number of the pattern area on the packaging box template, and its value is [1,n]; j is the serial number of the boundary coordinate, and its value is [1,m]; m represents the total number of boundary coordinates.

6. A method for detecting pattern printing defects on a medicine packaging box according to claim 5, characterized in that: The specific steps for calculating the pattern position coordinate index pu are: The printed data to be tested also includes the standard boundary coordinates to be tested , the reference coordinate point (x0, y0) and the standard position coordinate coefficient Co, calculate the pattern position coordinate index pu, the specific formula based on which is as follows: in, represents the jth boundary horizontal coordinate of the i-th pattern area, Represents the jth boundary ordinate of the i-th pattern area.

7. A method for detecting pattern printing defects on a medicine packaging box according to claim 6, characterized in that: Calculate the deviation color coefficient The method is: The template data also includes standard hue values , standard brightness value And standard color ; The printing data to be tested also includes the tone value of the printed product to be tested , lightness value And the chromaticity value ; According to the standard hue value , standard brightness value , Standard Chroma , Hue value , lightness value and chromaticity value , calculate the deviation color coefficient , the specific formula is as follows: in, is the hue value of the i-th pattern area of ​​the packaging box template, is the brightness value of the i-th pattern area of ​​the packaging box template, Represents the standard chromaticity of the i-th pattern area of ​​the packaging box template, Represents the hue value of the i-th pattern area of ​​the printed product to be detected, Represents the brightness value of the i-th pattern area of ​​the printed product to be tested, Represents the standard chromaticity of the i-th pattern area of ​​the printed product to be tested.

8. A method for detecting pattern printing defects on a medicine packaging box according to claim 7, characterized in that: Calculate pixel deviation value And ink layer thickness deviation value The method is: The template data also includes the standard pixel values ​​of different pattern areas And standard ink layer thickness value ; The printing data to be tested also includes the standard pixel values ​​to be tested in different pattern areas And the ink thickness value to be measured ; According to the standard pixel value and the standard pixel value to be tested Calculate pixel deviation value The specific formula is as follows: in, is the t-th pixel value representing the i-th pattern area on the packaging box template, represents the t-th pixel value of the i-th pattern area on the tested packaging box template, t represents the number of pixel values, and the value is [1,q], q represents the total number of pixel values; According to the standard ink layer thickness value And the ink thickness value to be measured Calculate ink layer thickness deviation , the formula is as follows: in, is the ink layer thickness value of the i-th pattern area on the packaging box template, It is the ink layer thickness value of the i-th pattern area on the packaging box to be tested.

9. A method for detecting pattern printing defects on a medicine packaging box according to claim 8, characterized in that: The specific steps for calculating the color index RCI to be tested are: According to the deviation color coefficient , pattern pixel deviation coefficient And the ink layer thickness deviation value , calculate the color index RCI to be tested, the formula is as follows: in, Represents the deviation color coefficient The weight coefficient is 0.1≤ ≤0.4, Represents the pattern pixel deviation coefficient The weight coefficient is 0.2≤ ≤0.5, Represents the ink layer thickness deviation value The weight coefficient is 0.3≤ ≤0.4, and .

10. A method for detecting pattern printing defects on a medicine packaging box according to claim 9, characterized in that: The specific steps to determine whether you are qualified are: When the text deviation index Ip>the text deviation index threshold JV, the text area is judged as unqualified; When the text deviation index Ip≤text deviation index threshold JV, the text area is determined to be qualified; When the pattern position coordinate index pu> the position coordinate index threshold GV, it is determined that the pattern position coordinate is unqualified; When the pattern position coordinate index pu≤position coordinate index threshold GV, the pattern position coordinate is determined to be qualified; When the color index RCI to be tested is greater than the color index threshold FV, the pattern color is judged to be unqualified; When the color index RCI to be tested is less than the color index threshold FV, the pattern color is judged to be qualified; The method for determining whether there are printing errors in drug information and regulatory codes is: Drug information data includes name and dosage form string 、Specification string 1 and approval number string ; Regulatory code data includes name and dosage form string 2 、Specification string 2 and approval number string 2 ; Calculate the name and dosage form matching degree based on drug information data and regulatory code data , Specification Matching Matching degree with approval number , the method is as follows: Using Boolean functions to calculate the matching degree between name and dosage form , the formula is as follows: Setting specification matching threshold ; According to the specification string one 、Specification string 2 and specification matching threshold , calculate the specification matching degree , the formula is as follows: Using Boolean function to calculate the matching degree of approval document number , the formula is as follows: According to the matching degree of name and dosage form , Specification Matching Matching degree with approval number Calculate the matching value between drug information and regulatory code , the formula is as follows: in, Representative name and dosage form matching The weight coefficient is 0.1≤ ≤0.4; Representative specification matching The weight coefficient is 0.1≤ ≤0.4, Representative approval number matching degree The weight coefficient is 0.1≤ ≤0.4; When the drug information matches the regulatory code ≥ Matching threshold When the drug information and the regulatory code are printed correctly, it is determined that the drug information and the regulatory code are printed correctly; when the drug information and the regulatory code match value <Matching threshold When the drug information and regulatory code are printed incorrectly, it is determined that the drug information and regulatory code are printed incorrectly.

Citation Information

Patent Citations

  • Printed matter detecting method, device and equipment, and storage medium

    CN108469438A

  • Medicine graphic and text information violation detection method and system

    CN111814793A

  • Flexible package printing quality defect detection method

    CN115078365A

  • Character typesetting image recognition system for publishing and printing equipment

    CN116704523A

  • Image-text printing quality analysis system based on machine vision

    CN118072319A

Cited By

  • Pesticide packing material identification method and system and intelligent terminal

    CN119992570A

  • Online monitoring and early warning method for printed matter printing content

    CN122090461A