A modular machine vision recognition tablet quality inspection system and method

Through a modular machine vision recognition system, the implicit features of tablet surface defects are extracted and the types and locations of defects are analyzed, and the problem of inaccurate tablet quality detection in the prior art is solved, achieving higher detection accuracy and efficiency.

CN119360146BActive Publication Date: 2025-06-03JIANGXI UNIVERSITY OF TRADITIONAL CHINESE MEDICINE +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411931930.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-06-03
Estimated Expiration
2044-12-26

AI Technical Summary

Technical Problem

In the quality inspection of tablet molding, the prior art ignores the difference in the impact of defect types on quality, and cannot accurately analyze the types and location of defects, resulting in inaccurate tablet quality detection.

Method used

A modular machine vision recognition tablet quality detection system is designed to obtain tablet surface image data, extract defect characteristics, analyze defect types, and perform tablet quality analysis based on the identified defect types and locations.

Benefits of technology

It improves the accuracy and detection efficiency of tablet quality detection, and can accurately analyze according to the implicit characteristics of defects to ensure accurate evaluation of tablet quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119360146B_ABST
    Figure CN119360146B_ABST
Patent Text Reader

Abstract

The present application discloses a modular machine vision recognition tablet quality detection system and method, belonging to the field of machine vision. The present application analyzes the types of defects based on the extracted defect features, and obtains the corresponding types of tablet defects. It analyzes the production quality of tablets according to the recognized defect types and the position data of the corresponding defects, accurately analyzes the tablet images, extracts the implicit features reflecting tablet defects, accurately analyzes the defect types based on the implicit features of the defects, and then accurately analyzes the tablet quality according to the classified defect types and positions, improving the accuracy and detection efficiency of tablet quality detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of scene recognition, and specifically relates to a modular machine vision recognition tablet quality inspection system and method. Background Art

[0002] The quality of tablet production is related to the safety and effectiveness of tablets. Therefore, it is crucial to ensure quality control during the tablet production process. To ensure the quality of tablet production, multiple aspects such as raw and auxiliary materials, production processes, and equipment need to be comprehensively considered, and strict quality inspection and control measures need to be taken. After tablet production, it is necessary to conduct quality inspection on the forming situation of the tablets. At this time, a modular machine vision recognition tablet quality inspection system is required;

[0003] When the prior art conducts quality inspection on the forming situation of tablets, it usually simply compares images, then analyzes pixel points to find the size of the defects, and then conducts quality scoring based on the size and difference of the defects. This causes the prior art to ignore the difference in the impact of defect types on quality, unable to accurately analyze defect types based on the implicit features of the defects, and further unable to accurately analyze the tablet quality based on the classified defect types and positions. Most of the prior art has the above problems;

[0004] To solve the problems raised in this background art, this application designs a modular machine vision recognition tablet quality inspection system and method. Summary of the Invention

[0005] Aiming at the deficiencies of the prior art, this application proposes a modular machine vision recognition tablet quality inspection system and method. This application accurately analyzes the tablet images, extracts the implicit features reflecting tablet defects, accurately analyzes defect types based on the implicit features of the defects, and then accurately analyzes the tablet quality based on the classified defect types and positions, improving the accuracy and inspection efficiency of tablet quality inspection.

[0006] To achieve the above object, this application provides the following technical solutions: In the first aspect, this application provides a modular machine vision recognition tablet quality inspection method, which includes the following specific steps:

[0007] S1. Obtain the surface image data of the produced tablets, and obtain the surface defect data and defect position data from the surface image data of the tablets;

[0008] S2. Import the surface defect data of the tablets into the defect feature extraction strategy for defect feature extraction;

[0009] S3. Analyze the defect types based on the extracted defect features, and obtain the corresponding defect types of the tablets;

[0010] S4. Analyze the production quality of tablets based on the identified defect types and the location data of the corresponding defects, and remove unqualified tablets.

[0011] As a preferred technical solution of a modular machine vision-based tablet quality inspection method, the specific content of obtaining the surface image data of the produced tablets and obtaining the surface defect data and the location data of the defects from the surface image data of the tablets is as follows:

[0012] S11. Lay the produced tablets flat on the acquisition end of the vision machine, and obtain the surface image data of the produced tablets after removing the background from the acquired images.

[0013] Among them, the specific steps of obtaining the surface image data of the produced tablets after removing the background from the acquired images are: obtain the acquired images of the vision machine, simultaneously obtain the pixel values of normal tablets and the average pixel value of the background, obtain the pixel values of each pixel point on the surface of the acquired images, set the images whose pixel values are within the set safety pixel value range different from those of normal tablets as the surface images of the tablets, set the other images as the background images, and obtain the contours and the pixel values of each pixel point of all the surface images of the tablets.

