Modularized machine vision identification tablet quality detection system and method

Through the modular machine visual recognition system, the implicit features of the surface defects on the tablet, analyze the types and positions of the defects, solve the problem of inaccurate quality detection of tablets in existing technologies, and improve the accuracy and efficiency of detection.

CN119360146AActive Publication Date: 2025-01-24JIANGXI UNIVERSITY OF TRADITIONAL CHINESE MEDICINE +1

Patent Information

Application Number
CN202411931930.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-01-24
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 inspection system is designed. By acquiring tablet surface image data, extracting defect features, analyzing defect types, and performing accurate quality analysis based on the classified defect types and locations.

Benefits of technology

The accuracy and efficiency of tablet quality inspection are improved, and the type and location of defects can be accurately analyzed based on the hidden characteristics of defects, so as to conduct accurate quality assessment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119360146A_ABST
    Figure CN119360146A_ABST
Patent Text Reader

Abstract

The invention discloses a modular machine vision identification tablet quality detection system and method, and belongs to the field of machine vision. Defect types are analyzed according to extracted defect features, and the defect types of corresponding tablets are obtained; analyzing the tablet production quality according to the identified defect types and the position data corresponding to the defects, accurately analyzing tablet images, extracting implicit features reflecting the tablet defects, accurately analyzing the defect types according to the implicit features of the defects, and analyzing the tablet production quality according to the implicit features of the defects. And the tablet quality is accurately analyzed according to the classified defect types and positions, so that the accuracy and the detection efficiency of tablet quality detection are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of scene recognition, and specifically is a modular machine vision recognition tablet quality detection system and method. Background Art

[0002] The quality of tablet production is related to the safety and effectiveness of tablets. Therefore, it is very important to ensure quality control during the tablet production process. To ensure the quality of tablet production, it is necessary to comprehensively consider multiple aspects such as raw materials, production processes, and equipment, and take strict quality inspection and control measures. After tablet production, the tablet molding condition needs to be quality inspected. At this time, a modular machine vision recognition tablet quality inspection system is needed; When the prior art is testing the quality of tablet molding, it usually simply compares images, then performs pixel analysis to find out the size of defects, and then performs quality scoring based on the defect size and difference. This causes the prior art to ignore the difference in the impact of defect types on quality, and it is impossible to accurately analyze the defect types based on the implicit characteristics of the defects, which in turn leads to the inability to accurately analyze the tablet quality based on the classified defect types and locations. Most of the prior art has the above problems; In order to solve the problems raised by the background technology, the present application designs a modular machine vision recognition tablet quality detection system and method. Summary of the invention

[0003] In response to the shortcomings of the prior art, the present application proposes a modular machine vision recognition tablet quality inspection system and method. The present application accurately analyzes tablet images, extracts 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 based on the classified defect types and locations, thereby improving the accuracy and efficiency of tablet quality inspection.

[0004] To achieve the above objectives, the present application provides the following technical solutions: In the first aspect, the present application provides a modular machine vision recognition tablet quality detection method, which includes the following specific steps: S1. Obtaining surface image data of produced tablets, and obtaining surface defect data and defect location data of tablets from the surface image data of tablets; S2, importing tablet surface defect data into defect feature extraction strategy to extract defect features; S3. Analyze the defect types according to the extracted defect features, and obtain the corresponding defect types of the tablets; S4. Analyze the tablet production quality based on the identified defect types and corresponding defect location data, and remove unqualified tablets.

[0005] As a preferred technical solution of a modular machine vision recognition tablet quality inspection method, 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: S11, laying the produced tablets on the acquisition end of the visual machine, and obtaining the surface image data of the produced tablets after removing the background from the acquired image; 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 as the tablet surface image, setting other images as background images, and obtaining the outlines of all tablet surface images and the pixel value of each pixel point; S12, comparing the contour of the tablet surface image with that of a normal tablet to obtain a contour abnormal range, that is, an image range where the contour of the tablet surface image is different from that of a normal tablet, and comparing the pixel value of each pixel point of the tablet surface image with that of a normal tablet to obtain a pixel point abnormal range, that is, an image range where the pixel value of each pixel point of the tablet surface image is different from that of a normal tablet; S13, obtaining the abnormal range of the contour and the abnormal range of the pixel points of the tablet as the surface defect, and obtaining the closest distance data of the surface defect 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.

