Method and device for automatically detecting medicine capsules containing earthworms and astragalus membranaceus

Automatic detection of drug capsule particles through image recognition technology and 3D scanning technology solves the problems of low efficiency and low accuracy of traditional manual detection, and achieves efficient and accurate detection of drug capsule particles.

CN120044037APending Publication Date: 2025-05-27济宁华能制药厂有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510335297.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-20
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

Traditional drug capsule detection methods rely on manual operation, are inefficient and easily affected by subjective factors, making it difficult to guarantee the accuracy and consistency of the test results.

Method used

Automatic detection is performed using image recognition technology and 3D scanning technology. Automatic detection is completed by extracting the appearance feature information of the drug capsule particles, including shape, size and color, and using a pre-trained screening model for initial screening and comparison.

Benefits of technology

It improves detection efficiency, reduces artificial errors, enhances detection accuracy and consistency, adapts to drug capsules of different shapes, sizes and colors, and improves product quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120044037A_ABST
    Figure CN120044037A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of medicine capsule particle detection, and discloses an automatic detection method and device for medicine capsule particles containing earthworms and radix astragali seu hedysari, and the method comprises the steps: carrying out the visual inspection of the image data of the medicine capsule particles through an image recognition technology when the medicine capsule particles containing earthworms and radix astragali seu hedysari are transmitted on a transmission platform, extracting appearance characteristic information of the medicine capsule granules; screening the appearance characteristic information of the medicine capsule granules according to a pre-trained medicine capsule granule screening model to obtain primarily screened medicine capsule granules meeting preset requirements; performing three-dimensional scanning on the primarily screened medicine capsule granules through a 3D scanning technology to obtain a three-dimensional image of the primarily screened medicine capsule granules; feature points of preset positions are extracted from the three-dimensional image of the primarily screened medicine capsule particles, and detection feature points of the primarily screened medicine capsule particles are obtained; and comparing the detection feature points of the primarily screened medicine capsule granules with corresponding feature points in a preset model library to obtain a detection result of the primarily screened medicine capsule granules, thereby completing automatic detection of the medicine capsule granules.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the technical field of drug capsule granule detection, and particularly to an automatic detection method and device for drug capsule granules containing earthworm and astragalus membranaceus. Background Art

[0002] With the continuous development of the pharmaceutical industry, the quality control of drugs has become particularly important. As a common drug dosage form, the quality of capsules is directly related to the medication safety of patients. The detection of drug capsule granules usually includes multiple aspects such as appearance inspection, weight measurement, and analysis of the content of the contents.

[0003] For the appearance inspection of drug capsule granules, traditional drug capsule granule detection methods mainly rely on manual operation, which is not only inefficient but also easily affected by subjective factors. Moreover, the efficiency and accuracy of manual visual inspection are affected by the skills and fatigue of the operators, making it difficult to ensure the accuracy and consistency of the detection results. Summary of the Invention

[0004] One or more embodiments of this specification provide an automatic detection method and device for drug capsule granules containing earthworm and astragalus membranaceus, which are used to solve the technical problems raised in the background art.

[0005] One or more embodiments of this specification adopt the following technical solutions:

[0006] An automatic detection method for drug capsule granules containing earthworm and astragalus membranaceus provided by one or more embodiments of this specification, the method includes:

[0007] When transporting drug capsule granules containing earthworm and astragalus membranaceus on a transport platform, visually inspect the image data of the drug capsule granules through image recognition technology, and extract the appearance feature information of the drug capsule granules, where the appearance feature information includes one or more of shape, size, and color;

[0008] Screen the appearance feature information of the drug capsule granules according to a pre-trained drug capsule granule screening model to obtain pre-screened drug capsule granules that meet the preset requirements;

[0009] Perform three-dimensional scanning on the pre-screened drug capsule granules through 3D scanning technology to obtain three-dimensional images of the pre-screened drug capsule granules;

[0010] Extract feature points at preset positions from the three-dimensional images of the pre-screened drug capsule granules to obtain detection feature points of the pre-screened drug capsule granules, where the feature points at the preset positions include one or more of two side vertices and edge points;

[0011] Compare the detected feature points of the preliminary screened drug capsule grains with the corresponding feature points in the preset model library to obtain the detection result of the preliminary screened drug capsule grains, so as to complete the automatic detection of the drug capsule grains.

[0012] It should be noted that through the above content, the embodiments of this specification have the following beneficial effects:

[0013] Improve detection efficiency: Traditional drug capsule grain detection methods rely on manual operation and have low efficiency. The automatic detection method can greatly improve the detection speed through machine vision and 3D scanning technology, meeting the needs of large-scale production.

[0014] Reduce human error: Manual detection is affected by the skills and fatigue of operators and is prone to errors. The automatic detection method reduces the influence of human factors through pre-trained models for screening and comparison, improving the accuracy and consistency of the detection results.

[0015] Enhance detection accuracy: Through image recognition technology and 3D scanning technology, the appearance features of drug capsule grains can be obtained more precisely, including shape, size, color, etc. These features are crucial for the quality control of drug capsule grains.

[0016] Strong adaptability: By using 3D scanning technology to obtain the three-dimensional image of the capsule grains and extracting feature points for comparison, the detection method can adapt to drug capsule grains of different shapes, sizes, and colors.