[0014] S12. Compare the contours of the tablet surface images with normal tablets to obtain the contour abnormal range, that is, the image range where the contours of the tablet surface images are different from those of normal tablets, and compare the pixel values of each pixel point of the tablet surface images with normal tablets to obtain the pixel point abnormal range, that is, the image range where the pixel values of the pixel points of the tablet surface images are different from those of normal tablets.

[0015] S13. Obtain the contour abnormal range and the pixel point abnormal range of the tablets as surface defects, and simultaneously obtain the nearest distance data of the surface defects relative to the center position of the tablets. The center position of the tablets is the center data of the circumscribed circle of the tablets.

[0016] As a preferred technical solution of a modular machine vision-based tablet quality inspection method, the steps of importing the tablet surface defect data into a defect feature extraction strategy for defect feature extraction include the following specific steps:

[0017] S21. Obtain the pixel values of each point corresponding to the surface defect and the height values of the corresponding points of the defect relative to the tablet plane.

[0018] S22. Import the pixel values of each point corresponding to the surface defect into a defect pixel feature extraction model for defect pixel feature extraction.

[0019] Among them, the defect pixel feature extraction model includes the following specific steps:

[0020] S221. Obtain the pixel values of each point corresponding to the surface defect, and obtain the defect pixel point with the largest pixel difference relative to the corresponding pixel point of the normal tablet, which is set as the defect center pixel point;

[0021] S222. With the defect center pixel point as the center and the pixel difference as the gradient, divide the defect into several pixel regions;

[0022] S223. Obtain the image contour of each pixel region of the defect, the average distance of the pixel points in the pixel region relative to the defect center pixel point, and the average pixel value of each pixel region;

[0023] S23. Obtain the height values of the points corresponding to the defect relative to the tablet plane and import them into the defect deformation feature extraction model for defect deformation feature extraction;

[0024] Among them, the defect deformation feature extraction model includes the following specific steps:

[0025] S231. Obtain the absolute value of the height value of each point corresponding to the defect relative to the tablet plane, and set the corresponding point with the largest absolute value of the height value of each point corresponding to the defect relative to the tablet plane as the deformation defect center point;

[0026] S232. With the deformation defect center point as the center and the height difference as the gradient, divide the defect into several deformation regions;

[0027] S233. Obtain the contour of the deformation region and the average value of the absolute values of the heights of the points in the deformation region relative to the tablet plane, and at the same time obtain the distance between the contour of each deformation region and the deformation defect center point;

[0028] S24. Obtain the extracted defect pixel features and defect deformation features.

[0029] As a preferred technical solution of a modular machine vision recognition tablet quality detection method, the analysis of the defect types according to the extracted defect features and obtaining the corresponding defect types of the tablets include the following specific steps:

[0030] S31. Obtain the image contour of each pixel region of the defect, the average distance of the pixel points in the pixel region relative to the defect center pixel point, and the average pixel value of each pixel region. At the same time, obtain the image contour of each pixel region of the historically classified defects and import them into the defect pixel type judgment value calculation formula to calculate the defect pixel type judgment value. Among them, the defect pixel type judgment value calculation formula is: , where m is the number of defective pixel regions, xi is the pixel average value of the i-th pixel region corresponding to the defect, Lz is the diameter of the tablet, Li is the average distance of the pixel points in the i-th pixel region from the central pixel point of the defect, S() is the area of the image in the parentheses, si is the contour image of the i-th pixel region corresponding to the defect, siw is the image contour of the i-th pixel region corresponding to the historically classified defect, and xis is the average pixel value of the i-th pixel region corresponding to the historically classified defect. is the intersection of the contours. is the union of the contours;

[0031] S32. Obtain the contours of each deformed region of the defect, the average value of the absolute values of the heights of the points in each deformed region relative to the tablet plane, and the average distance between the contour of each deformed region and the center point of the deformed defect. At the same time, obtain the contours of each deformed region of the historically classified defect and the average value of the absolute values of the heights of the points in each deformed region relative to the tablet plane, and import them into the defect deformation type judgment value calculation formula to calculate the defect deformation type judgment value. The defect deformation type judgment value calculation formula is as follows: , where n is the number of deformed regions of the defect, cj is the average value of the absolute values of the heights of the points in the j-th deformed region relative to the tablet plane, cjs is the average value of the absolute values of the heights of the points in the corresponding j-th deformed region of the historically classified defect relative to the tablet plane, Dj is the average distance between the contour of the j-th deformed region and the center point of the deformed defect, zj is the contour of the j-th deformed region of the defect, and zjw is the contour of the corresponding j-th deformed region of the historically classified defect;