[0006] As a preferred technical solution for a modular machine vision tablet quality detection method, the method of importing tablet surface defect data into a defect feature extraction strategy for defect feature extraction includes the following specific steps: S21, 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; S22, obtaining pixel values ​​of each point corresponding to the surface defect and importing them into a defect pixel feature extraction model to extract defect pixel features; The defective pixel feature extraction model includes the following specific steps: S221, obtaining pixel values ​​of each point corresponding to the surface defect, obtaining the defect pixel point with the largest pixel difference relative to the corresponding pixel point of the normal tablet, and setting it as the defect center pixel point; S222, taking the defect center pixel point as the center, setting the pixel difference as a gradient, and dividing the defect into a plurality of pixel areas; S223, obtaining the image contour of each pixel area of ​​the defect, the average distance of the pixels in the pixel area relative to the central pixel of the defect, and the average pixel value of each pixel area; S23, obtaining the height value of each point corresponding to the defect relative to the tablet plane and importing it into the defect deformation feature extraction model to extract the defect deformation feature; Among them, the defect deformation feature extraction model includes the following specific steps: S231, obtaining the absolute value of the height of each point corresponding to the defect relative to the tablet plane, and setting 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; S232, taking the center point of the deformation defect as the center, setting the height difference as a gradient, and dividing the defect into a plurality of deformation areas; S233, obtaining the average value of the absolute value of the height of the contour of the deformation area and each point of the deformation area relative to the tablet plane, and simultaneously obtaining the distance between the contour of each deformation area and the center point of the deformation defect; S24, obtaining the extracted defective pixel features and defective deformation features.

[0007] As a preferred technical solution of a modular machine vision recognition tablet quality inspection method, the defect type analysis based on the extracted defect features and obtaining the corresponding tablet defect type includes the following specific steps: S31, 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 average value of the pixels in each pixel area, and at the same time obtaining the image contour of each pixel area of ​​the historical classified defects, and importing them 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; S32, obtaining the contour 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, and at the same time obtaining the contour 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, and importing them 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 of the j-th deformation region relative to the tablet plane, cjs is the average value of the absolute values ​​of the heights of each point of the j-th deformation region corresponding to the historically classified defect relative to the tablet plane, Dj is the average distance between the j-th deformation region contour and the center point of the deformation defect, zj is the j-th deformation region contour of the defect, and zjw is the j-th deformation region contour corresponding to the historically classified defect; S33, obtaining defect pixel type judgment values ​​and defect deformation type judgment values ​​of the defect and the historically classified defects, and importing them into a 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; S34, obtaining defect similarity values ​​of all historically classified defects and the defect to be identified, and setting the historically classified defect type corresponding to the maximum defect similarity value as the type of the defect to be identified.

[0008] As a preferred technical solution of a modular machine vision recognition tablet quality detection method, the analysis of tablet production quality based on the identified defect types and corresponding defect location data includes the following specific contents: S41, obtaining the quality base number corresponding to the identified defect, 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; S42, obtaining defect abnormality values, mass bases, and the closest distance data relative to the center position of various defects on the tablet, and importing them into a 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 of the tablet, and Qm is the set defect abnormality threshold; 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, the tablet quality is determined to be qualified. If the tablet quality is less than the set tablet quality threshold, the tablet quality is determined to be unqualified.

[0009] In a second aspect, the present application provides a modular machine vision recognition tablet quality inspection system, which is implemented based on the above-mentioned modular machine vision recognition tablet quality inspection method, and 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.

[0010] In a third aspect, the present application provides an electronic device, comprising: a processor and a memory, wherein the memory stores a computer program that can be called by the processor; The processor executes the above-mentioned modular machine vision recognition tablet quality detection method by calling the computer program stored in the memory.

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

