A drug identification method and device for intelligent hardware

Through intelligent hardware, the use of drug recognition methods in medical environments, and the matching of local image feature information, the problem of inaccurate drug recognition is solved, and the accuracy and safety of drug management are improved.

CN118823751BActive Publication Date: 2025-03-18SHENZHEN RUIHAO TECH SERVICE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410911113.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-09
Publication Date
2025-03-18
Estimated Expiration
2044-07-09

AI Technical Summary

Technical Problem

There are many types of medicines in modern medical environments, and the appearance, name and uses of drugs are similar, which increases the risks of medical staff in the identification and use of drugs, resulting in the possibility of inaccurate identification and incorrect use.

Method used

Using the drug recognition method of smart hardware, by obtaining prescription information and matching standard drug images, multiple first local images are extracted in the preset area of ​​the current drug image, feature information is extracted based on the grayscale distribution, and the similarity between the local image feature information is calculated to determine the consistency of the drug.

Benefits of technology

It improves the accuracy of drug identification, reduces the possibility of misidentification, ensures the accuracy and safety of drug management, realizes the high automation of drug identification process, and reduces the risk of human error.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118823751B_ABST
    Figure CN118823751B_ABST
Patent Text Reader

Abstract

The present invention is applicable to the technical field of image recognition, and provides a drug recognition method and device for intelligent hardware, wherein the drug recognition method for intelligent hardware includes: obtaining prescription information, and matching the standard drug image corresponding to the target drug in the prescription information; collecting the current drug image of the current drug, and extracting multiple first partial images in a preset area of ​​the current drug image; extracting the first feature information in the first partial image according to the grayscale distribution in each first partial image; extracting the second feature information in the second partial image in the standard drug image; calculating the total similarity according to the multiple target similarities corresponding to each of the multiple first partial images; if the total similarity is greater than the first threshold, it is determined that the current drug is consistent with the target drug. The present invention significantly improves the efficiency and accuracy of drug management through image processing and feature matching technology, and provides an efficient and reliable drug recognition solution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image recognition, and in particular relates to a drug recognition method and device for intelligent hardware. Background Art

[0002] Medical drug safety is a key link in hospital work. The correct use of drugs is not only related to the patient's recovery, but also directly affects their life safety. Doctors and nurses, as front-line medical workers, must accurately identify and use various drugs. However, in the modern medical environment, there are many types of drugs, and the appearance, name and use of drugs may be very similar, which increases the risk in the identification and use process.

[0003] With the development of medical technology, the types and quantity of drugs on the market continue to increase. The packaging, color, shape and label of different drugs are sometimes almost the same, which poses a huge challenge to the identification ability of medical staff. Quickly and accurately identifying drugs has become a necessary condition for improving treatment efficiency and ensuring patient safety. Therefore, how to use modern technical means to ensure that doctors and nurses can manage drugs more efficiently is a technical problem that needs to be solved urgently. Summary of the invention

[0004] In view of this, an embodiment of the present invention provides a drug identification method and device of intelligent hardware to solve the technical problem of how to use modern technical means to ensure that doctors and nurses can manage drugs more efficiently.

[0005] A first aspect of an embodiment of the present invention provides a drug identification method of smart hardware, the drug identification method of smart hardware comprising:

[0006] Obtaining prescription information and matching a standard drug image corresponding to a target drug in the prescription information;

[0007] Acquire a current drug image of a current drug, and extract a plurality of first partial images in a preset area of ​​the current drug image;

[0008] Extracting first feature information in the first partial images according to the grayscale distribution in each of the first partial images;

[0009] Extracting second feature information from a second partial image in the standard drug image;

[0010] Calculating target similarity between first feature information in the first partial image and second feature information in the second partial image;

[0011] Calculating a total similarity based on a plurality of target similarities corresponding to each of the plurality of first partial images;

[0012] If the total similarity is greater than a first threshold, it is determined that the current drug is consistent with the target drug.

[0013] Furthermore, after the step of determining that the current drug is consistent with the target drug if the total similarity is greater than a threshold, the method further includes:

[0014] Obtain medication information corresponding to the target drug in the prescription information, and play the medication information through the voice broadcast module; the medication information includes the patient's name, drug dosage and precautions.

[0015] Furthermore, the step of extracting first feature information in the first partial images according to the grayscale distribution in each of the first partial images includes:

[0016] Traversing each current pixel point in the first partial image, and acquiring neighboring pixel points for each current pixel point; the neighboring pixel points refer to pixel points within a preset pixel area; the preset pixel area refers to a rectangular area of ​​a fixed size formed with the current pixel point as the midpoint;