[0017] Furthermore, visually inspect the image data of the drug capsule grains containing earthworm and astragalus through image recognition technology, and extract the appearance feature information of the drug capsule grains, including:

[0018] Visually inspect the image data of the drug capsule grains through contour detection, and extract the shape of the drug capsule grains;

[0019] Visually inspect the image data of the drug capsule grains through edge detection, and extract the size of the drug capsule grains;

[0020] Visually inspect the image data of the drug capsule grains through color space conversion, and extract the color of the drug capsule grains.

[0021] It should be noted that through the above content, the embodiments of this specification have the following beneficial effects:

[0022] Shape analysis: Through contour detection, the shape of drug capsule grains can be accurately identified, which is crucial for ensuring that the geometric shape of the capsule grains meets the specification standards.

[0023] Size measurement: Through edge detection, the size of drug capsules can be accurately measured, which is very important for quality control because inconsistent sizes may affect the filling amount and release rate of the capsules.

[0024] Color recognition: Through color space conversion, the color information of drug capsules can be precisely extracted, which is very useful for checking the color consistency of the capsules, the presence of contamination, or abnormal color changes.

[0025] Improving product quality: By extracting the above-mentioned characteristic information, the quality of drug capsules can be monitored more effectively to ensure that the products meet the specified quality standards.

[0026] Furthermore, before the drug capsule screening model is trained based on a deep learning model and the appearance characteristic information of the drug capsules is screened according to the pre-trained drug capsule screening model to obtain the pre-screened drug capsules meeting the preset requirements, the method further includes:

[0027] Obtaining sample data, where the sample data includes image data of multiple drug capsules, and the image data of the multiple drug capsules includes image data of drug capsules meeting the preset appearance characteristic information and image data of drug capsules not meeting the preset appearance characteristic information;

[0028] Training an initial drug capsule screening model based on the sample data to obtain the drug capsule screening model.

[0029] It should be noted that through the above content, the embodiments of this specification have the following beneficial effects:

[0030] Diversity of sample data: By obtaining samples containing image data of drug capsules meeting and not meeting the preset requirements, the model can learn the differences between normal and abnormal samples, thereby improving the accuracy of screening.

[0031] Furthermore, the three-dimensional scanning of the pre-screened drug capsules by 3D scanning technology to obtain the three-dimensional image of the pre-screened drug capsules includes:

[0032] Based on the appearance characteristic information of the drug capsules and the transmission parameters of the transmission platform, adaptively setting 3D scanning parameters;

[0033] Performing three-dimensional scanning on the pre-screened drug capsules based on the 3D scanning parameters to obtain the three-dimensional image of the pre-screened drug capsules.

[0034] It should be noted that through the above content, the embodiments of this specification have the following beneficial effects:

[0035] Adaptive scanning parameters: According to the appearance feature information of the drug capsules and the transmission parameters of the transmission platform, the 3D scanning parameters are adaptively set to ensure that the scanning process is optimized according to the characteristics of different capsules.

[0036] Further, the adaptive setting of the 3D scanning parameters based on the appearance feature information of the drug capsules and the transmission parameters of the transmission platform includes:

[0037] Adaptive setting of the 3D scanning resolution based on the size of the drug capsules;

[0038] Adaptive setting of the 3D scanning angle, range and speed based on the transmission parameters of the transmission platform and the size of the drug capsules;

[0039] Adaptive setting of the intensity, angle and color of the 3D scanning light source according to the color of the drug capsules.

[0040] It should be noted that the embodiments of this specification have the following beneficial effects through the above content:

[0041] Optimizing the scanning resolution: Adaptive setting of the 3D scanning resolution according to the size of the drug capsules can ensure that the fine structure of the capsules is clearly shown in the scanned image, avoiding both resource waste caused by too high resolution and detail loss caused by too low resolution.

[0042] Improving the scanning efficiency: By considering the transmission parameters of the transmission platform and the size of the drug capsules, and adaptively setting the 3D scanning angle, range and speed, the scanning process can be optimized, reducing unnecessary scanning time and resource consumption.

[0043] Enhancing the scanning quality: According to the size of the drug capsules and the characteristics of the transmission platform, reasonably setting the scanning angle and range can ensure that the complete three-dimensional information of the capsules is scanned, improving the quality of the scanned image.

[0044] Adapting to different capsules: Since different drug capsules may have different sizes and shapes, the adaptive setting of parameters can adapt to the characteristics of various capsules, ensuring that accurate 3D scans can be obtained for all capsules.

[0045] Further, the detection feature points are the three-dimensional space coordinates of the preset positions, and the comparison of the detection feature points of the initially screened drug capsules with the corresponding feature points in the preset model library to obtain the detection result of the initially screened drug capsules includes:

[0046] Comparing the three-dimensional space coordinates of the preset positions of the initially screened drug capsules with the corresponding three-dimensional space coordinates in the preset model library to obtain the detection error of the preset positions;

[0047] Based on whether the detection error is within a preset error threshold, the detection result of the initially screened drug capsules is obtained.

[0048] It should be noted that through the above content, the embodiments of this specification have the following beneficial effects:

[0049] Precise quality control: By comparing the three-dimensional spatial coordinates of the preset positions of the drug capsules with the standard coordinates in the preset model library, precise control of the size and shape of the capsules can be achieved.

[0050] Standardized detection: The preset model library provides a standardized reference, ensuring that the detection of all capsules follows a unified standard, enhancing the consistency and repeatability of the detection.

[0051] Rapid detection: The automated comparison process greatly speeds up the detection speed, enabling the rapid processing of a large number of capsules and improving production efficiency.

[0052] Error identification: By calculating the detection error and comparing it with the preset error threshold, capsules that do not meet the standards can be quickly identified, reducing the flow of defective products into the market.

[0053] Furthermore, extracting the feature points of the preset positions from the three-dimensional image of the initially screened drug capsules to obtain the detection feature points of the initially screened drug capsules includes:

[0054] Identifying the edge information of the three-dimensional image of the initially screened drug capsules through an edge detection algorithm;

[0055] Based on the intersection points of two edge lines in the edge information, determining the two side vertices of the initially screened drug capsules;

[0056] Determining a plurality of preset regions based on the edge information, and respectively determining preset edge points in the plurality of preset regions.

[0057] It should be noted that through the above content, the embodiments of this specification have the following beneficial effects:

[0058] Improve detection accuracy: By identifying the edge information of the three-dimensional image through an edge detection algorithm, the contour of the capsule can be more precisely located, thereby improving the accuracy of the detection.

[0059] Automated processing: The automated feature point extraction process reduces manual intervention, improves the detection efficiency, and is suitable for automated detection on large-scale production lines.

[0060] Quick positioning: Determining the two side vertices of the capsule based on the intersection points of the edge lines is a fast and effective positioning method, which helps to speed up the detection speed.

[0061] Error reduction: By means of predefined preset regions and edge points, errors caused by image noise or illumination changes can be reduced, and the stability of detection results can be improved.

[0062] Furthermore, before automatically detecting the pharmaceutical capsule grains, the method further includes:

[0063] Identifying the text markings on the pharmaceutical capsule grains through OCR technology to obtain identification information;

[0064] Verifying whether the identification information conforms to the identification code set for the pharmaceutical capsule grains;

[0065] If it conforms, the pharmaceutical capsule grains pass the detection.

[0066] It should be noted that the embodiments of this specification have the following beneficial effects through the above content:

[0067] Improve detection efficiency: By automatically identifying text markings through OCR technology, a large number of pharmaceutical capsule grains can be processed quickly, significantly improving the detection speed, which is suitable for large-scale production environments.

[0068] Reduce manual intervention: The process of automatically identifying text markings reduces the need for manual inspection, reduces labor intensity, and also reduces the possibility of human errors.

[0069] Enhance accuracy: OCR technology can provide more accurate recognition results than manual work, especially in cases where the text markings are unclear or irregularly positioned.

[0070] Data consistency: Automatically identifying and verifying identification information can ensure that the identification information of all capsule grains conforms to the preset standards, thus ensuring data consistency and accuracy.

[0071] Furthermore, the method further includes:

[0072] Screening the appearance feature information of the pharmaceutical capsule grains according to a pre-trained pharmaceutical capsule grain screening model to obtain pharmaceutical capsule grains that do not meet the preset requirements, and determining the appearance feature information of the pharmaceutical capsule grains that do not meet the preset requirements;

[0073] Comparing the detection feature points of the initially screened pharmaceutical capsule grains with the corresponding feature points in the preset model library to obtain the pharmaceutical capsule grains that do not meet the preset model library among the initially screened pharmaceutical capsule grains, and determining the detection feature points of the pharmaceutical capsule grains that do not meet the preset model library;

[0074] Based on the appearance feature information of the pharmaceutical capsule grains that do not meet the preset requirements and the detection feature points of the pharmaceutical capsule grains that do not meet the preset model library, determine the production adjustment parameters of the pharmaceutical capsule grains.

[0075] It should be noted that, through the above content, the embodiments of this specification have the following beneficial effects:

[0076] Data-driven decision-making: By analyzing the appearance feature information and detecting feature points of the non-conforming capsule grains, the determination of production adjustment parameters is more scientific and accurate.

[0077] Continuous production optimization: Adjusting production parameters according to the screening results helps to continuously optimize the production process, reduce the defective rate, and improve product quality.

[0078] An automatic detection device for drug capsule grains containing earthworm and astragalus provided by one or more embodiments of this specification includes:

[0079] An appearance feature extraction unit, when transmitting drug capsule grains containing earthworm and astragalus on a transmission platform, visually inspects the image data of the drug capsule grains through image recognition technology, and extracts the appearance feature information of the drug capsule grains. The appearance feature information includes one or more of shape, size, and color;

[0080] A preliminary screening unit screens the appearance feature information of the drug capsule grains according to a pre-trained drug capsule grain screening model to obtain preliminary screened drug capsule grains that meet the preset requirements;

[0081] A three-dimensional scanning unit performs three-dimensional scanning on the preliminary screened drug capsule grains through 3D scanning technology to obtain three-dimensional images of the preliminary screened drug capsule grains;