[0012] Compared with the prior art, the beneficial effects of this application are: The present application obtains surface image data of produced tablets, obtains tablet surface defect data and defect location data from the tablet surface image data, imports the tablet surface defect data into a defect feature extraction strategy to extract defect features, analyzes defect types based on the extracted defect features, and obtains the corresponding tablet defect types, analyzes tablet production quality based on the identified defect types and corresponding defect location data, accurately analyzes tablet images, extracts implicit features reflecting tablet defects, accurately analyzes defect types based on the implicit features of the defects, and then accurately analyzes tablet quality based on the classified defect types and locations, thereby improving the accuracy and efficiency of tablet quality detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings; Figure 1 This is a schematic diagram of the overall process of a modular machine vision recognition tablet quality detection method for this application; Figure 2 This is a schematic diagram of step S2 of a modularized machine vision tablet quality detection method for this application; Figure 3 This is a schematic diagram of the defect pixel feature extraction model steps of a modular machine vision recognition tablet quality inspection method of this application; Figure 4 This is a schematic diagram of the defect deformation feature extraction model steps of a modular machine vision recognition tablet quality inspection method in this application; Figure 5 This is a schematic diagram of the overall framework of a modular machine vision recognition tablet quality inspection system for this application. DETAILED DESCRIPTION

[0014] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and is by no means intended to limit the present application and its application or use. Example 1

[0015] In order to solve the technical problems raised in the background technology, the present application provides a preferred embodiment: Figure 1-Figure 4 As shown, a modular machine vision recognition tablet quality detection method includes the following specific steps: S1. Obtaining surface image data of produced tablets, and obtaining surface defect data and defect location data of tablets from the surface image data of tablets; In one specific embodiment, the specific contents 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 are as follows: S11, laying the produced tablets on the acquisition end of the visual machine, and obtaining the surface image data of the produced tablets after removing the background from the acquired image; In one of the specific embodiments, 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 that differs from the pixel value of the normal tablet within a set safe pixel value range as the tablet surface image, setting other images as the background image, obtaining the contours of all tablet surface images and the pixel value of each pixel point, wherein the set safe pixel value range is set according to the difference between the pixel value of the normal tablet and the average pixel value of the background, and is preferably one-fifth of the difference between the pixel value of the normal tablet and the average pixel value of the background; S12, comparing the contour of the tablet surface image with that of a normal tablet to obtain a contour abnormal range, that is, an image range where the contour of the tablet surface image is different from that of a normal tablet, and comparing the pixel value of each pixel point of the tablet surface image with that of a normal tablet to obtain a pixel point abnormal range, that is, an image range where the pixel value of each pixel point of the tablet surface image is different from that of a normal tablet; S13, obtaining the abnormal range of the tablet's contour and the abnormal range of the pixel points as surface defects, and obtaining the data of the closest distance of the surface defect relative to the center position of the tablet, where the center position of the tablet is the center data of the circumscribed circle of the tablet; S2, importing tablet surface defect data into defect feature extraction strategy to extract defect features; In one specific embodiment, the process of importing tablet surface defect data into a defect feature extraction strategy for defect feature extraction includes the following specific steps: S21, 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; S22, obtaining pixel values ​​of each point corresponding to the surface defect and importing them into a defect pixel feature extraction model to extract defect pixel features; In one specific embodiment, the defective pixel feature extraction model includes the following specific steps: S221, obtaining pixel values ​​of each point corresponding to the surface defect, obtaining the defect pixel point with the largest pixel difference relative to the corresponding pixel point of the normal tablet, and setting it as the defect center pixel point; S222, taking the defect center pixel point as the center, setting the pixel difference value as a gradient, and dividing the defect into a number of pixel areas. The pixel difference value here is set according to the required accuracy in order to distinguish images of different pixel values ​​of the defect. That is, the higher the required accuracy, the smaller the pixel difference value is set. For example, if the defect needs to be divided into 30 pixel areas, the pixel difference value is set to at least 1 / 30 of the pixel difference between the pixel value of the defect center pixel point and the pixel value of the corresponding pixel point of the normal tablet; S223, obtaining the image contour of each pixel area of ​​the defect, the average distance of the pixels in the pixel area relative to the central pixel of the defect, and the average pixel value of each pixel area; S23, obtaining the height value of each point corresponding to the defect relative to the tablet plane and importing it into the defect deformation feature extraction model to extract the defect deformation feature; In one specific embodiment, the defect deformation feature extraction model includes the following specific steps: S231, obtaining the absolute value of the height of each point corresponding to the defect relative to the tablet plane, and setting 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; S232, taking the center point of the deformation defect as the center, setting the height difference as a gradient, and dividing the defect into a plurality of deformation areas; S233, obtaining the average value of the absolute value of the height of the contour of the deformation area and each point of the deformation area relative to the tablet plane, and simultaneously obtaining the distance between the contour of each deformation area and the center point of the deformation defect; S24, obtaining the extracted defect pixel features and defect deformation features; S3. Analyze the defect types according to the extracted defect features, and obtain the corresponding defect types of the tablets; In one specific embodiment, analyzing the defect type according to the extracted defect features and obtaining the corresponding defect type of the tablet includes the following specific steps: S31, 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 average value of the pixels in each pixel area, and at the same time obtaining the image contour of each pixel area of ​​the historical classified defects, and importing them 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 the contours. It should be noted that in the above formula, is the contour similarity, That is, the pixel value similarity. In order to avoid the denominator being 0, xi is added to the denominator. Since the weights inside and outside the defect are different, the closer to the defect center, the greater its importance. Therefore, the reciprocal of the average distance between the pixel point in the i-th pixel area and the pixel point at the defect center is used as the weight. The above formula can accurately analyze the similarity of the two defect contours at the pixel level. S32, obtaining the contour 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, and at the same time obtaining the contour 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, and importing them 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 of the j-th deformation region relative to the tablet plane, cjs is the average value of the absolute values ​​of the heights of each point of the j-th deformation region corresponding to the historically classified defect relative to the tablet plane, Dj is the average distance between the j-th deformation region contour and the center point of the deformation defect, zj is the j-th deformation region contour of the defect, and zjw is the j-th deformation region contour corresponding to the historically classified defect; S33, obtaining defect pixel type judgment values ​​and defect deformation type judgment values ​​of the defect and the historically classified defects, and importing them into a 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; S34, obtaining defect similarity values ​​of all historically classified defects and the defect to be identified, obtaining the historically classified defect type corresponding to the maximum defect similarity value and setting it as the type of the defect to be identified; S4. Analyze the tablet production quality according to the identified defect types and corresponding defect location data, and remove unqualified tablets; In one specific embodiment, analyzing the tablet production quality based on the identified defect types and the corresponding defect location data includes the following specific contents: S41. Obtain the quality base number of the corresponding identified defect. It should be noted that the reason for setting the quality base number here is that different defects have different degrees of damage to the tablet, such as crack defects and surface ridge defects. Therefore, different quality base numbers need to be set for different defects. At the same time, the pixel value of each pixel point of the defect and the absolute value of the height relative to the tablet plane are obtained. The obtained pixel value of each pixel point of the defect and the absolute value of the height relative to the tablet plane are introduced into the defect abnormal value calculation formula to calculate the defect abnormal value. 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; S42, obtaining defect abnormality values, mass bases, and the closest distance data relative to the center position of various defects on the tablet, and importing them into a 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 of the tablet, and Qm is the set defect abnormality threshold. It should be noted that the closer the defect is to the center of the tablet, the greater the threat it poses. Therefore, the closer the defect is to the center of the tablet, the more weight it occupies. In order to adjust the value range of tablet quality, the defect abnormality threshold can be set arbitrarily by the experimenter according to needs; 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, the tablet quality is determined to be qualified. If the tablet quality is less than the set tablet quality threshold, the tablet quality is determined to be unqualified.