[0017] Multiplying the first grayscale value of the current pixel by a preset coefficient to obtain a second threshold value; the second threshold value is greater than the first grayscale value of the current pixel point;

[0018] Matching the number of pixels whose second grayscale value is greater than the second threshold and is continuous among the neighborhood pixels;

[0019] If the number of pixels is greater than a preset number, the current pixel is used as a feature pixel;

[0020] Calculating the distance between the feature pixel point and four vertices of the first partial image;

[0021] Calculating the ratio of the grayscale value between the feature pixel point and a plurality of the neighborhood pixel points;

[0022] The ratio of the grayscale values, the distances between the four vertices and the number of pixels are constructed into a feature vector, and the feature vector is used as the first feature information.

[0023] Furthermore, the step of acquiring a current drug image of a current drug and extracting a plurality of first partial images in a preset area of ​​the current drug image includes:

[0024] Collect the original image of the current drug;

[0025] Extracting target pixel points in the original image that are outside a preset grayscale range; the preset grayscale range is used to characterize the grayscale value corresponding to the placement platform;

[0026] Extracting the pixel area where the target pixel point is located, performing straight line fitting on the edge of the pixel area to obtain a quadrilateral area;

[0027] Performing rectangular correction on the quadrilateral area to obtain a rectangular area;

[0028] Extracting a medicine image corresponding to the rectangular area in the original image;

[0029] A plurality of first partial images are extracted from a preset area in the drug image; the preset area includes image areas located at four vertices and an image area located at a central position.

[0030] Further, the step of calculating the target similarity between the first feature information in the first partial image and the second feature information in the second partial image includes:

[0031] According to the size of the first partial image or the second partial image, dividing the image into a plurality of grid image areas;

[0032] intercepting a first sub-image corresponding to a plurality of grid image regions in the first partial image;

[0033] intercepting a second sub-image corresponding to a plurality of grid image regions in the second partial image;

[0034] Extracting a plurality of current first feature information and a plurality of current second feature information corresponding to a first sub-image and a second sub-image in the same grid image area;

[0035] The similarities between each of the current first feature information and the multiple current second feature information are calculated respectively, and the maximum similarity is used as the target similarity of the current first feature information.

[0036] Furthermore, the step of calculating the total similarity according to the multiple target similarities corresponding to the multiple first partial images comprises:

[0037] The average value of the multiple target similarities is taken as the total similarity.

[0038] Furthermore, if the number of pixels is greater than a preset number, the step of taking the current pixel as a feature pixel includes:

[0039] If the number of pixels is greater than a preset number, calculating a first gradient and a second gradient of the pixels in the preset pixel area in the X-axis direction and the Y-axis direction;

[0040] Calculating an autocorrelation matrix of a preset pixel area according to the first gradient and the second gradient;

[0041] Substituting the autocorrelation matrix into a preset function to calculate the intensity of grayscale change;

[0042] The preset function is:

[0043]

[0044] Among them, R represents the intensity of grayscale change, det(M) represents the determinant of the autocorrelation matrix, M represents the autocorrelation matrix, trace(M) represents the trace of the autocorrelation matrix, ∈ represents the constant term, α represents the nonlinear adjustment parameter, and β represents the adaptive parameter.

[0045] A second aspect of an embodiment of the present invention provides a drug identification device of intelligent hardware, comprising:

[0046] An acquisition unit, used to acquire prescription information and match a standard drug image corresponding to a target drug in the prescription information;

[0047] A collection unit, used to collect a current drug image of a current drug, and extract a plurality of first partial images in a preset area of ​​the current drug image;

[0048] A first extraction unit, configured to extract first feature information in each of the first partial images according to the grayscale distribution in the first partial images;

[0049] A second extraction unit, used to extract second feature information from a second partial image in the standard drug image;

[0050] A first calculation unit, configured to calculate a target similarity between first feature information in the first partial image and second feature information in the second partial image;

[0051] A second calculation unit, configured to calculate a total similarity according to a plurality of target similarities corresponding to each of the plurality of first partial images;

[0052] A determination unit is used to determine that the current drug is consistent with the target drug if the total similarity is greater than a first threshold.

[0053] A third aspect of an embodiment of the present invention provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in the first aspect when executing the computer program.

[0054] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.

