WO2022067913A1 - 药品检测方法、装置、电子终端及存储介质 - Google Patents

药品检测方法、装置、电子终端及存储介质 Download PDF

Info

Publication number
WO2022067913A1
WO2022067913A1 PCT/CN2020/123273 CN2020123273W WO2022067913A1 WO 2022067913 A1 WO2022067913 A1 WO 2022067913A1 CN 2020123273 W CN2020123273 W CN 2020123273W WO 2022067913 A1 WO2022067913 A1 WO 2022067913A1
Authority
WO
WIPO (PCT)
Prior art keywords
picture
medicine
template
foreground
medicine box
Prior art date
Application number
PCT/CN2020/123273
Other languages
English (en)
French (fr)
Inventor
刘浩
Original Assignee
苏州艾隆科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 苏州艾隆科技股份有限公司 filed Critical 苏州艾隆科技股份有限公司
Publication of WO2022067913A1 publication Critical patent/WO2022067913A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • G06T7/001Industrial image inspection using an image reference approach
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation

Definitions

  • the invention relates to the technical field of drug distribution, in particular to a drug detection method, device, electronic terminal and storage medium.
  • a medicine dispensing system In a pharmacy of a hospital, a medicine dispensing system is usually set up, and the medicine dispensing system is usually provided with a medicine outlet, and the medicine dispensing system sends out a preset type of medicine from the medicine outlet.
  • the medicine system may be wrong, that is, the medicine may not correspond to the preset type.
  • the error is usually corrected by manual inspection. It is understandable that this method is not only labor-intensive, but also wrong. is also more likely.
  • the purpose of the present invention is to provide a drug detection method, device, electronic terminal and storage medium.
  • an embodiment of the present invention provides a drug detection method, comprising the following steps: acquiring a drug type and a number of corresponding template pictures, wherein the template picture includes an outer part of a medicine box corresponding to the drug type Side; obtain a picture of a medicine box, the picture of the medicine box contains a plurality of medicine boxes, and the medicine boxes are not stacked with each other; generate a foreground picture of the picture of the medicine box, after determining any template picture and the foreground picture When matching, the medicine box picture contains the medicine corresponding to the medicine type.
  • the method further includes the following step: when it is determined that any template picture matches the foreground picture, the picture area corresponding to the template picture is removed from the foreground picture.
  • the "generating the foreground picture of the picture of the medicine box” specifically includes: obtaining a background picture, and obtaining a number of first feature points in the background picture and the picture of the medicine box based on the SURF algorithm Several second feature points in , based on the first and second feature points, generate the foreground picture of the picture of the medicine box.
  • the "determining that any template picture matches the foreground picture” specifically includes: continuously selecting an unprocessed template picture from the several template pictures, and judging whether the unprocessed template picture matches the Whether the foreground picture matches, until the unprocessed template picture matches the foreground picture or the several template pictures have been processed.
  • the "judging whether the unprocessed template picture matches the foreground picture” specifically includes: acquiring a plurality of first feature points of the unprocessed template picture and a plurality of second feature points of the foreground picture respectively. Feature points, from a plurality of first feature points and a plurality of second feature points, obtain the unprocessed template picture and the nearest matching feature points in the foreground picture; Based on the several matching feature points, obtain the foreground picture To the transformation matrix of the unprocessed template picture, use the transformation matrix to process the foreground picture, and then perform projection transformation processing to obtain the to-be-matched picture; determine whether the to-be-matched picture matches the unprocessed template picture.
  • the "judging whether the picture to be matched matches the unprocessed template picture" specifically includes: selecting several first points in the image area corresponding to the outer side from the unprocessed template picture; when When there is any first point that does not correspond to the second point in the to-be-matched picture, the to-be-matched picture does not match the unprocessed template picture.
  • each template picture the picture area corresponding to the outer side is rectangular; in the picture to be matched, several first points include: multiple points;
  • the "judging whether the picture to be matched matches the unprocessed template picture" further includes: selecting a number of second points corresponding to a number of first points from the picture to be matched, when a number of second points form a second rectangle, a number of first points When the absolute value of the difference between the areas of the first rectangle and the second rectangle formed by the points is less than or equal to the preset difference, it is determined that the to-be-matched picture matches the unprocessed template picture.
  • An embodiment of the present invention further provides a drug detection device, including the following modules: a template picture acquisition module, used for acquiring a drug type and a number of corresponding template pictures, wherein the template picture includes an outer side of a medicine box corresponding to the drug type
  • the medicine box picture acquisition module is used to obtain the medicine box picture, and the medicine box picture contains a plurality of medicine boxes, and the medicine boxes are not stacked with each other;
  • the processing module is used to generate the foreground picture of the medicine box picture , when it is determined that any template picture matches the foreground picture, the medicine box picture contains the medicine corresponding to the medicine type.
  • An embodiment of the present invention further provides a storage medium storing program instructions, and when the program instructions are executed, the above-mentioned drug detection method is implemented.
  • An embodiment of the present invention further provides an electronic terminal, including a processor and a memory, wherein the memory stores program instructions, characterized in that the processor executes the program instructions to implement the above-mentioned drug detection method.
  • the embodiment of the present invention provides a drug detection method, device, electronic terminal and storage medium, and the drug detection method includes the following steps: obtaining a drug type and a number of corresponding template pictures,
  • the template picture includes an outer side of the medicine box corresponding to the type of medicine; obtain the picture of the medicine box, the medicine box picture contains multiple medicine boxes, and the medicine boxes are not stacked with each other; the foreground picture of the medicine box picture is generated, and after determining any one
  • the template image matches the foreground image the medicine box image contains the medicine corresponding to the medicine type. This enables automatic identification of medication dispensing errors.
  • FIG. 1 is a schematic structural diagram of a medicine dispensing system in an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a drug detection method in an embodiment of the present invention.
  • spatially relative positions are used herein for ease of illustration to describe one element or feature relative to another as shown in the figures The relationship of a unit or feature.
  • the term spatially relative position may be intended to encompass different orientations of the device in use or operation in addition to the orientation shown in the figures. For example, if the device in the figures is turned over, elements described as “below” or “beneath” other elements or features would then be oriented “above” the other elements or features. Thus, the exemplary term “below” can encompass both an orientation of above and below.
  • the device may be otherwise oriented (rotated 90 degrees or at other orientations) and the spatially relative descriptors used herein interpreted accordingly.
  • the specific structure of the medicine dispensing system can be shown in FIG. 1, including: a medicine storage device, a conveyor belt device and a medicine dispensing device, the medicine storage device is provided with a medicine outlet and can store medicines.
  • the medicine storage device When multiple medicine types are received , when the desired quantity corresponding to each type of medicine, the medicine storage device sends out several medicines from the medicine outlet, and then several medicines will drop onto the conveyor belt device, and the conveyor belt device can transfer the medicines to the medicine dispensing device, and then dispense medicines The device is then able to dispense the medicine.
  • each drug sent from the drug outlet corresponds to a drug type, and if statistics are made according to the drug type, the desired quantity of each drug type should be equal to the corresponding number of drugs, but in practice, There may be errors, that is, one drug sent from the drug outlet does not correspond to several drug types, or the drug corresponding to a certain drug type does not exist in the multiple drugs, or the desired quantity of a certain drug type Not equal to the number of corresponding drugs.
  • the camera can take pictures of the medicines delivered from the medicine outlet. For example, when several medicines are sent out of the medicine outlet, they will fall on the transmission belt device, and at this time, the camera can take pictures.
  • a light bulb is provided on the camera, and the light bulb can be turned on when the environment is relatively dim; Directly facing the conveyor belt device, which can reduce the probability of crooked photos.
  • Embodiment 1 of the present invention provides a drug detection method, as shown in FIG. 2 , including the following steps:
  • Step 201 Obtain the type of medicine and several corresponding template pictures, the template picture includes an outer side of the medicine box corresponding to the type of medicine;
  • the box is usually a square box with six outer sides, each outer side is printed with information such as patterns or text, and each template picture can be a photo obtained by taking one outer side; here, in practice, the medicine box There may be many different styles, so each side of the medicine box in all styles can be photographed, and then all the obtained photos can be used as the corresponding template picture of the medicine
  • Step 202 Obtain a picture of the medicine box, the picture of the medicine box contains a plurality of medicine boxes, and the medicine boxes are not stacked with each other; here, the medicine dispensing system will send out the medicine from the medicine outlet during one medicine dispensing process There are multiple medicine boxes, and a mechanical device is provided at the dispensing opening, and the mechanical device can prevent the multiple medicine boxes from stacking each other.
  • the medicine outlets of the multiple medicine boxes are dropped, they will fall on the conveyor belt device. At this time, after the medicine boxes are stationary, the camera can be controlled to take pictures of the outer side of the medicine boxes.
  • Step 203 Generate a foreground picture of the picture of the medicine box, and when it is determined that any template picture matches the foreground picture, the picture of the medicine box contains the medicine corresponding to the type of medicine.
  • the background picture is firstly removed from the medicine box picture to obtain the foreground picture, which can greatly reduce the interference of noise. After that, if a certain area in the foreground image matches a template image, it can be confirmed that the medicine box image contains the medicine corresponding to the medicine type, that is, the medicines sent by the medicine storage device from the medicine outlet Contains drugs corresponding to the drug type.
  • the embodiment of the present invention provides, further comprising the following steps: when it is determined that any template picture matches the foreground picture, removing the picture area corresponding to the template picture from the foreground picture.
  • the medicine picture contains multiple medicine boxes, after one medicine box is identified, the next medicine box needs to be identified. It is understandable that, in order to prevent errors, the identified medicine box needs to be The foreground image is removed, and then the identification of the next pill box is continued.
  • the "generating the foreground picture of the picture of the medicine box” specifically includes: obtaining a background picture, and obtaining a number of first feature points in the background picture based on the SURF (Speed Up Robust Feature) algorithm, and the medicine Several second feature points in the box picture, based on the first and second feature points, generate a foreground picture of the medicine box picture.
  • the background picture can be a picture taken by the camera in advance, and the medicine box is not included in the picture.
  • the "determining that any template picture matches the foreground picture” specifically includes: continuously selecting an unprocessed template picture from the several template pictures, and judging whether the unprocessed template picture matches the foreground picture , until the unprocessed template picture matches the foreground picture or the several template pictures have been processed.
  • the template pictures can be processed one by one. If there is a template picture that matches the picture of the medicine box, it is expected that there are multiple medicines sent by the dispensing system. If, after processing all the template pictures, a template picture that matches the picture of the medicine box still cannot be found, it means that the multiple medicines sent by the dispensing system do not contain the expected ones. drug.
  • the "judging whether the unprocessed template picture matches the foreground picture” specifically includes: respectively acquiring a plurality of first feature points of the unprocessed template picture and a plurality of second feature points of the foreground picture, from multiple Among the first feature points and the plurality of second feature points, obtain the nearest matching feature points in the unprocessed template picture and the foreground picture; based on the matching feature points, obtain the foreground picture to the unprocessed The transformation matrix of the template picture, using the transformation matrix to process the foreground picture, and then performing projection transformation processing to obtain the to-be-matched picture; judging whether the to-be-matched picture matches the unprocessed template picture.
  • the first and second feature points are the image features of the unprocessed template image and the foreground image, respectively.
  • the shooting angles and orientations of the template image and the foreground image may be different. Therefore, SURF (Speed Up Robust Feature) algorithm performs corresponding processing, so that the foreground image can be subjected to graphic transformation processing and projection transformation processing, and the image to be matched can be obtained. It can be understood that the shooting angle and orientation of the image to be matched and the unprocessed template image are the same. , after that, the feature descriptors of the two images can be obtained, and then the features of the two images are matched according to the similarity of the descriptors.
  • SURF Speed Up Robust Feature
  • the "judging whether the to-be-matched picture matches the unprocessed template picture" specifically includes: selecting several first points in the image area corresponding to the outer side from the unprocessed template picture; When the point is not in the corresponding second point in the picture to be matched, the picture to be matched does not match the unprocessed template picture.
  • the picture area corresponding to the outer side is rectangular; in the picture to be matched, several first points include: a plurality of points respectively located on the four boundaries of the outer side;
  • the "judging whether the picture to be matched matches the unprocessed template picture" further includes: selecting a number of second points corresponding to a number of first points from the picture to be matched, when a number of second points form a second rectangle, a number of first points When the absolute value of the difference between the areas of the first rectangle and the second rectangle formed by the points is less than or equal to the preset difference, it is determined that the to-be-matched picture matches the unprocessed template picture.
  • the "absolute value of the difference between the areas of the first rectangle and the second rectangle formed by several first points ⁇ preset difference" may include:
  • the "respectively obtaining a plurality of first feature points of the template picture and a plurality of second feature points corresponding to the foreground picture” specifically includes: based on the SURF (Speed Up Robust Feature) algorithm, respectively obtaining the template picture's features.
  • SURF Speed Up Robust Feature
  • the "obtaining the nearest several matching feature points in the template picture and the foreground picture from a plurality of first and second feature points” specifically includes: based on the KNN (K-Nearest Neighbor) algorithm, from multiple Among the first and second feature points, the nearest matching feature points in the template image and the foreground image are obtained.
  • KNN K-Nearest Neighbor
  • the second embodiment of the present invention provides a drug detection device, including the following modules:
  • a template picture acquisition module used to acquire a drug type and a number of corresponding template pictures
  • the template picture includes an outer side of the medicine box corresponding to the drug type
  • the medicine box picture acquisition module is used to obtain the medicine box picture, and the medicine box picture includes a plurality of medicine boxes, and the medicine boxes are not stacked with each other;
  • the processing module is configured to generate a foreground picture of the picture of the medicine box.
  • the picture of the medicine box contains the medicine corresponding to the medicine type.
  • the third embodiment of the present invention provides a storage medium storing program instructions, and when the program instructions are executed, the drug detection method in the first embodiment is implemented.
  • Embodiment 4 of the present invention provides an electronic terminal, including a processor and a memory, wherein the memory stores program instructions, and the processor executes the program instructions to implement the drug detection method in Embodiment 1.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • Quality & Reliability (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Image Analysis (AREA)
  • Medical Preparation Storing Or Oral Administration Devices (AREA)

Abstract

一种药品检测方法、装置、电子终端及存储介质,该药品检测方法包括以下步骤:获取药品类型及对应的若干模板图片,模板图片包含药品类型对应药盒的一个外侧面;获取药盒图片,药盒图片中包含有多个药盒、且药盒相互之间不堆叠;生成药盒图片的前景图片,在确定任一模板图片与前景图片匹配时,药盒图片中包含有药品类型对应的药品,从而能够自动识别发药错误。

Description

药品检测方法、装置、电子终端及存储介质
本申请要求了申请日为2020年09月30日,申请号为202011059248.7,发明名称为“药品检测方法、装置、电子终端及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及药品发放技术领域,尤其涉及一种药品检测方法、装置、电子终端及存储介质。
背景技术
在医院的药房中,通常都会设置有发药系统,该发药系统通常会设置有出药口,该发药系统会从该出药口送出预设类型的药品,可以理解的是,该发药系统有可能会出错,即该药品与该预设类型有可能不对应,在现有技术中,通常都是通过人工检查来纠正该错误,可以理解的是,该方法不仅耗费人力,且错误的概率也较大。
因此,设计一种能够进行错误纠正的药品检测方法,就成为一个亟待解决的问题。
发明内容
本发明的目的在于提供一种药品检测方法、装置、电子终端及存储介质。
为了实现上述发明目的之一,本发明一实施方式提供了一种药品检测方法,包括以下步骤:获取药品类型及对应的若干模板图片,所述模板图片包含所述药品类型对应药盒的一个外侧面;获取药盒图片,所述药盒图片中包含有多个药盒、且药盒相互之间不堆叠;生成所述药盒图片的前景图片,在确定任一模板图片与所述前景图片匹配时,所述药盒图片中包含有所述药品类型对应的药品。
作为本发明一实施方式的进一步改进,还包括以下步骤:在确定任一模板图片与所述前景图片匹配时,从所述前景图片去除所述模板图片对应的图片区域。
作为本发明一实施方式的进一步改进,所述“生成所述药盒图片的前景图片”具体包括:获取背景图片,基于SURF算法获取所述背景图片中的若干第一特征点、以及药盒图片中的若干第二特征点,基于第一、第二特征点,生成所述药盒图片的前景图片。
作为本发明一实施方式的进一步改进,所述“确定任一模板图片与所述前景图片匹配”具体包括:持续从所述若干模板图片中选择出一个未处理模板图片,判断未处理模板图片与前景图片是否匹配,直至未处理模板图片与前景图片匹配或者所述若干模板图片均已经被处理。
作为本发明一实施方式的进一步改进,所述“判断未处理模板图片与前景图片是否匹配”具 体包括:分别获取未处理模板图片的多个第一特征点、所述前景图片的多个第二特征点,从多个第一特征点和多个第二特征点中、获取未处理模板图片和前景图片中的最邻近的若干匹配特征点;基于所述若干匹配特征点、获取所述前景图片到所述未处理模板图片的变换矩阵,利用所述变换矩阵对所述前景图片进行处理,之后再进行投射变换处理,得到待匹配图片;判断待匹配图片与未处理模板图片是否匹配。
作为本发明一实施方式的进一步改进,所述“判断待匹配图片与未处理模板图片是否匹配”具体包括:从未处理模板图片中、选择外侧面对应的图像区域中的若干第一点;当存在任意的第一点在待匹配图片中不在对应的第二点时,则待匹配图片与未处理模板图片不匹配。
作为本发明一实施方式的进一步改进,在每个模板图片中,外侧面对应的图片区域呈矩形;待匹配图片中,若干第一点包含有:分别位于所述外侧面的四个边界上的多个点;
所述“判断待匹配图片与未处理模板图片是否匹配”还包括:从所述待匹配图片选择与若干第一点对应的若干第二点,当若干第二点构成第二矩形、若干第一点构成的第一矩形与第二矩形的面积之间的差值的绝对值≤预设差值时,确定待匹配图片与未处理模板图片匹配。
本发明实施例还提供了一种药品检测装置,包括以下模块:模板图片获取模块,用于获取药品类型及对应的若干模板图片,所述模板图片包含所述药品类型对应药盒的一个外侧面;药盒图片获取模块,用于获取药盒图片,所述药盒图片中包含有多个药盒、且药盒相互之间不堆叠;处理模块,用于生成所述药盒图片的前景图片,在确定任一模板图片与所述前景图片匹配时,所述药盒图片中包含有所述药品类型对应的药品。
本发明实施例还提供了一种存储介质,存储有程序指令,所述程序指令被执行时实现上述的药品检测方法。
本发明实施例还提供了一种电子终端,包括处理器和存储器,所述存储器存储有程序指令,其特征在于,所述处理器运行程序指令实现上述的药品检测方法。
相对于现有技术,本发明的技术效果在于:本发明实施例提供一种药品检测方法、装置、电子终端及存储介质,该药品检测方法包括以下步骤:获取药品类型及对应的若干模板图片,模板图片包含药品类型对应药盒的一个外侧面;获取药盒图片,药盒图片中包含有多个药盒、且药盒相互之间不堆叠;生成药盒图片的前景图片,在确定任一模板图片与前景图片匹配时,药盒图片中包含有药品类型对应的药品。从而能够自动识别发药错误。
附图说明
图1是本发明实施例中的发药系统的一种结构示意图;
图2是本发明实施例中的药品检测方法的流程示意图。
具体实施方式
以下将结合附图所示的各实施方式对本发明进行详细描述。但这些实施方式并不限于本发明,本领域的普通技术人员根据这些实施方式所做出的结构、方法、或功能上的变换均包含在本发明的保护范围内。
本文使用的例如“上”、“上方”、“下”、“下方”等表示空间相对位置的术语是出于便于说明的目的来描述如附图中所示的一个单元或特征相对于另一个单元或特征的关系。空间相对位置的术语可以旨在包括设备在使用或工作中除了图中所示方位以外的不同方位。例如,如果将图中的设备翻转,则被描述为位于其他单元或特征“下方”或“之下”的单元将位于其他单元或特征“上方”。因此,示例性术语“下方”可以囊括上方和下方这两种方位。设备可以以其他方式被定向(旋转90度或其他朝向),并相应地解释本文使用的与空间相关的描述语。
这里,该发药系统的具体结构可以如图1所示,包括:储药装置、传送带装置和发药装置,该储药装置设置有出药口且能够存储药品,当接收到多个药品类型,每个药品类型对应的欲取数量时,该储药装置从出药口送出若干药品,之后若干药品会掉落到传送带装置上,传送带装置能够将该药品传送到发药装置,之后发药装置就能够将药品分发出去。可以理解的是,从出药口送出的每个药品都对应到一个药品类型,并且如果按照药品类型进行统计,每个药品类型的欲取数量应该等于对应的药品的数量,但在实际中,有可能会出错,即,出药口送出的一个药品与若干药品类型均不对应的,或某个药品类型所对应的药品在该多个药品中不存在,或者某个药品类型的欲取数量不等于对应的药品的数量。
这里,该摄像头能够对出药口所送出的药品进行拍摄,例如,当若干药品被送出出药口时,会掉落到传动带装置上,此时,摄像头就能够进行拍摄了。可选的,该摄像头上设置有灯泡,在环境比较暗淡的时候,可以打开该灯泡;可选的,该传送带装置与出药口的连接处的正上方可以设置该摄像头,且摄像头中的镜头正对传送带装置,从而能够降低照片歪的概率。
本发明实施例一提供了一种药品检测方法,如图2所示,包括以下步骤:
步骤201:获取药品类型及对应的若干模板图片,所述模板图片包含所述药品类型对应药盒的一个外侧面;这里,在实际中,一般的药品都是使用药盒来包装的,该药盒通常为方盒,具有六个外侧面,每个外侧面都印刷有图案或文字等信息,每个模板图片可以为拍摄一个外侧面所得到的照片;这里,在实际中,药品的药盒有可能会有多个不同的样式,因此,可以对所有样式的药盒中的每个侧面都拍照,然后,可以将得到的所有照片作为该药品的对应的模板图片
步骤202:获取药盒图片,所述药盒图片中包含有多个药盒、且药盒相互之间不堆叠;这里,该发药系统会在一次发药的过程中,从出药口送出多个药盒,且发药口处会设置有一个机械装置, 该机械装置能够使得多个药盒相互不堆叠。可选的,该多个药盒出药口掉落时,会掉落在传送带装置上,此时,可以等药盒都静止之后,再控制摄像头拍摄药盒的外侧面的图片,
步骤203:生成所述药盒图片的前景图片,在确定任一模板图片与所述前景图片匹配时,所述药盒图片中包含有所述药品类型对应的药品。这里,为了提高准确性,首先从药盒图片中去除背景图片,从而得到前景图片,从而能够极大的降低噪音的干扰。之后,如果在前景图片中的某块区域与一个模板图片匹配了,就可以确认该药盒图片中包含有所述药品类型对应的药品,也即储药装置从出药口所送出的药品中包含有该药品类型对应的药品。
本发明实施例提供了,还包括以下步骤:在确定任一模板图片与所述前景图片匹配时,从所述前景图片去除所述模板图片对应的图片区域。这里,由于该药品图片中包含有多个药盒,当一个药盒被识别之后,需要在对下一个药盒进行识别,可以理解的是,为了防止出现错误,需要将已识别的药盒从前景图片中去除,然后在继续下一个药盒的识别。
本发明实施例中,所述“生成所述药盒图片的前景图片”具体包括:获取背景图片,基于SURF(Speed Up Robust Feature)算法获取所述背景图片中的若干第一特征点、以及药盒图片中的若干第二特征点,基于第一、第二特征点,生成所述药盒图片的前景图片。这里,背景图片可以摄像头事先拍摄的图片,在该图片中是不包含有药盒。
本发明实施例中,所述“确定任一模板图片与所述前景图片匹配”具体包括:持续从所述若干模板图片中选择出一个未处理模板图片,判断未处理模板图片与前景图片是否匹配,直至未处理模板图片与前景图片匹配或者所述若干模板图片均已经被处理。这里,由于该模板图片的数量可能为多个,因此,可以一个接着一个对该模板图片进行处理,如果有一个模板图片与药盒图片匹配,则述发药系统送出的多个药品中有预想中的药品;而如果,在对所有的模板图片都进行处理之后,仍然没法发现一个与药盒图片相匹配的模板图片,则表示发药系统送出的多个药品中不包含有预想中的药品。
本实施例中,所述“判断未处理模板图片与前景图片是否匹配”具体包括:分别获取未处理模板图片的多个第一特征点、所述前景图片的多个第二特征点,从多个第一特征点和多个第二特征点中、获取未处理模板图片和前景图片中的最邻近的若干匹配特征点;基于所述若干匹配特征点、获取所述前景图片到所述未处理模板图片的变换矩阵,利用所述变换矩阵对所述前景图片进行处理,之后再进行投射变换处理,得到待匹配图片;判断待匹配图片与未处理模板图片是否匹配。这里,第一、第二特征点分别为未处理模板图片和前景图片的图像特征,在实际中,模板图片和前景图片的拍摄角度和方位等有可能不相同,因此,可以使用SURF(Speed Up Robust Feature)算法进行相应的处理,从而能够对前景图片进行图形变换处理和投射变换处理,并得 到待匹配图片,可以理解是,该待匹配图片与未处理模板图片的拍摄角度和方位是相同的,之后,可以获得这两个图片的特征描述子,然后根据描述子的相似程度对两幅图像的特征之间进行匹配。
可选的,可以使用openCV中的findHomography函数来得到转换矩阵,使用perspective Transform来进行投射变换处理。
本实施例中,所述“判断待匹配图片与未处理模板图片是否匹配”具体包括:从未处理模板图片中、选择外侧面对应的图像区域中的若干第一点;当存在任意的第一点在待匹配图片中不在对应的第二点时,则待匹配图片与未处理模板图片不匹配。这里,如果待匹配图片与未处理模板图片之间是匹配的,则在未处理模板图片中,外侧面对应的图像区域中的所有的点,在待匹配图片中,都应该存在对应的点,反之,如果存在任意的第一点在待匹配图片中不在对应的第二点时,则待匹配图片与未处理模板图片不匹配。
本实施例中,在每个模板图片中,外侧面对应的图片区域呈矩形;在待匹配图片中,若干第一点包含有:分别位于所述外侧面的四个边界上的多个点;所述“判断待匹配图片与未处理模板图片是否匹配”还包括:从所述待匹配图片选择与若干第一点对应的若干第二点,当若干第二点构成第二矩形、若干第一点构成的第一矩形与第二矩形的面积之间的差值的绝对值≤预设差值时,确定待匹配图片与未处理模板图片匹配。这里,由于若干第一点包含有位于所述外侧面的四个边界上的点,在若干第一点能够构成一个矩形,相应的,若干第二点也应该能够构成一个矩形,且这两个矩形的面积应该差不多,即有些误差,但差值的绝对值很小(即差值的绝对值≤预设差值,预设差值≥0)。可选的,所述“若干第一点构成的第一矩形与第二矩形的面积之间的差值的绝对值≤预设差值”可以包括:|第一矩形的面积-第二矩形的面积|/第一矩形的面积≤20%;或者|第一矩形的面积-第二矩形的面积|/第二矩形的面积≤20%。
可选的,所述“分别获取模板图片的多个第一特征点、所述前景图片对应的多个第二特征点”具体包括:基于SURF(Speed Up Robust Feature)算法,分别获取模板图片的多个第一特征点、所述前景图片对应的多个第二特征点。
可选的,所述“从多个第一、第二特征点中、获取模板图片和前景图片中的最邻近的若干匹配特征点”具体包括:基于KNN(K-Nearest Neighbor)算法,从多个第一、第二特征点中、获取模板图片和前景图片中的最邻近的若干匹配特征点。
本发明实施例二提供了一种药品检测装置,包括以下模块:
模板图片获取模块,用于获取药品类型及对应的若干模板图片,所述模板图片包含所述药品类型对应药盒的一个外侧面;
药盒图片获取模块,用于获取药盒图片,所述药盒图片中包含有多个药盒、且药盒相互之间不堆叠;
处理模块,用于生成所述药盒图片的前景图片,在确定任一模板图片与所述前景图片匹配时,所述药盒图片中包含有所述药品类型对应的药品。
本发明实施例三提供了一种存储介质,存储有程序指令,所述程序指令被执行时实现实施例一中的药品检测方法。
本发明实施例四提供了一种电子终端,包括处理器和存储器,所述存储器存储有程序指令,所述处理器运行程序指令实现实施例一中的药品检测方法。
应当理解,虽然本说明书按照实施方式加以描述,但并非每个实施方式仅包含一个独立的技术方案,说明书的这种叙述方式仅仅是为清楚起见,本领域技术人员应当将说明书作为一个整体,各实施方式中的技术方案也可以经适当组合,形成本领域技术人员可以理解的其他实施方式。
上文所列出的一系列的详细说明仅仅是针对本发明的可行性实施方式的具体说明,它们并非用以限制本发明的保护范围,凡未脱离本发明技艺精神所作的等效实施方式或变更均应包含在本发明的保护范围之内。

Claims (10)

  1. 一种药品检测方法,其特征在于,包括以下步骤:
    获取药品类型及对应的若干模板图片,所述模板图片包含所述药品类型对应药盒的一个外侧面;
    获取药盒图片,所述药盒图片中包含有多个药盒、且药盒相互之间不堆叠;
    生成所述药盒图片的前景图片,在确定任一模板图片与所述前景图片匹配时,所述药盒图片中包含有所述药品类型对应的药品。
  2. 根据权利要求1所述的药品检测方法,其特征在于,还包括以下步骤:
    在确定任一模板图片与所述前景图片匹配时,从所述前景图片去除所述模板图片对应的图片区域。
  3. 根据权利要求1所述的药品检测方法,其特征在于,所述“生成所述药盒图片的前景图片”具体包括:
    获取背景图片,基于SURF算法获取所述背景图片中的若干第一特征点、以及药盒图片中的若干第二特征点,基于第一、第二特征点,生成所述药盒图片的前景图片。
  4. 根据权利要求1所述的药品检测方法,其特征在于,所述“确定任一模板图片与所述前景图片匹配”具体包括:
    持续从所述若干模板图片中选择出一个未处理模板图片,判断未处理模板图片与前景图片是否匹配,直至未处理模板图片与前景图片匹配或者所述若干模板图片均已经被处理。
  5. 根据权利要求4所述的药品检测方法,其特征在于,所述“判断未处理模板图片与前景图片是否匹配”具体包括:
    分别获取未处理模板图片的多个第一特征点、所述前景图片的多个第二特征点,从多个第一特征点和多个第二特征点中、获取未处理模板图片和前景图片中的最邻近的若干匹配特征点;
    基于所述若干匹配特征点、获取所述前景图片到所述未处理模板图片的变换矩阵,利用所述变换矩阵对所述前景图片进行处理,之后再进行投射变换处理,得到待匹配图片;
    判断待匹配图片与未处理模板图片是否匹配。
  6. 根据权利要求5所述的药品检测方法,其特征在于,所述“判断待匹配图片与未处理模板图片是否匹配”具体包括:
    从未处理模板图片中、选择外侧面对应的图像区域中的若干第一点;
    当存在任意的第一点在待匹配图片中不在对应的第二点时,则待匹配图片与未处理模板图片 不匹配。
  7. 根据权利要求6所述的药品检测方法,其特征在于:
    在每个模板图片中,外侧面对应的图片区域呈矩形;
    在待匹配图片中,若干第一点包含有:分别位于所述外侧面的四个边界上的多个点;
    所述“判断待匹配图片与未处理模板图片是否匹配”还包括:从所述待匹配图片选择与若干第一点对应的若干第二点,当若干第二点构成第二矩形、且若干第一点构成的第一矩形与第二矩形的面积之间的差值的绝对值≤预设差值时,确定待匹配图片与未处理模板图片匹配。
  8. 一种药品检测装置,其特征在于,包括以下模块:
    模板图片获取模块,用于获取药品类型及对应的若干模板图片,所述模板图片包含所述药品类型对应药盒的一个外侧面;
    药盒图片获取模块,用于获取药盒图片,所述药盒图片中包含有多个药盒、且药盒相互之间不堆叠;
    处理模块,用于生成所述药盒图片的前景图片,在确定任一模板图片与所述前景图片匹配时,所述药盒图片中包含有所述药品类型对应的药品。
  9. 一种存储介质,存储有程序指令,其特征在于,所述程序指令被执行时实现如权利要求1至权利要求7任一项所述的药品检测方法。
  10. 一种电子终端,包括处理器和存储器,所述存储器存储有程序指令,其特征在于,所述处理器运行程序指令实现如权利要求1至权利要求7任一项所述的药品检测方法。
PCT/CN2020/123273 2020-09-30 2020-10-23 药品检测方法、装置、电子终端及存储介质 WO2022067913A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011059248.7 2020-09-30
CN202011059248.7A CN112184674A (zh) 2020-09-30 2020-09-30 药品检测方法、装置、电子终端及存储介质

Publications (1)

Publication Number Publication Date
WO2022067913A1 true WO2022067913A1 (zh) 2022-04-07

Family

ID=73947238

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/123273 WO2022067913A1 (zh) 2020-09-30 2020-10-23 药品检测方法、装置、电子终端及存储介质

Country Status (2)

Country Link
CN (1) CN112184674A (zh)
WO (1) WO2022067913A1 (zh)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090030722A1 (en) * 2007-07-25 2009-01-29 Walgreen Co. System and method for performing a remote verification of a pharmacy fill utilizing an image to image comparison
CN103158987A (zh) * 2011-12-13 2013-06-19 苏州艾隆科技有限公司 快速发药系统中药品识别及处理方法
CN105335956A (zh) * 2014-08-06 2016-02-17 腾讯科技(深圳)有限公司 同源图像的校验方法及装置
CN108538356A (zh) * 2018-01-18 2018-09-14 深圳市瑞驰致远科技有限公司 药品自动核对系统及方法
CN110738216A (zh) * 2019-09-04 2020-01-31 南京理工大学 基于改进surf算法的药品识别方法
CN111462165A (zh) * 2020-03-27 2020-07-28 韶鼎人工智能科技有限公司 一种基于前景提取与特征点匹配的药盒识别系统及其方法

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104568986A (zh) * 2015-01-26 2015-04-29 中国科学院半导体研究所 基于surf算法的遥控器面板印刷缺陷自动检测方法
CN105447454B (zh) * 2015-11-13 2018-05-01 广东欧珀移动通信有限公司 指纹模板完善方法、装置和终端设备
CN105809673B (zh) * 2016-03-03 2019-04-02 上海大学 基于surf算法和合并最大相似区域的视频前景分割方法
CN107248169B (zh) * 2016-03-29 2021-01-22 中兴通讯股份有限公司 图像定位方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090030722A1 (en) * 2007-07-25 2009-01-29 Walgreen Co. System and method for performing a remote verification of a pharmacy fill utilizing an image to image comparison
CN103158987A (zh) * 2011-12-13 2013-06-19 苏州艾隆科技有限公司 快速发药系统中药品识别及处理方法
CN105335956A (zh) * 2014-08-06 2016-02-17 腾讯科技(深圳)有限公司 同源图像的校验方法及装置
CN108538356A (zh) * 2018-01-18 2018-09-14 深圳市瑞驰致远科技有限公司 药品自动核对系统及方法
CN110738216A (zh) * 2019-09-04 2020-01-31 南京理工大学 基于改进surf算法的药品识别方法
CN111462165A (zh) * 2020-03-27 2020-07-28 韶鼎人工智能科技有限公司 一种基于前景提取与特征点匹配的药盒识别系统及其方法

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
HAO YIQING: "Design and Implementation of a Medicine Box Image Identification System", CHINA MASTER’S THESES FULL-TEXT DATABASE, no. 2017/07, 15 July 2017 (2017-07-15), XP055917700 *
JAKUBOVIC AMILA; VELAGIC JASMIN: "Image Feature Matching and Object Detection Using Brute-Force Matchers", 2018 INTERNATIONAL SYMPOSIUM ELMAR, CROATIAN SOCIETY ELECTRONICS IN MARINE - ELMAR, 16 September 2018 (2018-09-16), pages 83 - 86, XP033447198, ISBN: 978-953-184-244-0, DOI: 10.23919/ELMAR.2018.8534641 *

Also Published As

Publication number Publication date
CN112184674A (zh) 2021-01-05

Similar Documents

Publication Publication Date Title
JP2020075172A5 (ja) 画像処理装置、プログラム
US9800754B2 (en) Global registration of filled-out content in an application form
JPWO2018173649A1 (ja) 薬剤認識装置、薬剤認識方法、及び薬剤認識プログラム
US10937152B2 (en) Inspection support method and inspection support device
CN114274501B (zh) 3d打印机续打方法、装置、计算机设备和存储介质
CN113129383A (zh) 手眼标定方法、装置、通信设备及存储介质
WO2014197305A1 (en) System and method of using imprint analysis in pill identification
WO2022067913A1 (zh) 药品检测方法、装置、电子终端及存储介质
US9506903B2 (en) Pharmaceutical verification camera system and method
US9858499B2 (en) Image processor, non-transitory computer readable medium and object matching device
US10937180B2 (en) Method and apparatus for depth-map estimation
US10709048B2 (en) System and method for assembling electronic components
US8731336B2 (en) Multi-perpendicular line-based deskew with affine and perspective distortion correction
WO2019165612A1 (zh) 可移动平台的定位方法及相关装置、系统
JP6913362B2 (ja) ラベルの検査方法及び検査装置
WO2022067914A1 (zh) 药品检测方法、装置、电子终端及存储介质
TWI692356B (zh) 藉由行動裝置實現的藥片服用輔助方法
CN113752260B (zh) 一种取料定位修正方法及装置
JP6757851B2 (ja) 調剤監査支援装置及び調剤監査支援方法
KR20090005625A (ko) 단말기 자세 측정 방법 및 장치
JP7442672B2 (ja) 物体の側壁を検査するための方法
JP7135993B2 (ja) 物品認識システム
WO2022034667A1 (ja) Ptp管理システム
WO2020022056A1 (ja) 情報処理装置および情報処理方法、並びにプログラム
JP7207141B2 (ja) 物品認識システム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20955933

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20955933

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 26.09.2023)