[0032] S33. Obtain the defect pixel type judgment value and the defect deformation type judgment value of the defect and the historically classified defect, and import them into the defect similarity value calculation formula to calculate the defect similarity value. The defect similarity value calculation formula is as follows: , where a is the pixel similarity ratio;

[0033] S34. Obtain the defect similarity values of all historically classified defects and the defect to be recognized, and set the type of the historically classified defect corresponding to the maximum defect similarity value as the type of the defect to be recognized.

[0034] As a preferred technical solution of a modular machine vision recognition tablet quality detection method, the analysis of the tablet production quality according to the recognized defect types and the position data of the corresponding defects includes the following specific contents:

[0035] S41. Obtain the quality base corresponding to the identified defect. At the same time, obtain the pixel values of each pixel point of the defect and the absolute value of the height relative to the tablet plane. Import the pixel values of each pixel point of the obtained defect and the absolute value of the height relative to the tablet plane into the defect outlier calculation formula to calculate the defect outlier. Among them, the defect outlier calculation formula is: Among them, Y is the number of pixel points of the defect, pc is the pixel value of the c-th point of the defect, pcm is the pixel value of the tablet, exp() is the power of the natural constant e, Jc is the absolute value of the height of the c-th point of the defect relative to the tablet plane, and Jm is the tablet thickness;

[0036] S42. Obtain the defect outlier, quality base, and the data of the shortest distance relative to the center position of the tablet for various defects on the tablet, and import them into the tablet quality calculation formula to calculate the tablet quality. Among them, the tablet quality calculation formula is: , where R is the number of defects on the tablet, Qxr is the defect outlier of the r-th defect, Tr is the quality base of the r-th defect, ln() is the logarithm with the natural constant e as the base, Hm is the average diameter of the tablet, Hr is the data of the shortest distance of the r-th defect relative to the center position of the tablet, and Qm is the set defect outlier threshold;

[0037] S43. Compare the obtained tablet quality with the set tablet quality threshold. If the tablet quality is greater than or equal to the set tablet quality threshold, it is determined that the tablet quality is qualified. If the tablet quality is less than the set tablet quality threshold, it is determined that the tablet quality is unqualified.

[0038] In a second aspect, the present application provides a modular machine vision recognition tablet quality detection system, which is implemented based on the above-mentioned modular machine vision recognition tablet quality detection method, and specifically includes a data acquisition module, a defect feature extraction module, a defect type analysis module, and a quality analysis module;

[0039] Among them, the data acquisition module is used to acquire the surface image data of the produced tablets, and acquire the tablet surface defect data and the defect position data from the tablet surface image data;

[0040] The defect feature extraction module is used to import the tablet surface defect data into the defect feature extraction strategy for defect feature extraction;

[0041] The defect type analysis module is used to analyze the defect type according to the extracted defect features and obtain the corresponding defect types of the tablets;

[0042] The quality analysis module is used to analyze the production quality of the tablets according to the identified defect types and the position data of the corresponding defects, and remove the unqualified tablets.

[0043] In a third aspect, the present application provides an electronic device, including: a processor and a memory, wherein a computer program that can be called by the processor is stored in the memory;

[0044] The processor executes the above-mentioned modular machine vision recognition tablet quality detection method by calling the computer program stored in the memory.

[0045] In a fourth aspect, the present application provides a computer-readable storage medium storing instructions, which when run on a computer, cause the computer to execute a modular machine vision recognition tablet quality detection method as described above.

[0046] Compared with the prior art, the beneficial effects of the present application are as follows:

[0047] The present application obtains the surface image data of the produced tablets, obtains the surface defect data and the position data of the defects from the surface image data of the tablets, imports the surface defect data of the tablets into the defect feature extraction strategy for defect feature extraction, analyzes the defect types according to the extracted defect features, and obtains the corresponding defect types of the tablets, analyzes the production quality of the tablets according to the recognized defect types and the position data of the corresponding defects, accurately analyzes the tablet images, extracts the implicit features reflecting the tablet defects, accurately analyzes the defect types according to the implicit features of the defects, and then accurately analyzes the tablet quality according to the classified defect types and positions, improving the accuracy and detection efficiency of the tablet quality detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] By reading the detailed description of the non-restrictive embodiments with reference to the following drawings, other features, objectives, and advantages of the present application will become more apparent;

[0049] Figure 1 It is a schematic diagram of the overall process of a modular machine vision recognition tablet quality detection method of the present application;

[0050] Figure 2 It is a schematic diagram of step S2 of a modular machine vision recognition tablet quality detection method of the present application;

[0051] Figure 3 It is a schematic diagram of the steps of a defect pixel feature extraction model of a modular machine vision recognition tablet quality detection method of the present application;