[0055] Compared with the prior art, the embodiments of the present invention have the following beneficial effects: by obtaining prescription information and matching the standard drug image, extracting multiple first partial images in the preset area of ​​the current drug image, and extracting feature information according to the grayscale distribution, the present invention can accurately capture the detailed features of each partial image, thereby improving the accuracy of drug identification. By calculating the target similarity between the first feature information in the first partial image and the second feature information of the second partial image in the standard drug image, and further calculating the total similarity, by setting the first threshold of the total similarity, it is possible to effectively distinguish whether the current drug is consistent with the target drug, thereby reducing the possibility of misidentification and ensuring the accuracy and safety of drug management. The method of the present invention can achieve high automation in the drug identification process, reduce the workload of doctors and nurses, reduce the risk of human errors, and improve the intelligent level of overall drug management in the hospital. The method of the present invention is applicable to drugs of different types and specifications, and can be widely used in various medical environments through flexible image matching and feature extraction strategies to meet different drug management needs. In summary, the present invention significantly improves the efficiency and accuracy of drug management through image processing and feature matching technology, and provides an efficient and reliable drug identification solution. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0057] Figure 1 A schematic flow chart of a drug identification method of intelligent hardware provided by the present invention is shown;

[0058] Figure 2 A schematic diagram of a smart hardware drug identification device provided by an embodiment of the present invention is shown;

[0059] Figure 3 A schematic diagram of a terminal device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0060] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.

[0061] The embodiments of the present invention provide a drug identification method and device of intelligent hardware to solve the technical problem of how to ensure that doctors and nurses can manage drugs more efficiently with the help of modern technical means.

[0062] First, the present invention provides a drug identification method for intelligent hardware. Figure 1 , Figure 1 FIG. 1 is a schematic flow chart of a drug identification method of intelligent hardware provided by the present invention. Figure 1 As shown, the drug identification method of the smart hardware may include the following steps:

[0063] Step 101: Obtain prescription information, and match a standard drug image corresponding to a target drug in the prescription information;

[0064] Prescription information refers to the electronic prescription issued by a physician. The information in the electronic prescription includes but is not limited to the drug name, quantity, patient name, and precautions.

[0065] For each drug, a corresponding standard drug image is pre-stored for subsequent drug identification and matching.

[0066] Step 102: acquiring a current drug image of a current drug, and extracting a plurality of first partial images in a preset area of ​​the current drug image;

[0067] The drug identification method of the present invention is applied to intelligent hardware, and the intelligent hardware includes units such as a storage platform, a camera, a voice playback module, a communication module, and a processor.

[0068] When the doctor issues an electronic prescription, it is sent to the smart hardware through the IoT system. The medical staff prepares the corresponding medicine according to the electronic prescription and identifies and confirms the corresponding medicine through the smart hardware. When the medical staff places the current medicine on the storage platform, the camera captures the current medicine image and identifies the current medicine through the processor.

[0069] In order to reduce unnecessary calculation amount, the present invention extracts multiple first partial images in the preset area of ​​the current drug image, and then performs drug identification based on the multiple first partial images, without processing the entire current drug image. Among them, the preset area includes but is not limited to the upper left corner area, the lower left corner area, the upper right corner area, the lower right corner area and the middle area. The number of preset areas can be single or multiple, which is not limited here. In order to reduce the amount of calculation while ensuring accuracy, the present invention uses the upper left corner area, the lower left corner area, the upper right corner area, the lower right corner area and the middle area as preset areas.

[0070] Specifically, step 102 specifically includes steps 1021 to 1026:

[0071] Step 1021: Acquire the original image of the current drug;

[0072] Step 1022: extracting target pixel points in the original image that are outside a preset grayscale range; the preset grayscale range is used to characterize the grayscale value corresponding to the placement platform;

[0073] Since there is a large difference between the pixel grayscale of the storage platform and the pixel grayscale of the medicine surface, the present invention filters out the pixel points of the storage platform by extracting target pixel points (ie, pixel points on the medicine surface) outside the preset grayscale range.

[0074] Step 1023: extracting the pixel region where the target pixel point is located, performing straight line fitting on the edge of the pixel region to obtain a quadrilateral region;

[0075] Step 1024: performing rectangular correction on the quadrilateral area to obtain a rectangular area;

[0076] Step 1025: extracting the drug image corresponding to the rectangular area from the original image;

[0077] Step 1026: extract multiple first partial images in a preset area in the drug image; the preset area includes image areas located at four vertices and an image area located at a central position.

[0078] In this embodiment, by extracting the target pixel points outside the preset grayscale range in the original image, the area where the medicine is located can be accurately identified. The preset grayscale range represents the grayscale value of the storage platform, which can effectively distinguish the medicine from the background. The pixel area where the target pixel point is located is fitted with edge lines to obtain a quadrilateral area; the quadrilateral area is further corrected to ensure that the extracted medicine area has a standard rectangular shape. In the corrected rectangular area, multiple first partial images in the preset area are extracted, including the image areas of the four vertices and the image area of ​​the center position. This multi-angle and multi-position image extraction method can obtain more comprehensive information about the medicine image and improve the accuracy and reliability of the medicine image analysis. By extracting partial images at different positions, more detailed features in the medicine image can be captured, and the effect of image feature extraction can be enhanced. The technical solution forms a complete set of image processing procedures from the acquisition of the original image, target pixel extraction, edge fitting to rectangular correction and partial image extraction, which reduces human intervention and improves the degree of automation and efficiency of processing. In summary, the technical solution can not only improve the accuracy of medicine image acquisition and processing, but also provide high-quality image data support for subsequent intelligent analysis and processing.

