A calibration system and method for automatically detecting the printing quality of a drug box package
The calibration system for automatically detecting the printing quality of medicine box packaging has solved the problems of low efficiency and insufficient accuracy in medicine box packaging printing inspection, achieving efficient and accurate quality inspection of medicine box packaging printing and ensuring that the size and weight of the printed products meet the standards.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- YUNNAN BAIYAO GRP CO LTD
- Filing Date
- 2026-05-13
- Publication Date
- 2026-08-04
AI Technical Summary
Existing technologies for inspecting medicine box packaging printing suffer from low inspection efficiency and insufficient accuracy, especially visual inspection methods which require extensive manual secondary confirmation.
An automatic calibration system for detecting the printing quality of medicine box packaging was designed, including modules for project management, user management, motion control, image scanning, communication management, detection tools, parameter setting, data processing, and log recording. The system uses a computer system to automatically locate the product, detect its printing quality, dimensions, and weight, thereby improving the accuracy of the detection.
It achieves efficient and automated detection of the printing quality of medicine box packaging, with an accuracy of 0.01mm2 and a defect area recognition rate of 100%, avoiding manual secondary verification, ensuring that the printed product size completely matches the design draft, and accurately detecting the weight to guarantee consistent product quality.
Smart Images

Figure CN122509767A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of medicine box quality (printing, size, material) inspection technology, specifically relating to a calibration system and method for automatically inspecting the printing quality of medicine box packaging. Background Technology
[0002] The regulations governing drug packaging, labeling, and instructions are a crucial component of drug administration and are of great significance in ensuring the safety and effectiveness of medication for the public. According to relevant regulations, drug packaging, labeling, and instructions must meet a series of stringent requirements to ensure the rational use and safety of medications. Typically, drug packaging boxes must include the following information as required by national regulations: 1) the generic name, specifications, batch number, and expiration date of the drug; 2) the name, address, and contact information of the manufacturer. 3) Drug approval number; 4) Storage conditions; 5) Dosage and administration, adverse reactions, contraindications, and precautions; 6) If the drug is manufactured by an authorized manufacturer, the name of the authorized manufacturer should be indicated.
[0003] Because the printed information on medicine packaging boxes is extremely important, and a large amount of this crucial information cannot tolerate any printing or layout errors, ensuring proper printing inspection of medicine boxes is a critical step. Currently, visual inspection methods on the market can only achieve initial screening for defects due to algorithm limitations. Many defects identified in this initial screening still require secondary manual verification, resulting in low accuracy and efficiency. Therefore, designing a highly efficient and stable automatic calibration and inspection system is particularly necessary. Summary of the Invention
[0004] The purpose of this invention is to provide a calibration system and method for automatically detecting the printing quality of medicine box packaging, which is used to detect the layout of medicine boxes, ensuring detection efficiency while improving detection accuracy.
[0005] To achieve the above objectives, the present invention provides the following technical solution: a calibration system for automatically detecting the printing quality of medicine box packaging, executed by a computer system; comprising: The project management module is used to input predefined product information and create product testing items so that the corresponding measurement item files can be loaded according to the work order. The user management module allows users to operate the system based on their permissions. The motion control module is used to control the movement of the machine tool; The image scanning module is used to acquire images of the product; The communication management module is used to configure the internal communication port parameters of the system and connect the image scanning module and the MES system. The inspection tool module first achieves automatic product positioning and accurate identification of its direction and angle based on the characteristics of the predetermined product template, and then inspects the printing quality, dimensions and weight of each area of the product. The parameter setting module is used to set the configuration parameters of each module to achieve personalized testing for different products; The data processing module is used to transmit test data to the MES system and create comprehensive inspection reports, making it convenient for users to track and manage quality status; in this way, testing efficiency is ensured while improving testing accuracy. The logging module records various operations and execution results to track system usage, identify anomalies, and quickly resolve problems. The product positioning module can automatically locate the product and accurately identify its direction and angle based on the characteristics of a predetermined product template.
[0006] The present invention also provides a method for using the above-described calibration system for automatically detecting the printing quality of medicine box packaging, the steps of which are as follows: S1: Create a new project through the project management module; S2: Input product information in the project management module through the parameter setting module; S3: Configure communication parameters through the parameter setting module; S4: Connect external devices to the MES system through the communication management module; S5: Scan standard images through the motion control module and image scanning module; S6: Calibrate the pixel scale in the inspection tool module through the parameter setting module; S7: Select features on the product through the inspection tool module, extract its outline and centroid, establish a coordinate system, and use it as a reference to determine the position of the workpiece; S8: Add and edit inspection items, including at least defect inspection, dimensional inspection, and weight inspection. S9: Set the data to be output to the MES system, including at least the external dimensions, weight, and judgment results; S10: The project management module saves the measurement items; S11: The inspection tool module performs verification tests on the product images based on the inspection items added in step S8; S12: View the results from the data processing module; S13: Weight detection: Obtain the product's external outline through the inspection tool module, calculate the product's area, weigh the product using an electronic balance, and finally calculate the weight per unit area of the product; S14: Send the data to the MES system according to the output data content set in step S9.
[0007] Furthermore, in the creation of a new project in step S1, if a work order is received and a corresponding test project file is found, the project file is loaded and introduced into S11 for verification testing.
[0008] Furthermore, in the result review in step S12, based on the NG result (the layout comparison result fails), manual intervention is performed to check and modify the parameters of the test items and eliminate anomalies.
[0009] Furthermore, the steps for setting up the project management module are as follows: S101: Create a brand new project using the "New" button on the main interface; S102: Fill in the product's material name, material code, version number, and batch number in the input box at the top of the main interface; S103: Import sample images and images to be tested using the local image or device scan import function.
[0010] Furthermore, the steps for setting up the communication management module are as follows: S201: Establish communication connection with motion control platform; S202: Establish communication connection with measuring balance; S203: Establish communication connection with light source; S204: Establish communication connection with MES system.
[0011] Furthermore, the image scanning module setup steps are as follows: S301: Open the light source communication port, set appropriate light source parameters, and configure the light source to strobe trigger mode; S302: Set the starting position and moving speed of the motion control platform; S303: Set the image acquisition parameters of the scanning camera.
[0012] Furthermore, the detection tool module includes: a shape matching module, a defect detection module, an image comparison module, a barcode recognition module, a character recognition module, a color recognition module, a color comparison module, and a measurement tool module; wherein: The shape matching module is used to automatically position the product and establish a measurement benchmark; the defect detection module is used to detect the integrity of the printed surface image of the product; the image comparison module is used to analyze the difference between the printed surface image of the product and the sample; the barcode recognition module is used to detect and verify the recognition of the printed barcode of the product; the character recognition module is used to detect the printing quality of the characters of the product; the color recognition module is used to detect the printing color reproduction of the product; the color comparison module is used to detect the difference between the printing color of the product and the sample; the measurement tool module includes caliper measuring tools, straight line measuring tools, two-line center line measuring tools, two-line distance measuring tools, and weight detection tools.
[0013] Furthermore, the specific implementation steps of the product positioning module are as follows: Step 1: Image preprocessing, convert both template and target images to grayscale, and apply Gaussian blur for noise reduction; Step 2: Feature extraction, using the ORB algorithm to extract feature points and descriptors from the template and target images; Step 3: Feature matching, initial feature matching, RANSAC algorithm to remove false matches; Step 4: Attitude calculation. Solve the homography matrix by matching pairs, calculate the coordinates of the template center in the target image, and extract the rotation angle from the matrix. Step 5: Result verification, check the matching validity, and optimize the center coordinates / normalized rotation angle.
[0014] Furthermore, the data processing module includes a data transmission module and a report generation module; the testing tool module also includes a parameter calibration module, which is used to calibrate the product information for newly created testing items; both the defect detection module and the character recognition module are equipped with learning calibration modules; the learning calibration module is used to recalibrate the appearance and character printing defects of the product.
[0015] The beneficial effects of this invention are as follows: 1. The product positioning module can automatically locate the product and accurately identify its direction and angle based on the characteristics of the predetermined product template.
[0016] 2. Defect Detection Module: This module can accurately identify defects on the packaging material surface in one go, with an accuracy of 0.01mm2 defect area. It can achieve 100% accuracy in one-time identification, accurately control the location of defects on the surface, and effectively avoid manual secondary verification.
[0017] 3. Size Inspection: It can not only proofread the layout content, but also simultaneously inspect the size and material. The size measurement accuracy is up to 0.001mm. It can identify paper box size defects and accurately measure the length, width and height of the product to ensure that the size of the printed product is completely consistent with the design and avoid printing errors caused by size deviation.
[0018] 4. Weight Detection: Through high-precision sensors and advanced algorithms, the weight of printed materials is accurately measured to ensure compliance with standards; it can quickly analyze weight distribution, identify deviations, and ensure consistent and reliable product quality. Attached Figure Description
[0019] Figure 1 This is a flowchart of the present invention; Figure 2 This is a diagram of the architecture of the present invention; Figure 3 This is a schematic diagram illustrating the creation of a project file in one embodiment of the present invention; Figure 4 This is a schematic diagram illustrating the input of product information in one embodiment of the present invention; Figure 5 This is a schematic diagram illustrating the configuration of communication parameters in one embodiment of the present invention; Figure 6 This is a schematic diagram illustrating the connection of the communication management module in one embodiment of the present invention; Figure 7This is a schematic diagram of a scanned standard image in one embodiment of the present invention; Figure 8 This is a schematic diagram illustrating the calibration of a pixel scale bar in one embodiment of the present invention; Figure 9 This is a schematic diagram illustrating the establishment of a coordinate system in one embodiment of the present invention; Figures 10-14 This is a schematic diagram illustrating the addition and editing of detection items in one embodiment of the present invention; Figure 15 This is a schematic diagram illustrating the setting of data output to the MES system in one embodiment of the present invention; Figure 16 This is a schematic diagram illustrating the storage of measurement items in one embodiment of the present invention; Figure 17 This is a schematic diagram illustrating the verification test of a product image in one embodiment of the present invention; Figure 18 This is a schematic diagram illustrating the viewing of results from the data processing module in one embodiment of the present invention; Figure 19 This is a schematic diagram of weight detection in one embodiment of the present invention; Figure 20 and Figure 21 This is a schematic diagram illustrating data transmission to the MES system in one embodiment of the present invention; Figure 22 A diagram illustrating the selection of measurement item files for routine inspections; Figure 23 A schematic diagram for importing the sample to be tested; Figure 24 This is a schematic diagram comparing the image to be tested with the standard image; Figure 25 and Figure 26 This is a schematic diagram for size and material inspection. Detailed Implementation
[0020] Embodiments of the present invention will now be described with reference to the accompanying drawings. Those skilled in the art will understand that the following embodiments are for illustrative purposes only and should not be construed as limiting the scope of the invention. Where specific techniques, connections, or conditions are not specified in the embodiments, they are performed in accordance with the techniques, connections, or conditions described in the literature in the art or according to product instructions. Materials, instruments, or equipment used, unless otherwise specified, are all conventional products that can be purchased.
[0021] A calibration system for automatically detecting the printing quality of medicine box packaging, executed by a computer system, includes: The project management module is used to input predefined product information and create product testing items, so that corresponding measurement item files can be loaded according to work orders. Measurement item files are imported via the motion control module and image scanning module to create defect detection modules for the standard samples. The setup steps for the project management module are as follows: S101: Create a brand new project using the "New" button on the main interface; S102: Fill in the product's material name, material code, version number, and batch number in the input box at the top of the main interface; S103: Import sample images and images to be tested using local images or device scanning. The user management module allows users to operate the system based on their permissions. The motion control module is used to control the movement of the machine tool; The image scanning module is used to acquire images of the product. The setup steps are as follows: S301: Open the light source communication port, set the light source parameters, and configure the light source to strobe trigger mode; S302: Set the starting position and moving speed of the motion control platform; S303: Set the image acquisition parameters of the scanning camera; The communication management module is used to configure the internal communication port parameters of the system and connect the image scanning module and the MES system. The steps for setting up the communication management module are as follows: S201: Establish communication connection with the motion control platform; S202: Establish communication connection with the measuring balance; S203: Establish communication connection with the light source; S204: Establish communication connection with the MES system; The inspection tool module first automatically positions the product and accurately identifies its orientation and angle based on the characteristics of the predetermined product template, then inspects the printing quality, dimensions, and weight of various areas of the product. The parameter setting module is used to configure the parameters of each module, enabling personalized inspection for different products. The data processing module transmits inspection data to the MES system and creates comprehensive inspection reports, facilitating user tracking and management of quality status. The data processing module includes a data transmission module and a report generation module. The log recording module records various operations and execution results to track system usage, identify anomalies, and quickly resolve problems. The product positioning module automatically positions the product and accurately identifies its orientation and angle based on the characteristics of the predetermined product template. The specific implementation steps of the product positioning module are as follows: Step 1: Image preprocessing, convert both template image and target image to grayscale, and perform Gaussian blur noise reduction (unify basic features and reduce noise interference); Step 2: Feature extraction. Use the ORB algorithm to extract feature points and descriptors from the template and target image (to obtain the core features that can be matched). Step 3: Feature matching, initial feature matching (brute force / FLANN), RANSAC algorithm to remove mismatches (retain high-quality matching pairs); Step 4: Attitude calculation. Solve the homography matrix by matching pairs, calculate the coordinates of the template center in the target image, and extract the rotation angle from the matrix. Step 5: Result verification, check the matching validity (interior point ratio), optimize center coordinates / normalized rotation angle (to improve accuracy).
[0022] like Figure 1 and Figure 2 As shown, the method for using the above-mentioned calibration system for automatically detecting the printing quality of medicine box packaging disclosed in this invention comprises the following steps: S1: Create a new project through the project management module; S2: Input product information in the project management module through the parameter setting module; S3: Configure communication parameters through the parameter setting module; S4: Connect external devices to the MES system through the communication management module; S5: Scan standard images through the motion control module and image scanning module; S6: Calibrate the pixel scale in the inspection tool module through the parameter setting module; S7: Select features on the product through the inspection tool module, extract its outline and centroid, establish a coordinate system, and use it as a reference to determine the position of the workpiece; S8: Add and edit inspection items, including at least defect inspection, dimensional inspection, and weight inspection. S9: Set the data to be output to the MES system, including at least the external dimensions, weight, and judgment results; S10: The project management module saves the measurement items; S11: The inspection tool module performs verification tests on the product images based on the inspection items added in step S8; S12: View the results from the data processing module; S13: Weight detection: Obtain the product's external outline through the inspection tool module, calculate the product's area, weigh the product using an electronic balance, and finally calculate the weight per unit area of the product; S14: Send the data to the MES system according to the output data content set in step S9.
[0023] Furthermore, in the creation of a new project in step S1, if a work order is received and a corresponding test project file is found, the project file is loaded and introduced into S11 for verification testing.
[0024] Furthermore, in the result review in step S12, based on the NG result (the layout comparison result fails), manual intervention is performed to check and modify the parameters of the test items and eliminate anomalies.
[0025] Specifically, the inspection tool module includes: a shape matching module, a defect detection module, an image comparison module, a barcode recognition module, a character recognition module, a color recognition module, a color comparison module, and a measurement tool module. The shape matching module is used to automatically position the product and establish a measurement benchmark. The defect detection module is used to check the integrity of the printed surface image of the product. The image comparison module is used to analyze the differences between the printed surface image of the product and the sample. The barcode recognition module is used to check the recognition and verification of the printed barcode of the product. The character recognition module is used to check the printing quality of the characters on the product. The color recognition module is used to check the color reproduction of the printed product. The color comparison module is used to check the differences between the printed color of the product and the sample. The measurement tool module includes calipers, straight-line measuring tools, two-line centerline measuring tools, two-line distance measuring tools, and weight detection tools. The inspection tool module also includes a parameter calibration module, which is used to calibrate the product information for newly created inspection items. Both the defect detection module and the character recognition module have learning calibration modules; these learning calibration modules are used to recalibrate the appearance and character printing defects of the product. Example
[0026] Taking the inspection of a cardboard box as an example, the specific steps are as follows: S1: This refers to the proofreading device used in this invention. It is a commercially available product and belongs to the image scanning module. The proofreading device acquires images of the product, creates a new project through the project management module, and establishes a project file based on the material code and version number. The proofreading device verifies and tests the acquired image information against the pre-established template information. Figure 3 As shown; S2: Enter the product material code in the parameter setting module and project management module, click "Start Inspection," and you can call the pre-created standard sample template, and at the same time generate the inspection record template and inspection report template, such as... Figure 4 As shown; S3: Configure communication parameters through the parameter setting module to transmit detection data to the detection record, such as... Figure 5 As shown; S4: The communication management module connects external devices to the MES system to transmit detection data to the detection records, such as... Figure 6 As shown; S5: Scans standard sample images via the motion control module and image scanning module for calibration testing, such as... Figure 7 As shown; S6: The parameter setting module and defect detection module calibrate the pixel scale and, in conjunction with sample attributes, set appropriate defect detection parameters to perform defect detection on images of different sizes and colors, such as... Figure 8 As shown; S7: The defect detection module selects features on the product, extracts its outline and centroid, establishes a coordinate system, and uses this as a reference to determine the workpiece's position. Figure 9 As shown; S8: Add and edit inspection items, including at least defect inspection, dimensional inspection, weight inspection, data upload, and report generation, such as... Figures 10-14 As shown; S9: Set the data to be output to the MES system, including at least the external dimensions, weight, and judgment result, such as... Figure 15 As shown; S10: The project management module uploads the measurement data to the inspection record, such as... Figure 16 As shown; S11: The defect detection module adds inspection items according to step S8, measures and verifies the product image, and displays the inspection results, such as... Figure 17 As shown; S12: View the results from the data processing module and implement the signature verification report function, such as... Figure 18 As shown; S13: Weight detection. The defect detection module acquires the product's external outline, calculates the product's area, then uses an electronic balance to weigh the product, finally calculating the weight per unit area. Figure 19 As shown; S14: Based on the output data content set in step S9, send the data to the MES system, such as... Figure 20 and Figure 21 As shown.
[0027] The daily operation of this invention is as follows: 1. Routine Inspection: Select the work order requiring inspection based on the product's "material code + product batch" and load the corresponding measurement item file, such as... Figure 22 As shown; 2. The sample to be tested is imported through the motion control module and image scanning module, such as... Figure 23 As shown; 3. The defect detection module enables comparison between the image to be tested and the standard image, such as... Figure 24 As shown; 4. Conduct size and material inspections, such as... Figure 25 and Figure 26 As shown.
[0028] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any minor modifications, equivalent substitutions, and improvements made to the above embodiments based on the technical essence of the present invention should be included within the protection scope of the present invention.
Claims
1. A calibration system for automatically detecting the printing quality of medicine box packaging, executed by a computer system; characterized in that, include: The project management module is used to input predefined product information and create product testing items so that the corresponding measurement item files can be loaded according to the work order. The user management module allows users to operate the system based on their permissions. The motion control module is used to control the movement of the machine tool; The image scanning module is used to acquire images of the product; The communication management module is used to configure the internal communication port parameters of the system and connect the image scanning module and the MES system. The inspection tool module first achieves automatic product positioning and accurate identification of its direction and angle based on the characteristics of the predetermined product template, and then inspects the printing quality, dimensions and weight of each area of the product. The parameter setting module is used to set the configuration parameters of each module to achieve personalized testing for different products; The data processing module is used to transmit test data to the MES system and create comprehensive inspection reports, making it convenient for users to track and manage quality status. The logging module records various operations and execution results to track system usage, identify anomalies, and quickly resolve problems. The product positioning module can automatically locate the product and accurately identify its direction and angle based on the characteristics of a predetermined product template.
2. A method using the calibration system for automatically detecting the printing quality of medicine box packaging as described in claim 1, characterized in that, The steps are as follows: S1: Create a new project through the project management module; S2: Enter product information in the project management module through the parameter setting module; S3: Configure communication parameters through the parameter setting module; S4: The communication management module connects external devices to the MES system; S5: Scans the standard sample image using the motion control module and image scanning module; S6: Calibrate the pixel scale in the detection tool module through the parameter setting module; S7: Select features on the product through the inspection tool module, extract its outline and centroid, establish a coordinate system, and use it as a reference to determine the position of the workpiece; S8: Add and edit inspection items, including at least defect inspection, dimensional inspection, weight inspection, data upload, and report generation; S9: Set the data to be output to the MES system, including at least the external dimensions, weight, and judgment results; S10: The project management module saves measurement projects; S11: The inspection tool module adds inspection items according to step S8 and performs verification tests on the product images; S12: View the results from the data processing module; S13: Gram weight detection. The product's external outline is obtained through the detection tool module, the product's area is calculated, the product's weight is measured using an electronic balance, and finally the weight per unit area of the product is calculated. S14: Send the data to the MES system according to the output data content set in step S9.
3. The method according to claim 2, characterized in that, In step S1, if a work order is received and a corresponding test project file is found, the project file is loaded and introduced into S11 for verification testing.
4. The method according to claim 2, characterized in that, In step S12, based on the NG result of the verification, manual intervention is performed to check and modify the parameters of the test items and eliminate anomalies.
5. The calibration system according to claim 1, characterized in that, The steps to set up the project management module are as follows: S101: Create a brand new project using the "New" button on the main interface; S102: Enter the product's material name, material code, version number, and batch number in the input box at the top of the main interface; S103: Import sample images and images to be tested using local images or device scanning.
6. The calibration system according to claim 1, characterized in that, The steps to set up the communication management module are as follows: S201: Establish communication connection with the motion control platform; S202: Establish a communication connection with the measuring balance; S203: Establish a communication connection with the light source; S204: Establish a communication connection with the MES system.
7. The calibration system according to claim 1, characterized in that, The steps for setting up the image scanning module are as follows: S301: Open the light source communication port, set the light source parameters, and configure the light source to strobe trigger mode; S302: Set the starting position and speed of the motion control platform; S303: Set the image acquisition parameters for the scanning camera.
8. The calibration system according to claim 1, characterized in that, The inspection tool module includes: a shape matching module, a defect detection module, an image comparison module, a barcode recognition module, a character recognition module, a color recognition module, a color comparison module, and a measurement tool module; among which: The shape matching module is used to automatically position the product and establish a measurement reference. The defect detection module is used to check the integrity of the printed surface image of the product; The image comparison module is used to analyze the differences between the printed surface image of the product and the sample. The barcode recognition module is used to detect and verify the printed barcodes on products; The character recognition module is used to detect the printing quality of characters on a product. The color recognition module is used to detect the printing color reproduction of the product; The color comparison module is used to detect the difference between the printed color of the product and the sample. The measurement tool module includes caliper measuring tools, straight line measuring tools, two-line centerline measuring tools, two-line distance measuring tools, and weight detection tools.
9. The calibration system according to claim 1, characterized in that, The specific implementation steps of the product positioning module are as follows: Step 1: Image preprocessing, convert both template and target images to grayscale, and apply Gaussian blur for noise reduction; Step 2: Feature extraction, using the ORB algorithm to extract feature points and descriptors from the template and target images; Step 3: Feature matching, initial feature matching, RANSAC algorithm to remove false matches; Step 4: Attitude calculation. Solve the homography matrix by matching pairs, calculate the coordinates of the template center in the target image, and extract the rotation angle from the matrix. Step 5: Result verification, check the matching validity, and optimize the center coordinates / normalized rotation angle.
10. The calibration system according to claim 8, characterized in that, The data processing module includes a data transmission module and a report generation module; the testing tool module also includes a parameter calibration module, which is used to calibrate product information for newly created testing items; both the defect detection module and the character recognition module have learning calibration modules; the learning calibration module is used to recalibrate the appearance and character printing defects of the product.