[0052] Figure 4 It is a schematic diagram of the steps of a defect deformation feature extraction model of a modular machine vision recognition tablet quality detection method of the present application;

[0053] Figure 5This is a schematic diagram of the overall framework of a modular machine vision recognition tablet quality inspection system for this application. Specific implementation manners

[0054] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and in no way constitutes a limitation on the present application and its application or use. Embodiment 1

[0055] To solve the technical problems proposed in the background art, the present application provides a preferred embodiment: as Figures 1-4 shown, a modular machine vision recognition tablet quality inspection method includes the following specific steps:

[0056] S1. Obtain the surface image data of the produced tablets, and obtain the surface defect data and the position data of the defects from the surface image data of the tablets.

[0057] In one specific embodiment, the specific content of obtaining the surface image data of the produced tablets and obtaining the surface defect data and the position data of the defects from the surface image data of the tablets is:

[0058] S11. Lay the produced tablets flat on the acquisition end of the vision machine, and obtain the surface image data of the produced tablets after removing the background from the acquired images.

[0059] In one specific embodiment, the specific steps of obtaining the surface image data of the produced tablets after removing the background from the acquired images are: obtain the acquired images of the vision machine, and at the same time obtain the pixel values of normal tablets and the average pixel value of the background, obtain the pixel values of each pixel point on the surface of the acquired images, set the images within a set safety pixel value range different from the pixel values of normal tablets as the surface images of the tablets, set the other images as the background images, and obtain the contours of all the surface images of the tablets and the pixel values of each pixel point. Here, the set safety pixel value range is set according to the difference between the pixel values of normal tablets and the average pixel value of the background, and is preferably one-fifth of the difference value between the pixel values of normal tablets and the average pixel value of the background.

[0060] S12. Compare the contour of the surface image of the tablets with that of normal tablets to obtain the abnormal contour range, that is, the image range where the contour of the surface image of the tablets is different from that of normal tablets, and compare the pixel values of each pixel point of the surface image of the tablets with those of normal tablets to obtain the abnormal pixel point range, that is, the image range where the pixel values of the pixel points of the surface image of the tablets are different from those of normal tablets.

[0061] S13. Obtain the contour abnormal range and pixel abnormal range of the tablet as surface defects, and at the same time obtain the shortest distance data of the surface defects relative to the center position of the tablet. The center position of the tablet is the center data of the circumscribed circle of the tablet.

[0062] S2. Import the tablet surface defect data into the defect feature extraction strategy for defect feature extraction.

[0063] In one specific embodiment, importing the tablet surface defect data into the defect feature extraction strategy for defect feature extraction includes the following specific steps:

[0064] S21. Obtain the pixel values of each point corresponding to the surface defect and the height values of each point corresponding to the defect relative to the tablet plane.

[0065] S22. Import the pixel values of each point corresponding to the surface defect into the defect pixel feature extraction model for defect pixel feature extraction.

[0066] In one specific embodiment, the defect pixel feature extraction model includes the following specific steps:

[0067] S221. Obtain the pixel values of each point corresponding to the surface defect, and obtain the defect pixel point with the largest pixel difference relative to the corresponding pixel point of the normal tablet as the defect center pixel point.

[0068] S222. Take the defect center pixel point as the center, set the pixel difference as the gradient, and divide the defect into several pixel regions. Here, the set pixel difference is to distinguish the images with different pixel values of the defect, and is set according to the required accuracy, that is, the higher the required accuracy, the smaller the set pixel difference. For example, if the defect needs to be divided into 30 pixel regions, the set pixel difference is at least 1 / 30 of the pixel difference between the pixel value of the defect center pixel point and the corresponding pixel point of the normal tablet.

[0069] S223. Obtain the image contour of each pixel region of the defect, the average distance of the pixel points in the pixel region relative to the defect center pixel point, and the average pixel value of each pixel region.

[0070] S23. Import the height values of each point corresponding to the defect relative to the tablet plane into the defect deformation feature extraction model for defect deformation feature extraction.

[0071] In one specific embodiment, the defect deformation feature extraction model includes the following specific steps:

[0072] S231. Obtain the absolute values of the height values of each point corresponding to the defect relative to the tablet plane, and obtain the corresponding point with the largest absolute value of the height values of each point corresponding to the defect relative to the tablet plane as the deformation defect center point.

[0073] S232. With the center point of the deformation defect as the center, set the height difference as the gradient, and divide the defect into several deformation regions;

[0074] S233. Obtain the contour of the deformation region and the average value of the absolute values of the heights of each point in the deformation region relative to the tablet plane, and at the same time obtain the distance between the contour of each deformation region and the center point of the deformation defect;

[0075] S24. Obtain the defect pixel features and defect deformation features extracted;