[0079] Step 103: extracting first feature information in the first partial images according to the grayscale distribution in each of the first partial images;

[0080] Since there is often a large grayscale difference between the text and the picture on the surface of the drug packaging box, the present invention extracts the first feature information in the first partial image based on the grayscale distribution in the first partial image. The specific logic is as follows:

[0081] Specifically, step 103 specifically includes steps 1031 to 1037:

[0082] Step 1031: traverse each current pixel in the first partial image, and obtain neighboring pixel points for each current pixel; the neighboring pixel points refer to the pixel points in a preset pixel area; the preset pixel area refers to a rectangular area of ​​a fixed size formed with the current pixel as the midpoint;

[0083] There is often a large grayscale change at the edge of the text on the surface of the drug packaging box, so in order to analyze the grayscale change near each current pixel in the first partial image, multiple neighboring pixels corresponding to the current pixel are extracted in the preset pixel area. The preset pixel area refers to a rectangular area of ​​fixed size formed with the current pixel as the midpoint.

[0084] Step 1032: multiplying the first grayscale value of the current pixel by a preset coefficient to obtain a second threshold; the second threshold is greater than the first grayscale value of the current pixel;

[0085] Since the text on the same drug packaging surface also has certain grayscale value differences under different ambient light, in order to include the grayscale value differences, the present invention multiplies the first grayscale value by the preset coefficient to obtain the second threshold, and the second threshold is greater than the first grayscale value of the current pixel point to include the grayscale value differences. Among them, the preset coefficient can be set based on different application scenarios or experimental data, and is not limited here.

[0086] Step 1033: Matching the number of consecutive pixels whose second grayscale values ​​are greater than the second threshold value among the neighboring pixels;

[0087] Since the pixels of the non-text part are continuous at the edge of the text on the surface of the packaging box, the number of pixels of the non-text part is screened by the two conditions of the second gray value and whether it is continuous.

[0088] Step 1034: If the number of pixels is greater than a preset number, the current pixel is used as a feature pixel;

[0089] When the number of pixels is greater than the preset number, it indicates that there are certain non-text pixels near the pixel, so the current pixel is a feature pixel. In order to improve the recognition accuracy of feature pixels, you can also filter them in the following ways:

[0090] Specifically, step 1034 includes steps A1 to A4:

[0091] Step A1: if the number of pixels is greater than a preset number, calculating the first gradient and the second gradient of the pixels in the preset pixel area in the X-axis direction and the Y-axis direction;

[0092] Assume that the grayscale matrix of the preset pixel area is I, and the first gradient and the second gradient in the X-axis direction and the Y-axis direction are as follows:

[0093]

[0094] Among them, I x Represents the first gradient, I y Represents the second gradient.

[0095] Step A2: calculating an autocorrelation matrix of a preset pixel area according to the first gradient and the second gradient;

[0096] Compute the squared sum of the gradients Perform a Gaussian weighted sum on the squared and multiplied products of the gradients. Use a Gaussian window w for weighted summing:

[0097]

[0098] S xy =w*I x I y

[0099] Among them, * represents the convolution operation, and the Gaussian window w is a standard two-dimensional Gaussian function.

[0100] The autocorrelation matrix is ​​constructed as follows:

[0101]

[0102] Where M represents the autocorrelation matrix.

[0103] Step A3: Substituting the autocorrelation matrix into a preset function to calculate the grayscale change intensity;

[0104] The preset function is:

[0105]

[0106] Where R represents the intensity of grayscale change, det(M) represents the determinant of the autocorrelation matrix, M represents the autocorrelation matrix, trace(M) represents the trace of the autocorrelation matrix, ∈ represents the constant term, α represents the nonlinear adjustment parameter, and β represents the adaptive parameter;

[0107] Where, det()=- 2 ; trace() = +.

[0108] The preset function can distinguish feature points more accurately by introducing a nonlinear response parameter α. The nonlinear response amplifies the response value of the feature point, making the feature point more prominent in the response graph, thereby improving the accuracy of detection.

[0109] The introduction of the adaptive parameter β enables the detection performance to be maintained at a high level when processing images with more noise or lower contrast. The adaptive parameter dynamically adjusts the detection capability of the algorithm under different image features, avoiding the limitations brought by fixed parameters.