[0082] A feature point extraction unit extracts feature points at preset positions from the three-dimensional images of the preliminary screened drug capsule grains to obtain detection feature points of the preliminary screened drug capsule grains. The feature points at the preset positions include one or more of two-side vertices and edge points;

[0083] A detection result unit compares the detection feature points of the preliminary screened drug capsule grains with the corresponding feature points in a preset model library to obtain the detection results of the preliminary screened drug capsule grains, so as to complete the automatic detection of the drug capsule grains.

[0084] The above at least one technical solution adopted by the embodiments of this specification can achieve the following beneficial effects:

[0085] Improve detection efficiency: Traditional drug capsule grain detection methods rely on manual operations and have low efficiency. While the automatic detection method can greatly improve the detection speed through machine vision and 3D scanning technology to meet the needs of large-scale production.

[0086] Reducing human error: Manual inspection is affected by the skills and fatigue of operators and is prone to errors. The automatic detection method screens and compares through a pre-trained model, reducing the influence of human factors and improving the accuracy and consistency of detection results.

[0087] Enhancing detection accuracy: Through image recognition technology and 3D scanning technology, the appearance features of drug capsules, including shape, size, and color, can be obtained more precisely. These features are crucial for the quality control of drug capsules.

[0088] Strong adaptability: By obtaining the three-dimensional image of the capsule through 3D scanning technology and extracting feature points for comparison, the detection method can adapt to drug capsules of different shapes, sizes, and colors. Description of the Drawings

[0089] In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in this specification. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings. In the drawings:

[0090] Figure 1 It is a schematic flowchart of an automatic detection method for drug capsules containing earthworm and astragalus provided by one or more embodiments of this specification;

[0091] Figure 2 It is a schematic structural diagram of an automatic detection device for drug capsules containing earthworm and astragalus provided by one or more embodiments of this specification. Detailed Embodiments

[0092] The embodiments of this specification provide an automatic detection method and device for drug capsules containing earthworm and astragalus.

[0093] In order to enable those skilled in the art to better understand the technical solutions in this specification, the following will clearly and completely describe the technical solutions in the embodiments of this specification in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only some embodiments of this specification, rather than all embodiments. Based on the embodiments of this specification, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of this specification.

[0094] Figure 1A schematic flowchart of an automatic detection method for a drug capsule containing earthworm and astragalus provided by one or more embodiments of this specification. This process can be executed by an automatic detection system for drug capsules containing earthworm and astragalus. Some input parameters or intermediate results in the process allow manual intervention and adjustment to help improve accuracy.

[0095] The method flow steps of the embodiments of this specification are as follows:

[0096] S101, when transporting drug capsules containing earthworm and astragalus on a transport platform, visually inspect the image data of the drug capsules through image recognition technology, and extract the appearance feature information of the drug capsules. The appearance feature information includes one or more of shape, size, and color.

[0097] In the embodiments of this specification, when visually inspecting the image data of drug capsules containing earthworm and astragalus through image recognition technology and extracting the appearance feature information of the drug capsules, the shape of the drug capsules can be extracted by contour detection of the image data of the drug capsules; the size of the drug capsules can be extracted by edge detection of the image data of the drug capsules; the color of the drug capsules can be extracted by color space conversion of the image data of the drug capsules.

[0098] It should be noted that the above transport platform can be a conveying system for carrying drug capsules, such as a conveyor belt. Image recognition technology can apply an image acquisition device for capturing images of drug capsules, such as a high-resolution camera. Place the drug capsules containing earthworm and astragalus on the transport platform, and capture images of the drug capsules in real time through the image acquisition device. Use a contour detection algorithm (such as the findContours function in the OpenCV library) to process the image data. Extract the shape features of the drug capsules, such as perimeter, area, circularity, etc. Apply an edge detection algorithm (such as Canny edge detection) to process the image. Extract the size features of the drug capsules, such as aspect ratio, diameter, etc. Convert the image from the RGB color space to a color space suitable for color analysis, such as HSV or Lab. Analyze the color features of the capsules, such as the main color, color distribution, color uniformity, etc.

[0099] It should be noted that through the above content, the embodiments of this specification have the following beneficial effects:

[0100] Shape analysis: Through contour detection, the shape of the drug capsules can be accurately identified, which is crucial for ensuring that the geometric shape of the capsules meets the specification standards.

[0101] Size measurement: Through edge detection, the size of drug capsules can be accurately measured, which is very important for quality control because inconsistent sizes may affect the filling amount and release rate of the capsules.

[0102] Color recognition: Through color space conversion, the color information of drug capsules can be accurately extracted, which is very useful for checking the color consistency of the capsules, the presence of contamination, or abnormal color changes.

[0103] Improve product quality: By extracting the above characteristic information, the quality of drug capsules can be monitored more effectively to ensure that the products meet the specified quality standards.

[0104] S102, Screen the appearance feature information of the drug capsules according to a pre-trained drug capsule screening model to obtain the initially screened drug capsules that meet the preset requirements.

[0105] In the embodiments of this specification, the drug capsule screening model can be trained based on a deep learning model. When training the drug capsule screening model, sample data can be obtained first. The sample data includes image data of multiple drug capsules, and the image data of the multiple drug capsules includes image data of drug capsules that meet the preset appearance feature information and image data of drug capsules that do not meet the preset appearance feature information; then, based on the sample data, an initial drug capsule screening model is trained to obtain the drug capsule screening model.