[0076] S3. Analyze the defect types based on the extracted defect features, and obtain the corresponding defect types of the tablets;

[0077] In one specific embodiment, analyzing the defect types based on the extracted defect features and obtaining the corresponding defect types of the tablets includes the following specific steps:

[0078] S31. Obtain the image contour of each pixel region of the defect, the average distance of the pixel points in the pixel region relative to the central pixel point of the defect, and the average pixel value of each pixel region, and at the same time obtain the image contour of each pixel region of the historically classified defects, and import them into the defect pixel type judgment value calculation formula to calculate the defect pixel type judgment value. Among them, the defect pixel type judgment value calculation formula is: , where m is the number of defect pixel regions, xi is the average pixel value of the i-th pixel region corresponding to the defect, Lz is the diameter of the tablet, Li is the average distance of the pixel points in the i-th pixel region relative to the central pixel point of the defect, S() is the area of the image in the parentheses, si is the contour image of the i-th pixel region corresponding to the defect, siw is the image contour of the corresponding i-th pixel region of the historically classified defects, xis is the average pixel value of the corresponding i-th pixel region of the historically classified defects, is the intersection of the contours, is the union of the contours. It should be noted here that in the above formula, is the similarity of the contours, is the pixel value similarity. In order to avoid the denominator being 0, so xi is added to the denominator. And because the weights inside and outside the defect are different, the importance is definitely greater closer to the center of the defect. Therefore, the reciprocal of the average distance of the pixel points in the i-th pixel region relative to the central pixel point of the defect is used as the weight. Through the above formula, the similarity of the two defect contours at the pixel level can be accurately analyzed;

[0079] S32. Obtain the contours of the deformed regions of the defect, the average value of the absolute values of the heights of the points in the deformed regions relative to the tablet plane, and the average distance between the contour of each deformed region and the center point of the deformed defect. At the same time, obtain the contours of the deformed regions of the historically classified defects and the average value of the absolute values of the heights of the points in the deformed regions relative to the tablet plane, and import them into the defect deformation type judgment value calculation formula to calculate the defect deformation type judgment value. The defect deformation type judgment value calculation formula is as follows: , where n is the number of deformed regions of the defect, cj is the average value of the absolute values of the heights of the points in the j-th deformed region relative to the tablet plane, cjs is the average value of the absolute values of the heights of the points in the corresponding j-th deformed region of the historically classified defects relative to the tablet plane, Dj is the average distance between the contour of the j-th deformed region and the center point of the deformed defect, zj is the contour of the j-th deformed region of the defect, and zjw is the contour of the corresponding j-th deformed region of the historically classified defects;

[0080] S33. Obtain the defect pixel type judgment value and the defect deformation type judgment value of the defect and the historically classified defects, and import them into the defect similarity value calculation formula to calculate the defect similarity value. The defect similarity value calculation formula is as follows: , where a is the pixel similarity ratio;

[0081] S34. Obtain the defect similarity values of all historically classified defects and the defect to be recognized, and set the type of the historically classified defect corresponding to the maximum defect similarity value as the type of the defect to be recognized;

[0082] S4. Analyze the production quality of the tablets according to the recognized defect types and the position data of the corresponding defects, and remove the unqualified tablets;

[0083] In one specific embodiment, analyzing the production quality of the tablets according to the recognized defect types and the position data of the corresponding defects includes the following specific contents:

[0084] S41. Obtain the quality base corresponding to the recognized defect. It should be noted here that the reason for setting the quality base is that different defects have different degrees of damage to the tablets. For example, crack defects and surface bulge defects. Therefore, different quality bases need to be set for different defects. At the same time, obtain the pixel values of the pixels of the defect and the absolute values of the heights relative to the tablet plane, and import the pixel values of the pixels of the defect and the absolute values of the heights relative to the tablet plane into the defect anomaly value calculation formula to calculate the defect anomaly value. The defect anomaly value calculation formula is as follows: , where Y is the number of defective pixel points, pc is the pixel value of the c-th point of the defect, pcm is the pixel value of the tablet, exp() is the exponential power of the natural constant e, Jc is the absolute value of the height of the c-th point of the defect relative to the tablet plane, and Jm is the tablet thickness;

[0085] S42. Obtain the defect anomaly value, quality base, and the nearest distance data relative to the center position of the tablet for various defects on the tablet, and import them into the tablet quality calculation formula to calculate the tablet quality. The tablet quality calculation formula is as follows: , where R is the number of defects on the tablet, Qxr is the defect anomaly value of the r-th defect, Tr is the quality base of the r-th defect, ln() is the natural logarithm with the natural constant e as the base, Hm is the average diameter of the tablet, Hr is the nearest distance data of the r-th defect relative to the center position of the tablet, and Qm is the set defect anomaly threshold. Here, it should be noted that since the closer the defect is to the center position of the tablet, the greater the threat, the closer the defect is to the center position of the tablet, the more weight it occupies. The defect anomaly threshold is used to adjust the value range of the tablet quality and can be arbitrarily set by the experimenter according to needs;