[0110] The introduction of parameter ∈ effectively prevents the calculation instability caused by the denominator being zero or the value being too small. It is more stable in the numerical calculation process and avoids corner point detection errors caused by numerical instability.

[0111] The nonlinear response enhances the detection capability of feature points and can more effectively detect feature points in complex backgrounds. This is particularly important for feature point detection in some application scenarios (such as low-resolution images or images with weak textures).

[0112] Step A4: taking the current pixel point whose grayscale change intensity is greater than the third threshold as a feature pixel point.

[0113] Since the grayscale changes along multiple directions at the feature point are very large, the current pixel point whose grayscale change intensity is greater than the third threshold can be used as the feature pixel point.

[0114] Step 1035: Calculate the distance between the feature pixel and the four vertices of the first partial image;

[0115] Step 1036: Calculate the ratio of the grayscale value between the feature pixel and the plurality of neighboring pixel points;

[0116] Step 1037: construct a feature vector by combining the ratio of the grayscale values, the distances between the four vertices and the number of pixels, and use the feature vector as the first feature information.

[0117] According to the preset parameter order, the ratio of gray values, the distance between the four vertices and the number of pixels are combined into a feature vector.

[0118] In this embodiment, by traversing each current pixel in the first partial image, and obtaining the neighboring pixel for each current pixel, and then calculating the second threshold according to the preset coefficient, the threshold is matched with the gray value of the neighboring pixel, and the characteristic pixel is accurately identified. Since the technical solution takes into account the distance between the characteristic pixel and the four vertices of the first partial image, and the ratio of the gray value between the characteristic pixel and a plurality of neighboring pixels, these characteristic information are constructed into a characteristic vector, so that the extracted characteristic information has strong robustness and can remain stable under different lighting conditions and noise interference. By calculating the distance between the characteristic pixel and the four vertices, the gray value ratio of the neighboring pixel and the number of matched continuous pixels, these information are constructed into a characteristic vector, which can comprehensively reflect the local features of the image, so that the extracted first characteristic information is richer and more comprehensive. Since this method only relies on gray value for feature extraction, it does not require complex pre-processing or post-processing steps and can be applied to different types of images. In summary, this technical solution significantly improves the accuracy, robustness and efficiency of feature extraction by traversing image pixels and integrating multiple feature information for extraction, and can provide a reliable foundation for subsequent image analysis and processing.

[0119] Step 104: extracting second feature information from a second partial image in the standard drug image;

[0120] The calculation logic of the second characteristic information is the same as that of the first characteristic information, and will not be described again. The second characteristic information may be pre-stored characteristic information or characteristic information calculated in real time.

[0121] Step 105: Calculating target similarity between first feature information in the first partial image and second feature information in the second partial image;

[0122] Specifically, step 105 specifically includes steps 1051 to 1055:

[0123] Step 1051: dividing the image into a plurality of grid image regions according to the size of the first partial image or the second partial image;

[0124] According to the size of the first partial image or the second partial image, they are divided into multiple smaller grid image regions. Each original image will be divided into several small blocks, each of which is called a grid image region. This segmentation helps to process image feature information in a more fine-grained manner.

[0125] Step 1052: intercepting a first sub-image corresponding to a plurality of grid image regions in the first partial image;

[0126] Step 1053: intercepting a second sub-image corresponding to a plurality of grid image regions in the second partial image;

[0127] In each grid image region after segmentation, the corresponding first sub-image is intercepted from the first partial image, and the corresponding second sub-image is intercepted from the second partial image. In this way, each pair of grid image regions will contain a pair of sub-images, which will be used for subsequent feature information extraction and similarity calculation.

[0128] Step 1054: extracting a plurality of current first feature information and a plurality of current second feature information corresponding to the first sub-image and the second sub-image in the same grid image area;

[0129] Step 1055: Calculate the similarity between each of the current first feature information and the multiple current second feature information respectively, and take the maximum similarity as the target similarity of the current first feature information.

[0130] For each grid image area, the similarity between each feature information of the first sub-image and each feature information of the second sub-image is calculated. A variety of methods can be used for similarity calculation, such as Euclidean distance, cosine similarity, cross entropy, etc. In this way, the similarity value between each pair of feature information can be obtained. In each grid image area, the largest one is selected from all the calculated similarity values ​​as the target similarity of the area. This means that in each small area, the pair with the best matching feature information is selected as the final similarity value.