[0106] Regarding the training of the drug capsule screening model, the following specific implementation plan can be adopted:

[0107] Sample data collection: Collect a large amount of drug capsule image data, which should include two types of samples: drug capsule images that meet the preset appearance feature information and drug capsule images that do not meet the preset appearance feature information.

[0108] Data preprocessing: Preprocess the collected image data, including: removing noise in the images to improve the image quality; adjusting the image size to ensure that all images have a unified standard size; enhancing the contrast of the images to better extract features.

[0109] Feature extraction: Extract appearance feature information (shape, size, and color) from the preprocessed images.

[0110] Label assignment: Assign labels to each sample image according to whether the capsule meets the preset appearance feature information, and divide them into two categories: "meeting" and "not meeting".

[0111] Model selection: Select a deep learning model for training, such as a convolutional neural network (CNN), for extracting complex features.

[0112] Model training: Use the data after feature extraction and the corresponding labels to train the selected model. During the training process, cross-validation can be used to evaluate the performance of the model and adjust the hyperparameters.

[0113] Model evaluation: Use a part of the reserved test data set to evaluate the performance of the model. Metrics such as accuracy, recall, and F1-score can be used to evaluate the classification effect of the model.

[0114] It should be noted that the embodiments of this specification have the following beneficial effects through the above content:

[0115] Diversity of sample data: By obtaining samples containing image data of drug capsules that meet and do not meet the preset requirements, the model can learn the differences between normal and abnormal samples, thereby improving the accuracy of screening.

[0116] S103, perform three-dimensional scanning on the initially screened drug capsules through 3D scanning technology to obtain three-dimensional images of the initially screened drug capsules.

[0117] In the embodiments of this specification, the 3D scanning parameters can be adaptively set based on the appearance feature information of the drug capsules and the transmission parameters of the transmission platform; then, based on the 3D scanning parameters, three-dimensional scanning is performed on the initially screened drug capsules to obtain three-dimensional images of the initially screened drug capsules.

[0118] It should be noted that the embodiments of this specification have the following beneficial effects through the above content:

[0119] Adaptive scanning parameters: According to the appearance feature information of the drug capsules and the transmission parameters of the transmission platform, the 3D scanning parameters are adaptively set, ensuring that the scanning process is optimized according to the characteristics of different capsules.

[0120] Furthermore, when adaptively setting the 3D scanning parameters based on the appearance feature information of the drug capsules and the transmission parameters of the transmission platform, the 3D scanning resolution can be adaptively set based on the size of the drug capsules; the 3D scanning angle, range, and speed can be adaptively set based on the transmission parameters of the transmission platform and the size of the drug capsules; the intensity, angle, and color of the 3D scanning light source can be adaptively set according to the color of the drug capsules. By adaptively setting the 3D scanning parameters as described above, the initially screened drug capsules are placed on the transmission platform to ensure their uniform distribution within the scanning area. Sensors or vision systems can also be used to monitor the position of the capsules for dynamic adjustment during the scanning process.

[0121] It should be noted that the embodiments of this specification have the following beneficial effects through the above content:

[0122] Optimize the scanning resolution: Adaptive setting of the 3D scanning resolution according to the size of the drug capsule grains can ensure that the fine structures of the capsule grains are clearly presented in the scanned images, avoiding both resource waste caused by excessive resolution and detail loss caused by insufficient resolution.

[0123] Improve the scanning efficiency: By considering the transmission parameters of the transmission platform and the size of the drug capsule grains, adaptively setting the 3D scanning angle, range, and speed can optimize the scanning process and reduce unnecessary scanning time and resource consumption.

[0124] Enhance the scanning quality: According to the size of the drug capsule grains and the characteristics of the transmission platform, reasonably setting the scanning angle and range can ensure the acquisition of the complete three-dimensional information of the capsule grains and improve the quality of the scanned images.

[0125] Adapt to different capsule grains: Since different drug capsule grains may have different sizes and shapes, adaptively setting parameters can adapt to the characteristics of various capsule grains and ensure accurate 3D scanning of all capsule grains.

[0126] S104, extract the feature points at the preset positions from the three-dimensional image of the initially screened drug capsule grains to obtain the detection feature points of the initially screened drug capsule grains, and the feature points at the preset positions include one or more of the two side vertices and the edge points.

[0127] In the embodiments of this specification, the edge information of the three-dimensional image of the initially screened drug capsule grains can be identified through an edge detection algorithm; based on the intersection points of two edge lines in the edge information, determine the two side vertices of the initially screened drug capsule grains; determine multiple preset regions based on the edge information, and respectively determine the preset edge points in the multiple preset regions.

[0128] It should be noted that regarding the above content, the following specific implementation methods can be adopted:

[0129] Preprocessing of the three-dimensional image: Preprocess the three-dimensional image, including steps such as filtering and denoising, color correction, etc., to improve the image quality.

[0130] Edge detection: Use edge detection algorithms (such as Canny edge detection, Sobel operator, Laplacian operator, etc.) to perform edge detection on the preprocessed three-dimensional image. The purpose of edge detection is to identify the contours in the image, thereby extracting the edge information of the drug capsule grains.