[0086] S43. Compare the obtained tablet quality with the set tablet quality threshold. If the tablet quality is greater than or equal to the set tablet quality threshold, it is determined that the tablet quality is qualified; if the tablet quality is less than the set tablet quality threshold, it is determined that the tablet quality is unqualified.

[0087] Here, it should be noted that the value-taking methods of the set parameters such as the tablet quality threshold, quality base, and pixel similarity ratio in this embodiment are as follows: Obtain 1000 sets of surface image data of the produced tablets, obtain the surface defect data and the position data of the defects from the surface image data of the tablets, import them into the tablet quality calculation formula to calculate the tablet quality, obtain the judgment results of experts hired on whether these tablets are qualified, and import the tablet quality and the judgment results of whether the tablets are qualified into the fitting software to output the value-taking of the tablet quality threshold, quality base, pixel similarity ratio, etc. that meet the maximum judgment accuracy rate.

[0088] Here, the advantages of this embodiment over the prior art are specifically described: Obtain the surface image data of the produced tablets, obtain the tablet surface defect data and the position data of the defects from the tablet surface image data, import the tablet surface defect data into the defect feature extraction strategy for defect feature extraction, analyze the defect types according to the extracted defect features, and obtain the corresponding defect types of the tablets. Analyze the production quality of the tablets according to the identified defect types and the position data of the corresponding defects, accurately analyze the tablet images, extract the implicit features reflecting the tablet defects, accurately analyze the defect types according to the implicit features of the defects, and then accurately analyze the tablet quality according to the classified defect types and positions, improving the accuracy and detection efficiency of tablet quality detection. Embodiment 2

[0089] As Figure 5 shown, a modular machine vision recognition tablet quality detection system is based on the above-mentioned modular machine vision recognition tablet quality detection method and specifically includes a data acquisition module, a defect feature extraction module, a defect type analysis module, and a quality analysis module; The data acquisition module is used to obtain the surface image data of the produced tablets and obtain the tablet surface defect data and the position data of the defects from the tablet surface image data; The defect feature extraction module is used to import the tablet surface defect data into the defect feature extraction strategy for defect feature extraction; The defect type analysis module is used to analyze the defect types according to the extracted defect features and obtain the corresponding defect types of the tablets; The quality analysis module is used to analyze the production quality of the tablets according to the identified defect types and the position data of the corresponding defects and remove unqualified tablets; It may also include a control module, and the control module is used to control the operation of the data acquisition module, the defect feature extraction module, the defect type analysis module, and the quality analysis module. Embodiment 3

[0090] This embodiment provides an electronic device, including: a processor and a memory, wherein, a computer program that can be called by the processor is stored in the memory;

[0091] The processor executes the above-mentioned modular machine vision recognition tablet quality detection method by calling the computer program stored in the memory.

[0092] The electronic device may vary significantly due to different configurations or performances, and can include one or more processors and one or more memories. Among them, at least one computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement a modular machine vision recognition tablet quality detection method provided by the above method embodiment. The electronic device can also include other components for implementing the device functions. For example, the electronic device can also have components such as wired or wireless network interfaces and input / output interfaces for data input and output. This embodiment will not be elaborated here. Embodiment 4

[0093] This embodiment provides a computer-readable storage medium, on which a rewritable computer program is stored;

[0094] When the computer program runs on a computer device, it causes the computer device to execute the above-mentioned modular machine vision recognition tablet quality detection method.

[0095] For example, the computer-readable storage medium can be a read-only memory, a random access memory, a compact disc read-only memory, magnetic tape, a floppy disk, and an optical data storage device, etc.

[0096] The above embodiments can be implemented in whole or in part by software, hardware, firmware, or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the processes or functions according to the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired network or / and a wireless network. The computer-readable storage medium can be any available medium that the computer can access or a data storage device such as a server or a data center that includes one or more collections of available media. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state drive.

[0097] The term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or apparatus that comprises a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or apparatus.

[0098] The above description is only a preferred embodiment of the present application and an illustration of the applied technical principles. Those skilled in the art should understand that the scope of the application involved in the present application is not limited to the technical solutions formed by the specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the foregoing application concept. For example, the technical solutions formed by the mutual replacement of the above features with the technical features (but not limited to) having similar functions applied in the present application.

Claims