[0016] It should be noted here that the setting parameters of the tablet quality threshold, quality base and pixel similarity ratio in this embodiment are determined in the following manner: 1,000 groups of produced tablet surface image data are obtained, tablet surface defect data and defect location data are obtained from the tablet surface image data, the tablet quality is calculated by importing them into the tablet quality calculation formula, the judgment results of hired experts on whether the tablets are qualified are obtained, the tablet quality and the judgment results on whether the tablets are qualified are imported into the fitting software, and the values ​​of the tablet quality threshold, quality base and pixel similarity ratio that meet the maximum judgment accuracy are output.

[0017] The advantages of this embodiment over the prior art are specifically described here: obtaining surface image data of produced tablets, obtaining tablet surface defect data and defect location data from the tablet surface image data, importing the tablet surface defect data into a defect feature extraction strategy for defect feature extraction, analyzing defect types based on the extracted defect features, and obtaining corresponding tablet defect types, analyzing tablet production quality based on the identified defect types and corresponding defect location data, accurately analyzing tablet images, extracting implicit features reflecting tablet defects, accurately analyzing defect types based on the implicit features of the defects, and then accurately analyzing tablet quality based on the classified defect types and locations, thereby improving the accuracy and efficiency of tablet quality detection. Example 2

[0018] like Figure 5 As shown, a modular machine vision recognition tablet quality inspection system is implemented based on the above-mentioned modular machine vision recognition tablet quality inspection 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 acquire the surface image data of the produced tablets, and acquire the tablet surface defect data and the defect location data 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 type according to the extracted defect features, and obtain the corresponding tablet defect type; the quality analysis module is used to analyze the tablet production quality according to the identified defect type and the corresponding defect location data, and remove unqualified tablets; it can also include a control module, 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. Example 3