[0131] Vertex recognition: Search for the intersection points of two edge lines in the edge information, and these intersection points usually correspond to the two side vertices of the drug capsule grains. Accurately determine these intersection points through geometric analysis or a machine learning model to ensure that they accurately represent the vertex positions of the capsule grains.

[0132] Preset area determination: Based on the geometric shape and size of the drug capsule, multiple preset areas are determined. These areas can be the surface of the capsule, specific parts, or sub-areas based on specific features. The preset areas can be circular, rectangular, polygonal, or other shapes, depending on the specific characteristics of the capsule.

[0133] Edge point determination: Within each preset area, preset edge points are determined. These points can be key points within the area, such as corner points, midpoints, or points at a specific distance. The process of determining edge points may involve searching for edge lines within the preset area and selecting points that meet specific conditions.

[0134] It should be noted that through the above content, the embodiments of this specification have the following beneficial effects:

[0135] Improve detection accuracy: By using an edge detection algorithm to identify the edge information of a 3D image, the contour of the capsule can be more accurately located, thereby improving the accuracy of detection.

[0136] Automated processing: The automated feature point extraction process reduces manual intervention and improves the efficiency of detection, making it suitable for automated detection in large-scale production lines.

[0137] Quick positioning: Determining the two side vertices of the capsule based on the intersection points of the edge lines is a fast and effective positioning method, which helps to speed up the detection speed.

[0138] Reduce errors: By predefined preset areas and edge points, errors caused by image noise or light changes can be reduced, improving the stability of the detection results.

[0139] S105, Compare the detected feature points of the preliminarily screened drug capsules with the corresponding feature points in the preset model library to obtain the detection result of the preliminarily screened drug capsules, so as to complete the automatic detection of the drug capsules.

[0140] In the embodiments of this specification, the detected feature points can be the three-dimensional space coordinates of the preset position. When comparing the detected feature points of the preliminarily screened drug capsules with the corresponding feature points in the preset model library to obtain the detection result of the preliminarily screened drug capsules, the three-dimensional space coordinates of the preset position of the preliminarily screened drug capsules can be compared with the corresponding three-dimensional space coordinates in the preset model library to obtain the detection error of the preset position; based on whether the detection error is within the preset error threshold, the detection result of the preliminarily screened drug capsules is obtained.

[0141] It should be noted that the detection feature points of the initially screened drug capsules can be obtained through the above methods, and a preset model library can be prepared, which contains three-dimensional models of different types or specifications of drug capsules. For each model, the corresponding feature points are marked, and the three-dimensional spatial coordinates of these feature points are recorded. For the detection results of the initially screened drug capsules obtained above, the following specific implementation schemes can be adopted:

[0142] Feature point comparison: Compare the detection feature points of the initially screened drug capsules with the corresponding feature points in the preset model library. The comparison process involves calculating the difference in three-dimensional spatial coordinates between the two feature points.

[0143] Detection error calculation: For each pair of compared feature points, calculate the difference in their three-dimensional spatial coordinates to obtain the detection error.

[0144] Error threshold setting: Set a preset error threshold according to the manufacturing tolerance and quality standards of the capsules.

[0145] Detection result determination: Based on whether the detection error is within the preset error threshold, obtain the detection result of the initially screened drug capsules. If the detection error is less than or equal to the preset error threshold, it is considered that the initially screened drug capsules meet the quality standards. If the detection error is greater than the preset error threshold, it is considered that the initially screened drug capsules do not meet the quality standards.

[0146] It should be noted that through the above content, the embodiments of this specification have the following beneficial effects:

[0147] Precise quality control: By comparing the three-dimensional spatial coordinates of the preset positions of the drug capsules with the standard coordinates in the preset model library, precise control of the size and shape of the capsules can be achieved.

[0148] Standardized detection: The preset model library provides a standardized reference, ensuring that the detection of all capsules follows a unified standard, enhancing the consistency and repeatability of the detection.

[0149] Rapid detection: The automated comparison process greatly speeds up the detection speed, enabling rapid processing of a large number of capsules and improving production efficiency.

[0150] Error identification: By calculating the detection error and comparing it with the preset error threshold, capsules that do not meet the standards can be quickly identified, reducing the flow of defective products into the market.

[0151] Furthermore, before completing the automatic detection of the drug capsules, the text identification on the drug capsules can also be recognized through OCR technology to obtain the identification information; verify whether the identification information conforms to the identification code set for the drug capsules; if it conforms, the drug capsules pass the detection; if it does not conform, the drug capsules do not pass the detection.

[0152] It should be noted that through the above content, the embodiments of this specification have the following beneficial effects:

[0153] Improve detection efficiency: By automatically identifying text markings through OCR technology, a large number of drug capsules can be processed quickly, significantly improving the detection speed, which is suitable for large-scale production environments.

[0154] Reduce manual intervention: The process of automatically identifying text markings reduces the need for manual inspection, lowers the labor intensity, and also reduces the possibility of human errors.

[0155] Enhance accuracy: OCR technology can provide more accurate recognition results than manual work, especially in cases where the text markings are unclear or the positions are irregular.