1. A modular machine vision tablet quality detection method, characterized in that: It includes the following specific steps: Acquire surface image data of produced tablets, and acquire surface defect data and defect location data of tablets from the surface image data of tablets; Importing tablet surface defect data into defect feature extraction strategy to extract defect features; The step of importing tablet surface defect data into the defect feature extraction strategy to extract defect features includes the following specific steps: Obtaining the pixel value of each point corresponding to the surface defect and the height value of each point corresponding to the defect relative to the tablet plane; Obtain pixel values ​​of each point corresponding to the surface defect and import them into the defect pixel feature extraction model to extract defect pixel features; Obtain the height values ​​of each point corresponding to the defect relative to the tablet plane and import them into the defect deformation feature extraction model to extract the defect deformation feature; Obtaining the extracted defect pixel features and defect deformation features; The defective pixel feature extraction model includes the following specific steps: Obtain the pixel values ​​of each point corresponding to the surface defect, obtain the defect pixel point with the largest pixel difference relative to the corresponding pixel point of the normal tablet, and set it as the defect center pixel point; Taking the defect center pixel as the center, setting the pixel difference as the gradient, the defect is divided into several pixel areas; Obtain the image contour of each pixel area of ​​the defect, the average distance of the pixels in the pixel area relative to the center pixel of the defect, and the average pixel value of each pixel area; The defect deformation feature extraction model includes the following specific steps: Obtain the absolute value of the height of each point corresponding to the defect relative to the tablet plane, and set the corresponding point with the largest absolute value of the height of each point corresponding to the defect relative to the tablet plane as the center point of the deformation defect; Taking the center point of the deformation defect as the center, set the height difference as the gradient and divide the defect into several deformation areas; Obtain the contour of the deformation area and the average value of the absolute value of the height of each point in the deformation area relative to the tablet plane, and simultaneously obtain the distance between the contour of each deformation area and the center point of the deformation defect; Analyze the defect types according to the extracted defect features and obtain the corresponding defect types of the tablets; The tablet production quality is analyzed based on the identified defect types and corresponding defect location data, and unqualified tablets are removed.

2. A modular machine vision tablet quality detection method as claimed in claim 1, characterized in that: The specific contents of obtaining the produced tablet surface image data and obtaining the tablet surface defect data and defect location data from the tablet surface image data are as follows: The produced tablets are laid flat on the acquisition end of the visual machine, and the surface image data of the produced tablets are obtained after removing the background from the acquired image; Compare the contour of the tablet surface image with that of a normal tablet to obtain the abnormal contour range, and compare the pixel value of each pixel point of the tablet surface image with that of a normal tablet to obtain the abnormal pixel point range; The abnormal contour range and pixel point abnormal range of the tablet are set as surface defects, and the closest distance data of the surface defect relative to the center position of the tablet are obtained.

3. A modular machine vision tablet quality detection method as claimed in claim 2, characterized in that: The defect type analysis based on the extracted defect features and obtaining the defect type of the corresponding tablet includes the following specific steps: obtaining the image contour of each pixel area of ​​the defect, the average distance of the pixel points in the pixel area relative to the defect center pixel point and the pixel average value of each pixel area, and simultaneously obtaining the image contour of each pixel area of ​​the historical classified defects, and importing it into the defect pixel type judgment value calculation formula to calculate the defect pixel type judgment value, wherein the defect pixel type judgment value calculation formula is: , where m is the number of defective pixel regions, xi is the average pixel value of the i-th pixel region corresponding to the defect, Lz is the diameter of the tablet, Li is the average distance between the pixel points in the i-th pixel region and the center pixel point of the defect, S() is the area of ​​the image in brackets, si is the contour image of the i-th pixel region corresponding to the defect, siw is the image contour of the i-th pixel region corresponding to the historically classified defect, and xis is the average pixel value of the i-th pixel region corresponding to the historically classified defect. is the intersection of the contours, is the union of contours.

4. A modular machine vision tablet quality detection method as claimed in claim 3, characterized in that: The defect type analysis based on the extracted defect features and obtaining the corresponding tablet defect type also includes the following specific steps: The contours of each deformation area of ​​the defect, the average value of the absolute value of the height of each point in the deformation area relative to the tablet plane, and the average distance between the contour of each deformation area and the center point of the deformation defect are obtained. At the same time, the contours of each deformation area of ​​the historically classified defects and the average value of the absolute value of the height of each point in the deformation area relative to the tablet plane are obtained, and imported into the defect deformation type judgment value calculation formula to calculate the defect deformation type judgment value, wherein the defect deformation type judgment value calculation formula is: , where n is the number of deformation regions of the defect, cj is the average value of the absolute values ​​of the heights of each point in the jth deformation region relative to the tablet plane, cjs is the average value of the absolute values ​​of the heights of each point in the jth deformation region corresponding to the historically classified defect relative to the tablet plane, Dj is the average distance between the jth deformation region contour and the center point of the deformation defect, zj is the jth deformation region contour of the defect, and zjw is the jth deformation region contour corresponding to the historically classified defect.