[0131] In this embodiment, the first local image and the second local image are divided into a plurality of grid image areas, and the first sub-image and the second sub-image are respectively intercepted in each grid image area. This enables the image processing to be more refined and localized, and the feature information between the sub-images in each grid area can be more accurately extracted and compared. In each grid image area, similarity calculations are performed for the multiple current first feature information and the multiple current second feature information extracted from the first sub-image and the second sub-image. By selecting the maximum similarity as the target similarity, the optimal effect of local feature information matching is ensured. This technical solution has a significant effect in improving the accuracy of image similarity calculation, enhancing the local feature matching effect, and improving computing efficiency.

[0132] Step 106: Calculate the total similarity according to the multiple target similarities corresponding to the multiple first partial images;

[0133] The average value of the multiple target similarities is taken as the total similarity.

[0134] Step 107: If the total similarity is greater than a first threshold, it is determined that the current drug is consistent with the target drug.

[0135] As an optional embodiment of the present application, after step 107, it also includes: obtaining medication information corresponding to the target drug in the prescription information, and playing the medication information through a voice broadcast module; the medication information includes the patient's name, drug dosage and precautions.

[0136] In this embodiment, by obtaining prescription information and matching the standard drug image, extracting multiple first partial images in the preset area of ​​the current drug image, and extracting feature information according to the grayscale distribution, the present invention can accurately capture the detailed features of each partial image, thereby improving the accuracy of drug identification. By calculating the target similarity between the first feature information in the first partial image and the second feature information of the second partial image in the standard drug image, and further calculating the total similarity, by setting the first threshold of the total similarity, it is possible to effectively distinguish whether the current drug is consistent with the target drug, thereby reducing the possibility of misidentification and ensuring the accuracy and safety of drug management. The method of the present invention can achieve high automation in the drug identification process, reduce the workload of doctors and nurses, reduce the risk of human errors, and improve the overall intelligent level of drug management in the hospital. The method of the present invention is applicable to drugs of different types and specifications, and can be widely used in various medical environments through flexible image matching and feature extraction strategies to meet different drug management needs. In summary, the present invention significantly improves the efficiency and accuracy of drug management through image processing and feature matching technology, and provides an efficient and reliable drug identification solution.

[0137] like Figure 2 The present invention provides a smart hardware drug identification device 2, see Figure 2 , Figure 2 A schematic diagram of a smart hardware drug identification device provided by the present invention is shown. Figure 2 The drug identification device of a smart hardware includes:

[0138] An acquisition unit 21 is used to acquire prescription information and match a standard drug image corresponding to a target drug in the prescription information;

[0139] The acquisition unit 22 is used to acquire a current drug image of a current drug and extract a plurality of first partial images in a preset area of ​​the current drug image;

[0140] A first extraction unit 23, configured to extract first feature information in the first partial image according to the grayscale distribution in each of the first partial images;

[0141] A second extraction unit 24, configured to extract second feature information from a second partial image in the standard drug image;

[0142] A first calculation unit 25, configured to calculate a target similarity between first feature information in the first partial image and second feature information in the second partial image;

[0143] A second calculation unit 26, configured to calculate a total similarity according to a plurality of target similarities corresponding to each of the plurality of first partial images;

[0144] The determination unit 27 is configured to determine that the current drug is consistent with the target drug if the total similarity is greater than a first threshold.

[0145] The present invention provides a drug identification device of intelligent hardware. By acquiring prescription information and matching standard drug images, a plurality of first partial images are extracted in a preset area of ​​the current drug image, and feature information is extracted according to the grayscale distribution. The present invention can accurately capture the detailed features of each partial image, thereby improving the accuracy of drug identification. By calculating the target similarity between the first feature information in the first partial image and the second feature information of the second partial image in the standard drug image, and further calculating the total similarity, by setting the first threshold of the total similarity, it is possible to effectively distinguish whether the current drug is consistent with the target drug, thereby reducing the possibility of misidentification and ensuring the accuracy and safety of drug management. The method of the present invention can achieve high automation in the drug identification process, reduce the workload of doctors and nurses, reduce the risk of human errors, and improve the intelligent level of overall drug management in the hospital. The method of the present invention is applicable to drugs of different types and specifications, and can be widely used in various medical environments through flexible image matching and feature extraction strategies to meet different drug management needs. In summary, the present invention significantly improves the efficiency and accuracy of drug management through image processing and feature matching technology, and provides an efficient and reliable drug identification solution.

[0146] Figure 3 Schematic diagram of a terminal device provided by an embodiment of the present invention. Figure 3 As shown, a terminal device 3 of this embodiment includes: a processor 30, a memory 31, and a computer program 32 stored in the memory 31 and executable on the processor 30, such as a program for drug identification of smart hardware. When the processor 30 executes the computer program 32, the steps of each of the above-mentioned drug identification method embodiments of smart hardware are implemented, such as Figure 1 Alternatively, when the processor 30 executes the computer program 32, the functions of each unit in the above-mentioned device embodiments are realized, for example, Figure 2 Function of the unit shown.

