CN115393318A - Method and system for detecting appearance quality of Xuesaitong dropping pills - Google Patents
Method and system for detecting appearance quality of Xuesaitong dropping pills Download PDFInfo
- Publication number
- CN115393318A CN115393318A CN202211026911.2A CN202211026911A CN115393318A CN 115393318 A CN115393318 A CN 115393318A CN 202211026911 A CN202211026911 A CN 202211026911A CN 115393318 A CN115393318 A CN 115393318A
- Authority
- CN
- China
- Prior art keywords
- xuesaitong
- image
- pill
- dropping
- dripping
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 239000006187 pill Substances 0.000 title claims abstract description 184
- 239000009692 xuesetong Substances 0.000 title claims abstract description 124
- 238000000034 method Methods 0.000 title claims abstract description 42
- 238000003709 image segmentation Methods 0.000 claims abstract description 20
- 230000011218 segmentation Effects 0.000 claims description 11
- 238000004422 calculation algorithm Methods 0.000 claims description 10
- 238000004364 calculation method Methods 0.000 claims description 7
- 238000004590 computer program Methods 0.000 claims description 6
- 238000003860 storage Methods 0.000 claims description 5
- 230000007797 corrosion Effects 0.000 claims description 3
- 238000005260 corrosion Methods 0.000 claims description 3
- 238000003062 neural network model Methods 0.000 claims description 3
- 238000000605 extraction Methods 0.000 claims description 2
- 238000001514 detection method Methods 0.000 abstract description 10
- 230000000694 effects Effects 0.000 description 8
- 230000006870 function Effects 0.000 description 5
- 238000002360 preparation method Methods 0.000 description 5
- 238000012545 processing Methods 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 235000002566 Capsicum Nutrition 0.000 description 2
- 240000005636 Dryobalanops aromatica Species 0.000 description 2
- 239000006002 Pepper Substances 0.000 description 2
- 241000722363 Piper Species 0.000 description 2
- 235000016761 Piper aduncum Nutrition 0.000 description 2
- 235000017804 Piper guineense Nutrition 0.000 description 2
- 235000008184 Piper nigrum Nutrition 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 230000000295 complement effect Effects 0.000 description 2
- 238000009826 distribution Methods 0.000 description 2
- 239000003814 drug Substances 0.000 description 2
- 230000003628 erosive effect Effects 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 238000002156 mixing Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 239000008188 pellet Substances 0.000 description 2
- 150000003839 salts Chemical class 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 239000007962 solid dispersion Substances 0.000 description 2
- 206010067484 Adverse reaction Diseases 0.000 description 1
- 201000001320 Atherosclerosis Diseases 0.000 description 1
- 238000012935 Averaging Methods 0.000 description 1
- 239000010749 BS 2869 Class C1 Substances 0.000 description 1
- 208000024172 Cardiovascular disease Diseases 0.000 description 1
- 230000003213 activating effect Effects 0.000 description 1
- 230000006838 adverse reaction Effects 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 239000008280 blood Substances 0.000 description 1
- 210000004369 blood Anatomy 0.000 description 1
- 230000017531 blood circulation Effects 0.000 description 1
- 230000001186 cumulative effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000010339 dilation Effects 0.000 description 1
- 208000037265 diseases, disorders, signs and symptoms Diseases 0.000 description 1
- 208000035475 disorder Diseases 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 239000004744 fabric Substances 0.000 description 1
- 238000010438 heat treatment Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000031700 light absorption Effects 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000002844 melting Methods 0.000 description 1
- 230000008018 melting Effects 0.000 description 1
- 229910044991 metal oxide Inorganic materials 0.000 description 1
- 150000004706 metal oxides Chemical class 0.000 description 1
- 230000001737 promoting effect Effects 0.000 description 1
- 238000003908 quality control method Methods 0.000 description 1
- 238000007086 side reaction Methods 0.000 description 1
- 230000001988 toxicity Effects 0.000 description 1
- 231100000419 toxicity Toxicity 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/20—Image enhancement or restoration using local operators
- G06T5/30—Erosion or dilatation, e.g. thinning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20084—Artificial neural networks [ANN]
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Quality & Reliability (AREA)
- Image Analysis (AREA)
Abstract
The invention provides a method and a system for detecting the appearance quality of a Xuesaitong dropping pill, wherein the method comprises the following steps: acquiring a Xuesaitong dropping pill image, wherein the Xuesaitong dropping pill image comprises a plurality of Xuesaitong dropping pills which are distributed at intervals; carrying out image segmentation on the Xuesaitong pill image to obtain a binary image; extracting the outline of each dripping pill in the Xuesaitong dripping pill image; and judging the appearance quality of the dripping pill according to the contour characteristics of the Xuesaitong dripping pill. The method reduces the influence of noise, and improves the accuracy of the appearance quality detection of the Xuesaitong dropping pill.
Description
Technical Field
The invention belongs to the technical field of traditional Chinese medicine detection and quality control, and particularly relates to a method and a system for detecting the appearance quality of a Xuesaitong dropping pill.
Background
The Xuesaitong dripping pill is one kind of solid dispersion preparation with Xuesaitong tablet as the main component and has the features of fast dissolving speed, high bioavailability, high curative effect, simple preparation process, high stability, etc. The Xuesaitong dropping pill has the functions of promoting blood circulation to remove blood stasis and dredging collaterals and activating collaterals, and is clinically used for treating atherosclerosis, cardiovascular diseases and the like. The Xuesaitong dropping pill is a spherical solid dispersion preparation, the appearance characteristics and the quality of the Xuesaitong dropping pill are closely related, such as shape, size, color and the like, the accuracy of the appearance quality detection of the Xuesaitong dropping pill at present needs to be further improved, and the requirement of actual production cannot be well met.
Disclosure of Invention
The application provides a method and a system for detecting the appearance quality of a Xuesaitong dropping pill, which can reduce the influence of noise and improve the accuracy of detecting the appearance quality of the Xuesaitong dropping pill.
In a first aspect, the application provides a method for detecting the appearance quality of a Xuesaitong dropping pill, which comprises the following steps:
acquiring an image of the Xuesaitong dropping pill, wherein the image of the Xuesaitong dropping pill comprises a plurality of Xuesaitong dropping pills which are distributed at intervals;
carrying out image segmentation on the Xuesaitong dripping pill image to obtain a binary image;
extracting the outline of each dripping pill in the Xuesaitong dripping pill image;
and judging the appearance quality of the dripping pill according to the contour characteristics of the Xuesaitong dripping pill.
The method comprises the following steps of carrying out image segmentation on the Xuesaitong pill image to obtain a binary image, wherein the image segmentation comprises the following steps:
calculating a gray level histogram of the Xuesaitong dropping pill image;
calculating the variance C between the image classes and the entropy T of the whole dripping pill image;
calculating a target segmentation threshold t Target =argmax(lnC+T);
According to the target segmentation threshold t Target And carrying out image segmentation on the Xuesaitong pill image to obtain a binary image.
Wherein, according to the Otsu algorithm, the variance C between image classes is calculated by the following calculation formula:
wherein mG is the global mean value of the image, p1 is the probability that the pixel is classified into C1, and m is the accumulated mean value of the gray level K;
calculating the entropy T of the whole dripping pill image by the following calculation formula:
wherein i is the gray value of the pixel point, j is the neighborhood gray average, f (i, j) is the frequency of occurrence of the characteristic binary group (i, j), and N is the scale of the image.
The method comprises the following steps of carrying out image segmentation on a Xuesaitong dripping pill image, and obtaining a binary image: and carrying out corrosion and expansion treatment on the dripping pill image.
Wherein, extracting the outline of each dropping pill in the Xuesaitong dropping pill image comprises the following steps:
evenly dividing the divided binary image into n blocks, wherein n is the number of the dripping pills in the image, and the Xuesaitong dripping pills are uniformly distributed in the image;
calculating the area of the target area in each block, determining the target area with the largest area, and judging other target areas as noise areas;
deleting the noise area;
and extracting the outline of the target area based on the full convolution neural network model.
Wherein, according to the outline characteristics of the Xuesaitong dropping pill, the appearance quality of the dropping pill is judged, which comprises the following steps:
and after extracting the outline of each dripping pill, calculating the appearance parameters of the dripping pills, wherein the appearance parameters comprise the minimum circumscribed circle diameter, the maximum inscribed circle diameter and the roundness of each Xuesaitong dripping pill, and judging the appearance quality of the dripping pills according to the appearance parameters.
Wherein, still include: and selecting an interested area in the image by adopting a color space, and extracting effective color characteristics of the sample for judging the appearance quality of the dripping pill.
In a second aspect, the present application provides a detecting system for appearance quality of a xuesaitong dropping pill, comprising:
the acquiring unit is used for acquiring an image of the Xuesaitong dropping pill, wherein the image of the Xuesaitong dropping pill comprises a plurality of Xuesaitong dropping pills which are distributed at intervals;
a segmentation unit, configured to perform image segmentation on the xuesaitong pill image to obtain a binary image;
the extraction unit is used for extracting the outline of each dropping pill in the Xuesaitong dropping pill image;
and the judging unit is used for judging the appearance quality of the dripping pill according to the contour characteristics of the Xuesaitong dripping pill.
In a third aspect, the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of any of the methods described above.
In a fourth aspect, the present application provides a computer system comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of any of the methods described above when executing the program.
The method and the system for detecting the appearance quality of the Xuesaitong dropping pill have the following beneficial effects:
the method for detecting the appearance quality of the Xuesaitong dropping pill comprises the following steps: acquiring a Xuesaitong dropping pill image, wherein the Xuesaitong dropping pill image comprises a plurality of Xuesaitong dropping pills which are distributed at intervals; carrying out image segmentation on the Xuesaitong pill image to obtain a binary image; extracting the outline of each dripping pill in the Xuesaitong dripping pill image; and judging the appearance quality of the dripping pill according to the contour characteristics of the Xuesaitong dripping pill. The method reduces the influence of noise, and improves the accuracy of the appearance quality detection of the Xuesaitong dropping pill.
Drawings
Fig. 1 is a schematic flow chart of a method for detecting the appearance quality of a Xuesaitong dropping pill according to an embodiment of the present application;
FIG. 2 is another schematic flow chart illustrating a method for detecting the appearance quality of a Xuesaitong dropping pill according to an embodiment of the present application;
fig. 3 is another schematic flow chart illustrating a method for detecting the appearance quality of a Xuesaitong dropping pill according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an appearance quality detection system of a xuesaitong dropping pill according to an embodiment of the present application.
Detailed Description
The present application is further described below with reference to the drawings and examples.
The following description provides examples, and does not limit the scope, applicability, or examples set forth in the claims. Changes may be made in the function and arrangement of elements described without departing from the scope of the disclosure. Various examples may omit, substitute, or add various procedures or components as appropriate. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Furthermore, features described with respect to some examples may be combined into other examples.
The dripping pill is prepared by extracting, purifying, concentrating, mixing with proper matrix, heating, melting, mixing, dripping into immiscible condensate, and condensing to obtain spherical or quasi-spherical preparation. The dripping pill preparation has the advantages of good safety and small adverse reaction of the traditional Chinese medicine, and has three effects (high efficiency, quick effect and long effect), three small effects (toxicity, side reaction and small dosage) and five convenient effects (production, transportation, use, carrying and storage). The roundness of the dripping pill is one of the important indexes for evaluating the quality of the dripping pill. Roundness refers to the degree to which a Xuesaitong drop pill approaches a circle, and describes the shape of the material from a two-dimensional plane angle.
There are various methods for measuring roundness, for example: taking one dripping pill, measuring the radial length of the dripping pill in three different directions, and averaging. The proportion of the data farthest from the average value among the three radial lengths to the average radial length is the roundness, and the higher the roundness, the better. For example, the closer the aspect ratio AR to 1 indicates the better rounding of the pellets, the aspect ratio AR being the ratio of the longest diameter to the shortest diameter of the pellets.
Machine vision is applied more and more widely, and the machine vision is to replace human eyes with a machine for measurement and judgment. The machine vision system converts a shot object into an image signal through a machine vision product (namely, an image shooting device which is divided into a CMOS (complementary metal oxide semiconductor) product and a CCD (charge coupled device) product), and transmits the image signal to a special image processing system. The image processing system operates on the captured image to extract features of the object, such as area, number, position, length, etc. The machine vision is applied to the appearance quality detection of the Xuesaitong dropping pill, so that the detection efficiency can be improved, and the advantages of rapidness, accuracy, science, effectiveness, no damage and the like are achieved. When the machine vision is used for detecting the appearance quality of the Xuesaitong dropping pill, the outline of the dropping pill in an image needs to be extracted for the calculation of the roundness of the dropping pill and the size of the dropping pill.
As shown in fig. 1, the method for detecting the appearance quality of a Xuesaitong dropping pill comprises the following steps: s101, acquiring a Xuesaitong dropping pill image, wherein the Xuesaitong dropping pill image comprises a plurality of Xuesaitong dropping pills which are distributed at intervals; s103, carrying out image segmentation on the Xuesaitong pill image to obtain a binary image; s105, extracting the outline of each dripping pill in the Xuesaitong dripping pill image; s107, judging the appearance quality of the dripping pill according to the contour characteristics of the Xuesaitong dripping pill. Each step is described below.
S101, obtaining an image of the Xuesaitong dropping pill, wherein the image of the Xuesaitong dropping pill comprises a plurality of Xuesaitong dropping pills which are distributed at intervals.
The components used for acquiring the Xuesaitong pill image in the application comprise: the technical scheme includes that the device comprises a light source, an industrial camera, black light absorption cloth and a black background detection plate, wherein the industrial camera collects images of the Xuesaitong dropping pills and sends the collected images to a computer for processing. The industrial camera is a color-Charge-Coupled Device (CCD) video camera. The industrial camera may also be a CMOS (Complementary Metal-Oxide-Semiconductor) video camera. The industrial camera is MV-CA050-10GC from Hangzhou Hai Kangwei digital technology GmbH.
The detecting plate is rectangular, the Xuesaitong dropping pills are placed on the detecting plate, a plurality of placing grooves are formed in the detecting plate and are uniformly distributed on the detecting plate, and the placing grooves are used for enabling an operator to conveniently place the dropping pills on the detecting plate. The industrial camera acquires an image of the Xuesaitong dropping pill to be detected, namely an image of the detection plate, wherein the Xuesaitong dropping pill image comprises a plurality of Xuesaitong dropping pills which are uniformly distributed at intervals.
S103, carrying out image segmentation on the Xuesaitong pill image to obtain a binary image.
The method comprises the following steps: and S1031, calculating a gray histogram of the Xuesaitong pill image.
The gray histogram is a function of gray level distribution, and is a statistic of gray level distribution in an image. The gray histogram is to count the occurrence frequency of all pixels in the digital image according to the size of the gray value. A gray histogram is a function of gray level, which represents the number of pixels in an image having a certain gray level, reflecting the frequency of occurrence of a certain gray level in the image.
S1032, calculating the variance C between image classes and the entropy T of the whole dripping pill image.
The OTSU algorithm assumes that a threshold TH exists to divide all pixels of an image into two classes C1 (smaller than TH) and C2 (larger than TH), and then the respective mean values of the two classes of pixels are m1 and m2, and the global mean value of the image is mG. While the probability of a pixel being classified into C1 and C2 classes is p1, p2, respectively. It can be derived that:
p1*m1+p2*m2=mG p1+p2=1
according to the Otsu algorithm, the variance C between image classes is calculated by the following calculation:
where mG is the global mean of the image, p1 is the probability that the pixel is classified into class C1, and m is the cumulative mean of the gray level K.
The entropy of the image represents the average number of bits, in bits/pixel, of the set of image gray levels, and also describes the average amount of information of the image source. Entropy refers to the degree of disorder of the system, and the entropy of a well-focused image is greater than that of an image without clear focusing, so that the entropy can be used as a focusing evaluation criterion. The larger the entropy, the sharper the image.
Calculating the entropy T of the whole dripping pill image by the following calculation formula:
wherein i is the gray value of the pixel point, j is the neighborhood gray average, f (i, j) is the frequency of occurrence of the characteristic binary group (i, j), and N is the scale of the image.
In some embodiments, the entropy of the image may also be calculated by the Kapur algorithm.
S1033, calculating a target segmentation threshold t Target =argmax(lnC+T)。
The image segmentation means that an image is divided into a plurality of non-overlapping sub-regions, so that the features in the same sub-region have certain similarity, and the features of different sub-regions show obvious differences. The threshold-based segmentation method comprises the following steps: firstly, determining a proper threshold value T (the quality of threshold value selection is the key of success and failure of the method); then, a binary image is generated by using pixels equal to or larger than the threshold as an object or a background. The determination of the threshold value is important, in the present application, the threshold value t Target On one hand, the method integrates the variance C between image classes of the Otsu algorithm and the entropy of the images, makes up the defect of poor segmentation effect of the Otsu algorithm, and improves the accuracy of segmenting the Xuesaitong dropping pill images; on the other hand, when the segmentation effect is good, the OTSU algorithm and the Kapur algorithm have a logarithmic relationship, and the logarithms can enable the weights of the two algorithms to be comparable and can be used for operation.
S1034, dividing the threshold t according to the target Target And (4) carrying out image segmentation on the Xuesaitong dripping pill image to obtain a binary image.
In this application, pixels below the threshold in the drop pill image are set to black, while others are set to white. The thresholding image is actually a binary operation on a gray-scale image, and the basic principle is to judge whether an image pixel is 0 or 255 by using a set threshold value. The binarization of an image is divided into global binarization and local binarization, and the difference is whether a threshold value is unified in one image or not. Global binarization is used in this application.
In some embodiments, after the image segmentation is performed on the image of the Xuesaitong dropping pill, and a binary image is obtained, some salt and pepper noise may exist, so that after the image segmentation, the dropping pill image is subjected to erosion and expansion processing to remove scattered salt and pepper noise points. The erosion is to gradually erode the boundary part by approaching the boundary part inwards through a convolution kernel. The dilation is to gradually widen the boundary portion toward the outside by a convolution kernel. In practice, expansion is the reverse of corrosion.
S105, extracting the outline of each dripping pill in the Xuesaitong dripping pill image.
The method comprises the following steps: s1051, evenly dividing the divided binary image into n blocks, wherein n is the number of the dripping pills in the image, and the Xuesaitong dripping pills are uniformly distributed in the image; s1052, calculating the area of the target area in each block, determining the target area with the largest area, and judging other target areas as noise areas; s1053, deleting the noise area; s1054, extracting the contour of the target region based on the full convolution neural network model (FCN). In the application, the dropping pill images are equally divided into n blocks, each block of image comprises one dropping pill, the dropping pill is the largest target area in the block of image, and some noise areas exist, but the area of the noise areas is not too large, so that other target areas except the largest area are determined as the noise areas, the noise areas are deleted, the influence of noise is reduced, and the accuracy of detecting the appearance quality of the Xuesaitong dropping pill is improved.
S107, judging the appearance quality of the dripping pill according to the contour characteristics of the Xuesaitong dripping pill.
In this step, after the contour of each dropping pill is extracted, the appearance parameters of the dropping pill are calculated, the appearance parameters include the minimum circumscribed circle diameter, the maximum inscribed circle diameter, the roundness and the like of each Xuesaitong dropping pill, and the appearance quality of the dropping pill is judged according to the appearance parameters, for example, the higher the roundness of the dropping pill is, the better the appearance quality is.
In some embodiments, the present application further comprises: and selecting an interested area in the image by adopting a color space, and extracting effective color characteristics of the sample for judging the appearance quality of the dripping pill.
As shown in fig. 4, the present application further provides a quality detection system for the appearance of a xuesaitong dropping pill, comprising: an obtaining unit 201, configured to obtain an image of a xuesaitong dropping pill, where the image of the xuesaitong dropping pill includes a plurality of xuesaitong dropping pills, and the plurality of xuesaitong dropping pills are distributed at intervals; a segmentation unit 202, configured to perform image segmentation on the xuesaitong pill image to obtain a binarized image; an extracting unit 203 for extracting the outline of each drop pill in the image of the Xuesaitong drop pill; the judging unit 204 is configured to judge an appearance quality of the dripping pill according to a contour feature of the Xuesaitong dripping pill.
In the present application, the embodiment of the system for detecting the appearance quality of a xuesaitong dropping pill is basically similar to the embodiment of the method for detecting the appearance quality of a xuesaitong dropping pill, and reference is made to the introduction of the embodiment of the method for detecting the appearance quality of a xuesaitong dropping pill for related purposes.
The embodiment of the invention also provides a computer readable storage medium, on which a computer program is stored, and the program is executed by a processor to implement the steps of the method for detecting the appearance quality of the Xuesaitong dropping pill. The computer-readable storage medium may include, but is not limited to, any type of disk including floppy disks, optical disks, DVDs, CD-ROMs, microdrive, and magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, DRAMs, VRAMs, flash memory devices, magnetic or optical cards, nanosystems (including molecular memory ICs), or any type of media or device suitable for storing instructions and/or data.
The application also provides a computer system which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, and the steps of the method for detecting the appearance quality of the Xuesaitong dropping pill are realized when the processor executes the program.
The system embodiments described in this application are merely illustrative, for example, the division of the unit is only a logical function division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made to the present invention by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (10)
1. A method for detecting the appearance quality of a Xuesaitong dropping pill is characterized by comprising the following steps:
acquiring a Xuesaitong dropping pill image, wherein the Xuesaitong dropping pill image comprises a plurality of Xuesaitong dropping pills which are distributed at intervals;
carrying out image segmentation on the Xuesaitong dripping pill image to obtain a binary image;
extracting the outline of each dripping pill in the Xuesaitong dripping pill image;
and judging the appearance quality of the dripping pill according to the profile characteristics of the Xuesaitong dripping pill.
2. The method for detecting the appearance quality of the Xuesaitong dropping pill according to claim 1, wherein the image segmentation is performed on the Xuesaitong dropping pill image to obtain a binary image, and the method comprises the following steps:
calculating a gray level histogram of the Xuesaitong dropping pill image;
calculating the variance C between the image classes and the entropy T of the whole dripping pill image;
calculating a target segmentation threshold t Target =argmax(lnC+T);
According to a target segmentation threshold t Target And carrying out image segmentation on the Xuesaitong dripping pill image to obtain a binary image.
3. The method for detecting the appearance quality of the Xuesaitong dripping pill according to claim 2, wherein the variance C between image classes is calculated according to Otsu algorithm by the following calculation formula:
wherein mG is the global average value of the image, p1 is the probability of the pixel being classified into C1 class, and m is the accumulated average value of the gray level K;
calculating the entropy T of the whole dripping pill image by the following calculation formula:
wherein i is the gray value of the pixel point, j is the neighborhood gray average, f (i, j) is the frequency of occurrence of the characteristic binary group (i, j), and N is the scale of the image.
4. The method for detecting the appearance quality of the Xuesaitong dropping pill according to any one of claims 1 to 3, wherein the image segmentation is performed on the Xuesaitong dropping pill image, and after obtaining the binary image, the method further comprises: and carrying out corrosion and expansion treatment on the dripping pill image.
5. The method for detecting the appearance quality of the Xuesaitong dropping pill according to any one of claims 1 to 3, wherein the step of extracting the outline of each dropping pill in the Xuesaitong dropping pill image comprises the following steps:
evenly dividing the divided binary image into n blocks, wherein n is the number of the dripping pills in the image, and the Xuesaitong dripping pills are uniformly distributed in the image;
calculating the area of the target area in each block, determining the target area with the largest area, and judging other target areas as noise areas;
deleting the noise area;
and extracting the outline of the target area based on the full convolution neural network model.
6. The method for detecting the appearance quality of the Xuesaitong dripping pill according to any one of claims 1 to 3, wherein the step of judging the appearance quality of the dripping pill according to the contour characteristics of the Xuesaitong dripping pill comprises the following steps:
and after extracting the outline of each dripping pill, calculating the appearance parameters of the dripping pills, wherein the appearance parameters comprise the minimum circumscribed circle diameter, the maximum inscribed circle diameter and the roundness of each Xuesaitong dripping pill, and judging the appearance quality of the dripping pills according to the appearance parameters.
7. The method for detecting the appearance quality of the Xuesaitong dripping pill according to any one of claims 1 to 3, further comprising: and selecting an interested area in the image by adopting a color space, and extracting effective color characteristics of the sample for judging the appearance quality of the dripping pill.
8. A system for detecting appearance quality of a Xuesaitong dropping pill is characterized by comprising:
the acquiring unit is used for acquiring a Xuesaitong dropping pill image, wherein the Xuesaitong dropping pill image comprises a plurality of Xuesaitong dropping pills which are distributed at intervals;
the segmentation unit is used for carrying out image segmentation on the Xuesaitong dropping pill image to obtain a binary image;
the extraction unit is used for extracting the outline of each dropping pill in the Xuesaitong dropping pill image;
and the judging unit is used for judging the appearance quality of the dripping pill according to the contour characteristics of the Xuesaitong dripping pill.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
10. A computer system comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the method of any one of claims 1 to 7 when executing the program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211026911.2A CN115393318A (en) | 2022-08-25 | 2022-08-25 | Method and system for detecting appearance quality of Xuesaitong dropping pills |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211026911.2A CN115393318A (en) | 2022-08-25 | 2022-08-25 | Method and system for detecting appearance quality of Xuesaitong dropping pills |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115393318A true CN115393318A (en) | 2022-11-25 |
Family
ID=84121863
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211026911.2A Pending CN115393318A (en) | 2022-08-25 | 2022-08-25 | Method and system for detecting appearance quality of Xuesaitong dropping pills |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115393318A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116957509A (en) * | 2023-07-28 | 2023-10-27 | 山东益健药业有限公司 | Omeprazole enteric capsule core processing early warning system |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105784711A (en) * | 2014-12-25 | 2016-07-20 | 锐视(厦门)科技有限公司 | Cod liver oil soft capsule appearance defect visual detection method and device |
CN107084992A (en) * | 2017-04-20 | 2017-08-22 | 佛山市南海区广工大数控装备协同创新研究院 | A kind of capsule detection method and system based on machine vision |
CN108636830A (en) * | 2018-05-10 | 2018-10-12 | 苏州大学 | The method, apparatus and equipment of defective capsule detection sorting based on machine vision |
CN110570422A (en) * | 2019-09-18 | 2019-12-13 | 中国计量大学 | Capsule defect visual detection method based on matrix analysis |
CN112345534A (en) * | 2020-10-30 | 2021-02-09 | 上海电机学院 | Vision-based bubble plate particle defect detection method and system |
US20220148237A1 (en) * | 2020-05-28 | 2022-05-12 | Affiliated Hospital Of Jiangsu University | Clustering algorithm-based multi-parameter cumulative calculation method for lower limb vascular calcification indexes |
-
2022
- 2022-08-25 CN CN202211026911.2A patent/CN115393318A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105784711A (en) * | 2014-12-25 | 2016-07-20 | 锐视(厦门)科技有限公司 | Cod liver oil soft capsule appearance defect visual detection method and device |
CN107084992A (en) * | 2017-04-20 | 2017-08-22 | 佛山市南海区广工大数控装备协同创新研究院 | A kind of capsule detection method and system based on machine vision |
CN108636830A (en) * | 2018-05-10 | 2018-10-12 | 苏州大学 | The method, apparatus and equipment of defective capsule detection sorting based on machine vision |
CN110570422A (en) * | 2019-09-18 | 2019-12-13 | 中国计量大学 | Capsule defect visual detection method based on matrix analysis |
US20220148237A1 (en) * | 2020-05-28 | 2022-05-12 | Affiliated Hospital Of Jiangsu University | Clustering algorithm-based multi-parameter cumulative calculation method for lower limb vascular calcification indexes |
CN112345534A (en) * | 2020-10-30 | 2021-02-09 | 上海电机学院 | Vision-based bubble plate particle defect detection method and system |
Non-Patent Citations (3)
Title |
---|
李明: "滴丸缺陷检测剔除设备研究", 《中国优秀硕士学位论文全文数据库 工程科技Ⅱ辑(月刊)》, no. 06, pages 1 - 56 * |
石雨豪 等: "一种基于熵和聚类理论的图像阈值分割算法", 《计算机应用研究》, vol. 33, no. 07, pages 2231 - 2235 * |
肖超云 等: "基于Otsu准则及图像熵的阈值分割算法", 《计算机工程》, vol. 33, no. 14 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116957509A (en) * | 2023-07-28 | 2023-10-27 | 山东益健药业有限公司 | Omeprazole enteric capsule core processing early warning system |
CN116957509B (en) * | 2023-07-28 | 2024-04-26 | 山东益健药业有限公司 | Omeprazole enteric capsule core processing early warning system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Tajbakhsh et al. | Automatic polyp detection in colonoscopy videos using an ensemble of convolutional neural networks | |
Xiao et al. | End-to-end deep learning for person search | |
CN109636824B (en) | Multi-target counting method based on image recognition technology | |
CN113109368B (en) | Glass crack detection method, device, equipment and medium | |
Lalonde et al. | Detecting ground shadows in outdoor consumer photographs | |
Aminzadeh et al. | Automatic thresholding for defect detection by background histogram mode extents | |
WO2016161115A1 (en) | System and methods for automatic polyp detection using convolutional neural networks | |
US10079974B2 (en) | Image processing apparatus, method, and medium for extracting feature amount of image | |
JP2013196682A (en) | Group-of-people detection method and group-of-people detector | |
CN114998317B (en) | Lens occlusion detection method and device, camera device and storage medium | |
Khan et al. | Counting clustered cells using distance mapping | |
CN115393318A (en) | Method and system for detecting appearance quality of Xuesaitong dropping pills | |
CN111476804A (en) | Method, device and equipment for efficiently segmenting carrier roller image and storage medium | |
Muhimmah et al. | Automated cervical cell nuclei segmentation using morphological operation and watershed transformation | |
JP2020107290A (en) | Adhering matter detection device and adhering matter detection method | |
CN111523341A (en) | Binaryzation method and equipment for two-dimensional code image | |
WO2019242388A1 (en) | Obstacle recognition method for library robot based on depth image | |
Othman et al. | Road crack detection using adaptive multi resolution thresholding techniques | |
CN107832732B (en) | Lane line detection method based on treble traversal | |
TWI569766B (en) | A method for predicting saliva image recognition in female ovulation | |
CN113628155A (en) | Green ball particle size detection method and system of disc pelletizer | |
WO2020115480A1 (en) | Method and apparatus for determining temporal behaviour of an object | |
CN111815591B (en) | Lung nodule detection method based on CT image | |
WO2022088544A1 (en) | Following robot multi-target identification system and method based on coded thermal infrared marker | |
Saranya et al. | Lung cancer detection using SVM classification |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20221125 |