5. A modular machine vision tablet quality detection method as claimed in claim 4, characterized in that: The defect type analysis based on the extracted defect features and obtaining the corresponding tablet defect type also includes the following specific steps: obtaining the defect pixel type judgment value and the defect deformation type judgment value of the defect and the historically classified defect, and importing them into the defect similarity value calculation formula to calculate the defect similarity value, wherein the defect similarity value calculation formula is: , where a is the pixel similarity ratio; obtain the defect similarity values ​​of all historically classified defects and the defect to be identified, and set the historically classified defect type corresponding to the maximum defect similarity value as the type of the defect to be identified.

6. A modular machine vision tablet quality detection method as claimed in claim 5, characterized in that: The analysis of tablet production quality according to the identified defect types and the position data of the corresponding defects includes the following specific contents: obtaining the quality base number corresponding to the identified defects, and simultaneously obtaining the pixel value of each pixel point of the defect and the absolute value of the height relative to the tablet plane, and importing the obtained pixel value of each pixel point of the defect and the absolute value of the height relative to the tablet plane into the defect abnormal value calculation formula to calculate the defect abnormal value, wherein the defect abnormal value calculation formula is: , where Y is the number of pixels of the defect, pc is the pixel value of the cth point of the defect, pcm is the pixel value of the tablet, exp() is the power of the natural constant e, Jc is the absolute value of the height of the cth point of the defect relative to the tablet plane, and Jm is the tablet thickness.

7. A modular machine vision tablet quality detection method as claimed in claim 6, characterized in that: The analysis of tablet production quality based on the identified defect types and corresponding defect location data also includes the following specific contents: obtaining defect abnormality values, mass base numbers and the closest distance data relative to the center position of the tablet of various defects on the tablet, and importing them into the tablet mass calculation formula to calculate the tablet mass, wherein the tablet mass calculation formula is: , where R is the number of defects on the tablet, Qxr is the defect abnormality value of the r-th defect, Tr is the mass base of the r-th defect, ln() is the logarithm with the natural constant e as the base, Hm is the average diameter of the tablet, Hr is the closest distance data of the r-th defect relative to the center position of the tablet, Qm is the set defect abnormality threshold, and the obtained tablet quality is compared with the set tablet quality threshold. If the tablet quality is greater than or equal to the set tablet quality threshold, the tablet quality is judged to be qualified. If the tablet quality is less than the set tablet quality threshold, the tablet quality is judged to be unqualified.

8. A modular machine vision tablet quality detection method as claimed in claim 7, characterized in that: The specific steps of obtaining the surface image data of the produced tablets after removing the background from the collected image are: obtaining the collected image of the visual machine, simultaneously obtaining the pixel value of the normal tablet and the average pixel value of the background, obtaining the pixel value of each pixel point on the surface of the collected image, obtaining an image whose pixel value differs from the normal tablet within a set safe pixel value range and set it as the tablet surface image, setting other images as background images, and obtaining the contours of all tablet surface images and the pixel value of each pixel point.

9. A modular machine vision recognition tablet quality inspection system, which is implemented based on the modular machine vision recognition tablet quality inspection method according to any one of claims 1 to 8, characterized in that: It specifically includes a data acquisition module, a defect feature extraction module, a defect type analysis module and a quality analysis module; Wherein, the data acquisition module is used to acquire the surface image data of the produced tablets, and acquire the surface defect data and the position data of the defects from the surface image data of the tablets; The defect feature extraction module is used to import tablet surface defect data into the defect feature extraction strategy to extract defect features; The defect type analysis module is used to analyze the defect type according to the extracted defect features and obtain the corresponding defect type of the tablet; The quality analysis module is used to analyze the tablet production quality according to the identified defect types and the position data of the corresponding defects, and remove unqualified tablets.

10. A modular machine vision tablet quality inspection system as claimed in claim 9, characterized in that: The system also includes a control module, which is used to control the operation of the data acquisition module, the defect feature extraction module, the defect type analysis module and the quality analysis module.

11. An electronic device, comprising: A processor and a memory, wherein the memory stores a computer program that can be called by the processor; It is characterized in that the processor executes the modular machine vision recognition tablet quality detection method as described in any one of claims 1 to 8 by calling the computer program stored in the memory.

12. A computer-readable storage medium, characterized in that: Instructions are stored, and when the instructions are executed on a computer, the computer executes a modular machine vision recognition tablet quality detection method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Display module defect detection method based on machine vision

    CN118483233A

  • Residual piece detecting and removing device and method

    CN118527377A