[0147] Exemplarily, the computer program 32 may be divided into one or more units, which are stored in the memory 31 and executed by the processor 30 to complete the present invention. The one or more units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 32 in the terminal device 3. For example, the computer program 32 may be divided into the following specific functions of each unit:

[0148] An acquisition unit, used to acquire prescription information and match a standard drug image corresponding to a target drug in the prescription information;

[0149] A collection unit, used to collect a current drug image of a current drug, and extract a plurality of first partial images in a preset area of ​​the current drug image;

[0150] A first extraction unit, configured to extract first feature information in each of the first partial images according to the grayscale distribution in the first partial images;

[0151] A second extraction unit, used to extract second feature information from a second partial image in the standard drug image;

[0152] A first calculation unit, configured to calculate a target similarity between first feature information in the first partial image and second feature information in the second partial image;

[0153] A second calculation unit, configured to calculate a total similarity according to a plurality of target similarities corresponding to each of the plurality of first partial images;

[0154] A determination unit is used to determine that the current drug is consistent with the target drug if the total similarity is greater than a first threshold.

[0155] The terminal device includes but is not limited to a processor 30 and a memory 31. Those skilled in the art will appreciate that Figure 3 It is only an example of a terminal device 3 and does not constitute a limitation on the terminal device 3. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device may also include input and output devices, network access devices, buses, etc.

[0156] The processor 30 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0157] The memory 31 may be an internal storage unit of the terminal device 3, such as a hard disk or memory of the terminal device 3. The memory 31 may also be an external storage device of the terminal device 3, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 3. Further, the memory 31 may also include both an internal storage unit and an external storage device of the terminal device 3. The memory 31 is used to store the computer program and other programs and data required by the roaming control device. The memory 31 may also be used to temporarily store data that has been output or is to be output.

[0158] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0159] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present invention. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0160] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0161] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0162] An embodiment of the present invention provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0163] If the integrated 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, the present invention implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera device / terminal device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a disk or an optical disk.

[0164] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0165] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0166] In the embodiments provided by the present invention, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as 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 mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0167] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, and may be located in one place or distributed over multiple network units.

[0168] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0169] It should also be understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0170] As used in the present specification and the appended claims, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to monitoring, depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is monitored" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is monitored" or "in response to monitoring [described condition or event]", depending on the context.

[0171] In addition, in the description of the present specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0172] References to "one embodiment" or "some embodiments" etc. described in the present specification mean that one or more embodiments of the present invention include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0173] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A drug identification method for intelligent hardware, characterized in that: The drug identification method of the intelligent hardware includes: Obtaining prescription information and matching the standard drug image corresponding to the target drug in the prescription information; wherein the prescription information refers to an electronic prescription issued by a physician, and the information in the electronic prescription includes but is not limited to the drug name, quantity, patient name, and precautions; Acquire a current drug image of a current drug, and extract a plurality of first partial images in a preset area of ​​the current drug image; Traversing each current pixel point in the first partial image, and acquiring neighboring pixel points for each current pixel point; the neighboring pixel points refer to pixel points within a preset pixel area; the preset pixel area refers to a rectangular area of ​​a fixed size formed with the current pixel point as the midpoint; Multiplying the first grayscale value of the current pixel by a preset coefficient to obtain a second threshold value; the second threshold value is greater than the first grayscale value of the current pixel point; Matching the number of pixels whose second grayscale value is greater than the second threshold and is continuous among the neighborhood pixels; If the number of pixels is greater than a preset number, the current pixel is used as a feature pixel; Calculating the distance between the feature pixel point and four vertices of the first partial image; Calculating the ratio of the grayscale value between the feature pixel point and a plurality of the neighborhood pixel points; The ratio of the gray values, the distances between the four vertices and the number of pixels are constructed into a feature vector, and the feature vector is used as the first feature information; Extracting second feature information from a second partial image in the standard drug image; Calculating target similarity between first feature information in the first partial image and second feature information in the second partial image; Calculating a total similarity based on a plurality of target similarities corresponding to each of the plurality of first partial images; If the total similarity is greater than a first threshold, it is determined that the current drug is consistent with the target drug.

2. The drug identification method of intelligent hardware according to claim 1, characterized in that: After the step of determining that the current drug is consistent with the target drug if the total similarity is greater than a threshold, the method further includes: Obtain medication information corresponding to the target drug in the prescription information, and play the medication information through the voice broadcast module; the medication information includes the patient's name, drug dosage and precautions.