[0156] Data consistency: Automatically identifying and verifying marking information can ensure that the marking information of all capsules meets the preset standards, thus guaranteeing data consistency and accuracy.

[0157] Furthermore, the embodiments of this specification can also screen the appearance feature information of the drug capsules according to a pre-trained drug capsule screening model, obtain the drug capsules that do not meet the preset requirements, and determine the appearance feature information of the drug capsules that do not meet the preset requirements; compare the detection feature points of the initially screened drug capsules with the corresponding feature points in the preset model library, obtain the drug capsules in the initially screened drug capsules that do not meet the preset model library, and determine the detection feature points of the drug capsules that do not meet the preset model library; finally, based on the appearance feature information of the drug capsules that do not meet the preset requirements and the detection feature points of the drug capsules that do not meet the preset model library, determine the production adjustment parameters of the drug capsules.

[0158] It should be noted that when determining the appearance feature information of the drug capsules that do not meet the preset requirements, the relevant technical features of S102 above can be combined; when determining the detection feature points of the drug capsules that do not meet the preset model library, the relevant technical features of S105 above can be combined. Combine the appearance feature information of the drug capsules that do not meet the preset requirements and the detection feature points of the drug capsules that do not meet the preset model library, analyze the reasons for the capsules not meeting the preset requirements, and obtain the analysis results. According to the analysis results, determine the production parameters that need to be adjusted, such as filling amount, pressing pressure, drying temperature, etc. According to the determined adjustment parameters, make corresponding adjustments to the production line. After adjustment, re-detect the appearance feature information and detection feature points to verify the adjustment effect.

[0159] It should be noted that through the above content, the embodiments of this specification have the following beneficial effects:

[0160] Data-driven decision-making: By analyzing the appearance feature information and detecting feature points of non-compliant capsule grains, the determination of production adjustment parameters is more scientific and accurate.

[0161] Continuous production optimization: Adjusting production parameters according to the screening results helps to continuously optimize the production process, reduce the defective rate, and improve product quality.

[0162] Figure 2 A schematic structural diagram of an automatic detection device for a medicinal capsule grain containing earthworm and astragalus provided for one or more embodiments of this specification, including: an appearance feature extraction unit 201, a preliminary screening unit 202, a three-dimensional scanning unit 203, a feature point extraction unit 204, and a detection result unit 205.

[0163] The appearance feature extraction unit 201, when transporting the medicinal capsule grains containing earthworm and astragalus on the transport platform, visually inspects the image data of the medicinal capsule grains through image recognition technology, and extracts the appearance feature information of the medicinal capsule grains. The appearance feature information includes one or more of shape, size, and color;

[0164] The preliminary screening unit 202 screens the appearance feature information of the medicinal capsule grains according to a pre-trained medicinal capsule grain screening model to obtain preliminary screened medicinal capsule grains that meet the preset requirements;

[0165] The three-dimensional scanning unit 203 performs three-dimensional scanning on the preliminary screened medicinal capsule grains through 3D scanning technology to obtain three-dimensional images of the preliminary screened medicinal capsule grains;

[0166] The feature point extraction unit 204 extracts feature points at preset positions from the three-dimensional images of the preliminary screened medicinal capsule grains to obtain the detection feature points of the preliminary screened medicinal capsule grains. The feature points at the preset positions include one or more of two-side vertices and edge points;

[0167] The detection result unit 205 compares the detection feature points of the preliminary screened medicinal capsule grains with the corresponding feature points in the preset model library to obtain the detection results of the preliminary screened medicinal capsule grains, so as to complete the automatic detection of the medicinal capsule grains.

[0168] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment.

[0169] Those of ordinary skill in the art will realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. A professional technician can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0170] In the embodiments provided in this application, it should be understood that the disclosed device / network device and method can be implemented in other ways. For example, the device / network device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical or other forms.

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

[0172] In addition, the functional units in each embodiment of this application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above units can be implemented in the form of hardware or software.

[0173] When the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the above-described embodiment methods of this application, it can also be completed by a computer program instructing relevant hardware. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-described various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content included in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.

[0174] The above-described embodiments are only used to illustrate the technical solutions of this application, rather than to limit them; although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the various embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. An automatic detection method for drug capsules containing earthworms and astragalus, characterized in that: include: When transmitting the drug capsules containing earthworms and astragalus on the transmission platform, visually inspecting the image data of the drug capsules by image recognition technology to extract appearance feature information of the drug capsules, wherein the appearance feature information includes one or more of shape, size and color; Screening the appearance feature information of the drug capsules according to a pre-trained drug capsule screening model to obtain pre-screened drug capsules that meet preset requirements; Performing a three-dimensional scan on the initially screened drug capsules by using a 3D scanning technology to obtain a three-dimensional image of the initially screened drug capsules; Extracting feature points at preset positions from the three-dimensional image of the primary screening drug capsule particles to obtain detection feature points of the primary screening drug capsule particles, wherein the feature points at the preset positions include one or more of two side vertices and edge points; The detection feature points of the primary screening drug capsule particles are compared with the corresponding feature points in the preset model library to obtain the detection results of the primary screening drug capsule particles, so as to complete the automatic detection of the drug capsule particles.