[0019] This embodiment provides an electronic device, including: a processor and a memory, wherein the memory stores a computer program that can be called by the processor; The processor executes the above-mentioned modular machine vision recognition tablet quality detection method by calling the computer program stored in the memory.

[0020] The electronic device may have relatively large differences due to different configurations or performances, and may include one or more processors and one or more memories, wherein the memory stores at least one computer program, and the computer program is loaded and executed by the processor to implement a modular machine vision tablet quality detection method provided by the above method embodiment. The electronic device may also include other components for realizing the functions of the device, for example, the electronic device may also have components such as a wired or wireless network interface and an input and output interface to input and output data. This embodiment will not be described in detail here. Example 4

[0021] This embodiment provides a computer-readable storage medium having a rewritable computer program stored thereon; When the computer program runs on a computer device, the computer device executes the above-mentioned modular machine vision recognition tablet quality detection method.

[0022] For example, the computer readable storage medium can be a read-only memory, a random access memory, a read-only CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.

[0023] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by 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 a computer instruction or computer program is loaded or executed on a computer, a process or function according to an embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. Computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center through a wired network or / and a wireless network. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.

[0024] The terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not expressly listed, or also includes elements inherent to such process, method, article, or apparatus.

[0025] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of application involved in the present application is not limited to the technical solution formed by a 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 aforementioned application concept. For example, the above features are replaced with (but not limited to) technical features with 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; 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 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; The extracted defect pixel features and defect deformation features are obtained.

4. A modular machine vision tablet quality detection method as claimed in claim 3, characterized in that: 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; The image contour of each pixel area of ​​the defect, the average distance of the pixels in the pixel area relative to the central pixel of the defect, and the average pixel value of each pixel area are obtained.

5. A modular machine vision tablet quality detection method as claimed in claim 4, characterized in that: 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; 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 are obtained, and the distance between the contour of each deformation area and the center point of the deformation defect is obtained.

6. A modular machine vision tablet quality detection method as claimed in claim 5, 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.

7. A modular machine vision tablet quality detection method as claimed in claim 6, 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.

8. A modular machine vision tablet quality detection method according to claim 7, 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.

9. A modular machine vision tablet quality detection method as claimed in claim 8, 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.

10. A modular machine vision tablet quality detection method as claimed in claim 9, characterized in that: The analysis of tablet production quality based on the identified defect types and the 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.

11. A modular machine vision tablet quality detection method as claimed in claim 10, 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 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.

12. A modular machine vision tablet quality detection system, which is implemented based on the modular machine vision tablet quality detection method according to any one of claims 1 to 11, 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.

13. A modular machine vision tablet quality inspection system as claimed in claim 12, 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.

14. 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 11 by calling the computer program stored in the memory.

15. 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 11.

Citation Information

Patent Citations

  • Segment code liquid crystal screen defect detection method based on machine vision

    CN113344872A

  • Vehicle surface defect positioning method, device and system, medium and equipment

    CN118469892A

  • Display module defect detection method based on machine vision

    CN118483233A

  • Residual piece detecting and removing device and method

    CN118527377A

  • Method, system and equipment applied to tablet defect detection and storage medium

    CN119049021A

Cited By

  • Velvet flower product quality detection and evaluation method and system based on digitization

    CN119784258A

  • Equipment intelligent control method and system applied to tablet defect detection

    CN121280448A

  • Intelligent control method and system of equipment applied to tablet defect detection

    CN121280448B