3. The drug identification method of intelligent hardware according to claim 1, characterized in that: The step of acquiring a current drug image of a current drug and extracting a plurality of first partial images in a preset area of ​​the current drug image comprises: Collect the original image of the current drug; Extracting target pixel points in the original image that are outside a preset grayscale range; the preset grayscale range is used to characterize the grayscale value corresponding to the placement platform; Extracting the pixel area where the target pixel point is located, performing straight line fitting on the edge of the pixel area to obtain a quadrilateral area; Performing rectangular correction on the quadrilateral area to obtain a rectangular area; Extracting a medicine image corresponding to the rectangular area in the original image; A plurality of first partial images are extracted from a preset area in the drug image; the preset area includes image areas located at four vertices and an image area located at a central position.

4. The drug identification method of intelligent hardware according to claim 1, characterized in that: The step of calculating the target similarity between the first feature information in the first partial image and the second feature information in the second partial image comprises: According to the size of the first partial image or the second partial image, dividing the image into a plurality of grid image areas; intercepting a first sub-image corresponding to a plurality of grid image regions in the first partial image; intercepting a second sub-image corresponding to a plurality of grid image regions in the second partial image; Extracting a plurality of current first feature information and a plurality of current second feature information corresponding to a first sub-image and a second sub-image in the same grid image area; The similarities between each of the current first feature information and the multiple current second feature information are calculated respectively, and the maximum similarity is used as the target similarity of the current first feature information.

5. The drug identification method of intelligent hardware according to claim 1, characterized in that: The step of calculating the total similarity according to the multiple target similarities corresponding to the multiple first partial images comprises: The average value of the multiple target similarities is taken as the total similarity.

6. The drug identification method of intelligent hardware according to claim 1, characterized in that: If the number of pixels is greater than a preset number, the step of taking the current pixel as a feature pixel includes: If the number of pixels is greater than a preset number, calculating a first gradient and a second gradient of the pixels in the preset pixel area in the X-axis direction and the Y-axis direction; Calculating an autocorrelation matrix of a preset pixel area according to the first gradient and the second gradient; Substituting the autocorrelation matrix into a preset function to calculate the intensity of grayscale change; The preset function is: Where R represents the intensity of grayscale change, det(M) represents the determinant of the autocorrelation matrix, M represents the autocorrelation matrix, trace(M) represents the trace of the autocorrelation matrix, ∈ represents the constant term, α represents the nonlinear adjustment parameter, and β represents the adaptive parameter; The current pixel point whose grayscale change intensity is greater than the third threshold is taken as the characteristic pixel point.

7. A smart hardware drug identification device, characterized in that: The drug identification device of the intelligent hardware includes: an acquisition unit, configured to acquire prescription information and match a standard drug image corresponding to a target drug in the prescription information; wherein the prescription information refers to an electronic prescription issued by a physician, and the information in the electronic prescription includes but is not limited to the drug name, quantity, patient name, and precautions; A collection unit, used to collect a current drug image of a current drug, and extract a plurality of first partial images in a preset area of ​​the current drug image; A first extraction unit, configured to traverse each current pixel point in the first partial image, and obtain neighboring pixel points for each current pixel point; the neighboring pixel points refer to pixel points within a preset pixel area; the preset pixel area refers to a rectangular area of ​​a fixed size formed with the current pixel point as the midpoint; Multiplying the first grayscale value of the current pixel by a preset coefficient to obtain a second threshold value; the second threshold value is greater than the first grayscale value of the current pixel point; Matching the number of pixels whose second grayscale value is greater than the second threshold and is continuous among the neighborhood pixels; If the number of pixels is greater than a preset number, the current pixel is used as a feature pixel; Calculating the distance between the feature pixel point and four vertices of the first partial image; Calculating the ratio of the grayscale value between the feature pixel point and a plurality of the neighborhood pixel points; The ratio of the gray values, the distances between the four vertices and the number of pixels are constructed into a feature vector, and the feature vector is used as the first feature information; A second extraction unit, used to extract second feature information from a second partial image in the standard drug image; A first calculation unit, configured to calculate a target similarity between first feature information in the first partial image and second feature information in the second partial image; A second calculation unit, configured to calculate a total similarity according to a plurality of target similarities corresponding to each of the plurality of first partial images; A determination unit is used to determine that the current drug is consistent with the target drug if the total similarity is greater than a first threshold.

8. A terminal device, characterized in that: The device includes: a memory, a processor, and a drug identification program of smart hardware stored in the memory and executable on the processor, wherein the drug identification program of smart hardware is configured to implement the drug identification steps of the smart hardware as described in any one of claims 1 to 6.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Drug verification device, drug verification system and drug verification method

    US20160203291A1