2. The method according to claim 1, characterized in that The method of visually inspecting the image data of the drug capsule containing earthworm and astragalus by image recognition technology to extract appearance feature information of the drug capsule includes: Visually inspect the image data of the drug capsule particles by contour detection to extract the shape of the drug capsule particles; Visually inspect the image data of the drug capsule particles by edge detection to extract the size of the drug capsule particles; The image data of the drug capsules are visually inspected by color space conversion to extract the color of the drug capsules.

3. The method according to claim 1, characterized in that The drug capsule screening model is trained based on a deep learning model, and before the appearance feature information of the drug capsule is screened according to the pre-trained drug capsule screening model to obtain the primary screening drug capsules that meet the preset requirements, the method further includes: Acquire sample data, wherein the sample data includes image data of a plurality of drug capsules, wherein the image data of the plurality of drug capsules includes image data of drug capsules that meet preset appearance feature information and image data of drug capsules that do not meet preset appearance feature information; An initial drug capsule screening model is trained based on the sample data to obtain the drug capsule screening model through training.

4. The method according to claim 1, characterized in that: The method of performing three-dimensional scanning on the initially screened drug capsule particles by using 3D scanning technology to obtain a three-dimensional image of the initially screened drug capsule particles includes: Adaptively setting 3D scanning parameters based on the appearance feature information of the drug capsule and the transmission parameters of the transmission platform; The primary screening drug capsule particles are three-dimensionally scanned based on the 3D scanning parameters to obtain a three-dimensional image of the primary screening drug capsule particles.

5. The method according to claim 4, characterized in that The method of adaptively setting 3D scanning parameters based on the appearance feature information of the drug capsule and the transmission parameters of the transmission platform includes: Adaptively setting the 3D scanning resolution based on the size of the drug capsule particles; Based on the transmission parameters of the transmission platform and the size of the drug capsule particles, the 3D scanning angle, range and speed are adaptively set; The intensity, angle and color of the 3D scanning light source are adaptively set according to the color of the drug capsule particles.

6. The method according to claim 1, characterized in that The step of extracting feature points at preset positions from the three-dimensional image of the primary screening drug capsule particles to obtain detection feature points of the primary screening drug capsule particles includes: Identifying edge information of the three-dimensional image of the primary screening drug capsules by an edge detection algorithm; Determine the vertices on both sides of the primary screening drug capsule based on the intersection of two edge lines in the edge information; A plurality of preset areas are determined based on the edge information, and preset edge points are respectively determined in the plurality of preset areas.

7. The method according to claim 1, characterized in that The detection feature point is the three-dimensional space coordinate of the preset position, and the detection feature point of the primary screening drug capsule is compared with the corresponding feature point in the preset model library to obtain the detection result of the primary screening drug capsule, including: Comparing the three-dimensional spatial coordinates of the preset position of the primary screening drug capsule with the corresponding three-dimensional spatial coordinates in the preset model library to obtain a detection error of the preset position; Based on whether the detection error is within a preset error threshold, the detection result of the primary screening drug capsule particles is obtained.

8. The method according to claim 1, characterized in that Before completing the automatic detection of the drug capsules, the method further comprises: Recognize the textual identification on the drug capsule by using OCR technology to obtain identification information; Verifying whether the identification information matches the identification code set for the drug capsule; If so, the drug capsule passes the test.

9. The method according to claim 1, characterized in that: The method further comprises: Screening the appearance feature information of the drug capsule particles according to a pre-trained drug capsule particle screening model to obtain drug capsule particles that do not meet the preset requirements, and determining the appearance feature information of the drug capsule particles that do not meet the preset requirements; Comparing the detection feature points of the pre-screened drug capsules with corresponding feature points in a preset model library, obtaining drug capsules in the pre-screened drug capsules that do not conform to the preset model library, and determining the detection feature points of the drug capsules that do not conform to the preset model library; Based on the appearance feature information of the drug capsule particles that do not meet the preset requirements and the detection feature points of the drug capsule particles that do not meet the preset model library, the production adjustment parameters of the drug capsule particles are determined.

10. An automatic detection device for drug capsules containing earthworms and astragalus, characterized in that: include: an appearance feature extraction unit, which, when transmitting the drug capsules containing earthworms and astragalus on the transmission platform, visually inspects the image data of the drug capsules by image recognition technology, and extracts appearance feature information of the drug capsules, wherein the appearance feature information includes one or more of shape, size and color; A primary screening unit, screening the appearance feature information of the drug capsules according to a pre-trained drug capsule screening model to obtain primary screening drug capsules that meet preset requirements; A three-dimensional scanning unit is used to perform three-dimensional scanning on the initially screened drug capsule particles by using a 3D scanning technology to obtain a three-dimensional image of the initially screened drug capsule particles; A feature point extraction unit extracts feature points at preset positions from the three-dimensional image of the primary screening drug capsule particles to obtain detection feature points of the primary screening drug capsule particles, wherein the feature points at the preset positions include one or more of two side vertices and edge points; The detection result unit compares the detection feature points of the initially screened drug capsules with the corresponding feature points in the preset model library to obtain the detection results of the initially screened drug capsules to complete the automatic detection of the drug capsules.