CN111462165A - Medicine box identification system and method based on foreground extraction and feature point matching - Google Patents
Medicine box identification system and method based on foreground extraction and feature point matching Download PDFInfo
- Publication number
- CN111462165A CN111462165A CN202010227943.3A CN202010227943A CN111462165A CN 111462165 A CN111462165 A CN 111462165A CN 202010227943 A CN202010227943 A CN 202010227943A CN 111462165 A CN111462165 A CN 111462165A
- Authority
- CN
- China
- Prior art keywords
- medicine box
- medicine
- module
- binary image
- foreground
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 239000003814 drug Substances 0.000 title claims abstract description 188
- 238000000605 extraction Methods 0.000 title claims abstract description 56
- 229940079593 drug Drugs 0.000 title claims abstract description 30
- 238000000034 method Methods 0.000 title claims abstract description 22
- 238000012545 processing Methods 0.000 claims abstract description 25
- 238000005520 cutting process Methods 0.000 claims abstract description 21
- 230000011218 segmentation Effects 0.000 claims abstract description 8
- 238000000638 solvent extraction Methods 0.000 claims abstract description 4
- 238000003860 storage Methods 0.000 claims abstract description 4
- 238000001514 detection method Methods 0.000 claims description 10
- 230000008569 process Effects 0.000 claims description 6
- 230000008859 change Effects 0.000 claims description 3
- 238000012216 screening Methods 0.000 claims description 3
- 230000008719 thickening Effects 0.000 claims description 3
- 230000000007 visual effect Effects 0.000 claims description 3
- 238000003709 image segmentation Methods 0.000 abstract 1
- 238000010586 diagram Methods 0.000 description 7
- 238000004519 manufacturing process Methods 0.000 description 4
- 238000012544 monitoring process Methods 0.000 description 4
- 239000000284 extract Substances 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 238000009877 rendering Methods 0.000 description 2
- BSYNRYMUTXBXSQ-UHFFFAOYSA-N Aspirin Chemical compound CC(=O)OC1=CC=CC=C1C(O)=O BSYNRYMUTXBXSQ-UHFFFAOYSA-N 0.000 description 1
- 239000003390 Chinese drug Substances 0.000 description 1
- 229960001138 acetylsalicylic acid Drugs 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 239000003962 counterfeit drug Substances 0.000 description 1
- 238000013523 data management Methods 0.000 description 1
- 238000001647 drug administration Methods 0.000 description 1
- 238000007905 drug manufacturing Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000003203 everyday effect Effects 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 238000012856 packing Methods 0.000 description 1
- 238000000926 separation method Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/194—Segmentation; Edge detection involving foreground-background segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q30/00—Commerce
- G06Q30/018—Certifying business or products
- G06Q30/0185—Product, service or business identity fraud
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q50/00—Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
- G06Q50/04—Manufacturing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/74—Image or video pattern matching; Proximity measures in feature spaces
- G06V10/75—Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
- G06V10/751—Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/30—Computing systems specially adapted for manufacturing
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Health & Medical Sciences (AREA)
- General Business, Economics & Management (AREA)
- Strategic Management (AREA)
- Marketing (AREA)
- Economics (AREA)
- General Health & Medical Sciences (AREA)
- Manufacturing & Machinery (AREA)
- Tourism & Hospitality (AREA)
- Software Systems (AREA)
- Medical Informatics (AREA)
- Evolutionary Computation (AREA)
- Human Resources & Organizations (AREA)
- Databases & Information Systems (AREA)
- Primary Health Care (AREA)
- Computing Systems (AREA)
- Multimedia (AREA)
- Artificial Intelligence (AREA)
- Entrepreneurship & Innovation (AREA)
- Accounting & Taxation (AREA)
- Development Economics (AREA)
- Finance (AREA)
- Medical Preparation Storing Or Oral Administration Devices (AREA)
- Image Analysis (AREA)
Abstract
A medicine box recognition system and method based on foreground extraction and feature point matching, the system includes: a foreground extraction module: after the system receives the drug order, the foreground extraction is started, and the camera returns the picture and the foreground extraction binary image; a contact cartridge partitioning module: the foreground extraction binary image segmentation module is used for extracting the outline of the foreground extraction binary image output by the foreground extraction module and carrying out segmentation processing on the foreground extraction binary image; outputting a binary image after the segmentation processing is finished; a cutting and storing module: the processing unit is used for performing rotary cutting processing on the picture returned by the camera by taking the processed binary image as a contour basis and outputting a medicine box picture; the characteristic point extraction and comparison module: the medicine box matching processing module is used for extracting the characteristic points of the medicine box pictures output by the cutting storage module, extracting corresponding medicine box characteristic point data from the database according to the medicine list, circularly comparing and returning the matching condition of the medicine boxes, and indicating that the medicines do not meet the requirement of the medicine list. The invention can be used as a substitute for a medicine numbering system with incomplete reconstruction at present to complete medicine identification.
Description
Technical Field
The invention discloses a medicine box identification system and method based on foreground extraction and feature point matching, and belongs to the field of machine vision.
Background
China implements unified electronic supervision measures on medicines since 2005. Each minimum package of medication has an electronic supervision code on it. This code is similar to a bar code, consisting of 16 digits at the earliest and 20 digits at the later stages. Simply, this code is the "ID card" of the drug.
When a manufacturing enterprise produces medicines, a unique electronic supervision code is given to each minimum-packaged medicine and is printed on each minimum-packaged medicine; production enterprises can also transmit the production, quality and other source information of the products to a monitoring network database through an electronic monitoring code system; the circulation enterprises check and accept the incoming goods through the electronic monitoring code system and transmit the incoming goods information to the monitoring network database; when a hospital or a pharmacy at a terminal needs to sell the medicines, a code scanning gun is used for scanning the supervision codes, and the sales information is transmitted to a supervision network database.
The 'identity authentication system' of the set of medicines can realize unique identification and whole-course tracking of each medicine, so that consumers can inquire true and false and quality, governments can perform law enforcement, quality tracing and product recall management, and enterprises can know market supply and demand conditions, channel sales conditions and fake-related information. The unification of functions such as government supervision, logistics application, merchant settlement, consumer inquiry and the like is realized.
Electronic drug administration systems do solve many problems, but are not perfect.
First, although the supervisory code is data management, the related operation cost is still high.
The key of the drug supervision code needs a drug manufacturing enterprise to apply for purchase to a Chinese drug electronic supervision network, is called as a digital certificate, looks like a U disk, is similar to a network shield for guaranteeing the security networking of bank cards, and can be used for assigning codes to drugs only after the key is provided.
When uploading data to a supervision network database, circulation enterprises also need to purchase digital certificates and equip special code scanning guns with large quantity and low price.
In addition to the cost of the special devices, the operation cost of the medicine electronic supervision code database is more huge, and in terms of the production capacity of medicines in 2014, coded medicines are required to be hundreds of millions of boxes every day, and the data of the coded medicines must be uploaded, stored in real time and inquired in real time.
And secondly, the medicine supervision codes implement three-level packaging code assignment management, the first-level medicine supervision codes correspond to minimum sales packages of medicines, the second-level medicine supervision codes correspond to middle-level packages of medicines, the third-level medicine supervision codes correspond to outer-level packages of medicines, and the first level, the second level and the third level are associated with each other. Enterprises need to print supervision codes on each box of medicines and need to subpackage the medicines into medicine boxes corresponding to the supervision codes, so that the printing cost and the labor cost are increased, and more importantly, reworking is needed as long as any one level code in the three levels has a problem.
Third, there is the potential safety hazard in medicine electronic supervision code, and the medicine packing carton is retrieved from the consumer hand to the molecule of partly making fake, perhaps steals medicine supervision code from the enterprise, like this, and the supervision code on the fake medicine box will show as true medicine information. The code scanning cannot distinguish the authenticity of the medicine, so that the meaning of the electronic supervision code is lost. In the 4 th month of the year, the aspirin pseudo-drug case obtained in Chuzhou of Anhui is an example, and the drug supervision code and the batch number related to the pseudo-drug have no problems.
In view of the above problems, the national authorities have adjusted this system.
The electronic medicine supervision system is changed into a medicine tracing system, and the medicine tracing system is being built.
So at present, no method is available for scanning the code of the medicine by the bar code like the common code scanning payment of the commodity.
Disclosure of Invention
The technical problem of the invention is solved: aiming at the problems that the reconstruction of the current medicine numbering system is incomplete and medicines are difficult to identify through medicine numbers, the medicine box identification system and the method based on foreground extraction and feature point matching are provided, and a corresponding relation between medicine processing and database data updating is established for a user as a substitute for medicine number identification.
The invention provides a medicine box identification system based on foreground extraction and feature point matching, which comprises: the prospect draws module, contacts the medicine box and cuts apart the module, cuts out save module, characteristic point and draws module, characteristic point comparison module, wherein:
a foreground extraction module: the system is used for starting to extract the foreground after receiving the medicine order, compressing the picture returned by the camera to be within 20 ten thousand pixels, and recording the picture returned by the camera and the foreground extraction binary image after the medicine box enters the visual field of the camera and is stable;
a contact cartridge partitioning module: the foreground extraction binary image processing module is used for extracting the outline of the foreground extraction binary image output by the foreground extraction module, screening out the outline with the image proportion lower than 1/20, performing linear fitting on the residual outline to form a closed graph, considering that the non-convex graph is a plurality of medicine boxes, and performing segmentation processing on the closed graph; outputting a binary image after the segmentation processing is finished;
a cutting and storing module: the processing unit is used for performing rotary cutting processing on the picture returned by the camera by taking the processed binary image as a contour basis and outputting a medicine box picture;
the characteristic point extraction and comparison module: the medicine box matching processing module is used for extracting the characteristic points of the medicine box pictures output by the cutting storage module, extracting corresponding medicine box characteristic point data from the database according to the medicine list, circularly comparing and returning the matching condition of the medicine boxes, and indicating that the medicines do not meet the requirement of the medicine list.
The invention also provides a medicine box identification method based on foreground extraction and feature point matching, which comprises the following steps:
step (1), setting a medicine box identification device, including setting the distance between a camera of the identification device and a background and a shooting mode;
step (2), extracting a section of the medicine box from the foreground, placing the target medicine box in a camera view field, acquiring a medicine box image by the camera, acquiring a foreground binary image by using a foreground extraction algorithm after the image is reduced to be within a preset size, starting updating an image background model when the medicine box enters the camera view field, starting updating the background model to stop updating as a process that the medicine box enters the camera view field, stopping updating the background model as a basis for stopping the foreground extraction algorithm, outputting a picture returned by the camera at the moment, amplifying the binary image returned by the foreground extraction algorithm to the original size and outputting the amplified binary image, wherein the average time required by each frame of the algorithm is less than 50 ms;
step (3) concave point cutting and separating contact medicine boxes, and for the situation that partial medicine boxes are in contact in the situation of a plurality of medicine boxes, firstly carrying out contour extraction on the foreground binary image obtained in the step (2) and removing the mistaken foreground contour of the algorithm caused by light change with the image ratio lower than 1/20 to obtain a plurality of contours, wherein the contours of the plurality of medicine boxes in mutual contact exist; utilizing a polygonal fitting function to enable the edge of the polygonal fitting function to be linear, and utilizing a convex hull detection function to calculate a contour convex hull; drawing convex polygons by using a non-concave drawing function, thickening original contour lines by using a contour drawing function on the contours of the multi-medicine box to perform simple edge region curvilinearization so as to reduce the operation complexity, subtracting the thickened contours from the obtained convex polygons to obtain a plurality of concave regions, then solving the contours of the concave regions, solving angular points by using a polygonal fitting function to reduce the number of contour points of the concave regions, and reducing the calculated amount, wherein at the moment, one concave region is expressed as a polygon, the distance between the nearest angular points of the two polygons is the shortest distance of the concave regions, and the two angular points are the solved concave point pairs; circularly obtaining a pit point pair of each pit area and the nearest pit area; utilizing the concave point pair to divide the foreground binary image to obtain mutually non-contact medicine box binary images;
extracting the outline of the medicine box according to the outline in the step (4), extracting the outline of the binary image obtained in the step (3), rotationally cutting the picture of the medicine box to be processed obtained in the step (2) by using the extracted outline to obtain the picture of the medicine box to be processed, obtaining the outline of the binary image by using an outline detection function, obtaining the minimum external rectangle angle, length, width and central point information of each outline by using a minimum external rectangle detection function, applying the information to the picture of the medicine box to be processed obtained in the step (2), rotating to 0 degrees when the angle is close to 0 degrees, rotating to +/-90 degrees when the angle is close to +/-90 degrees to enable the required rotation amplitude of the medicine box to be lower than 45 degrees, preventing the medicine box from exceeding the boundary of the original picture after rotating to perform proper length and width filling on the original picture, and cutting and storing the picture of the medicine box to;
step (5) extracting the medicine box features by using an orb feature extraction algorithm, and defaulting the number of extracted features to be 500;
and (6) comparing the characteristic points by using a characteristic point comparison function BFMatcher, comparing the picture characteristics obtained from the database with the characteristics of the to-be-detected medicine box obtained from orb by using the characteristic point comparison function BFMatcher to obtain a matched medicine box, and returning a complete matching indication or indicating errors according to the medicines and the quantity shown in the medicine list.
Further, the identification device is: the camera is positioned above the background plate, the background plate is pure black, and the target medicine box is placed on the background plate;
further, the identification device is: including the operation panel, the operation panel below is arranged in to the camera, and the medicine is placed in the operation panel top, from upwards shooing down, and the image cross-section that the medicine box was drawed is downward, sets up the mesa distance according to the camera focus.
Has the advantages that:
the invention can extract the foreground at the speed of 50 ms/frame, can finish the processing of the single medicine box from the end of detection to the time before matching within 30ms, the matching time is about 50ms, namely the whole process can be finished within 80ms, and the invention meets the requirement of practical application; meanwhile, under the condition that the image acquired by the camera is clear enough, almost 100% matching accuracy can be achieved.
Drawings
FIG. 1 is a system framework diagram of the present invention;
FIG. 2 is a schematic diagram of an identification device (hardware) 1 used in the present invention;
FIG. 3 is a schematic diagram of an identification device (hardware) 2 used in the present invention;
FIG. 4 is an exemplary diagram of a foreground extraction kit of the present invention;
FIG. 5 is an illustration of a foreground extracted binary graph of the present invention;
FIG. 6 is an exemplary diagram of a concave area corresponding to a foreground extracted binary image according to the present invention;
FIG. 7 is an illustration of a binary diagram of pit cutting completion according to the present invention;
FIG. 8 is an exemplary drawing of a picture of a medicine cartridge according to the present invention;
FIG. 9 is a diagram of orb feature point extraction and BFMatcher matching according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, rather than all embodiments, and all other embodiments obtained by a person skilled in the art based on the embodiments of the present invention belong to the protection scope of the present invention without creative efforts.
For a better understanding of the invention, some basic concepts will be explained below.
And (3) foreground extraction: moving objects in the video that are distinguished from a relatively stationary background are identified or recorded.
Picture hole: when the foreground is extracted, if the foreground moves slowly, if a large number of same pixels exist in the foreground, pixel values of certain positions are always unchanged in the moving process, and at the moment, the pixels are easily determined as background pixels by an algorithm, and a hole is generated.
A binary image: only pure black and pure white pixels.
Concave point pairs: the shortest distance point between two concave areas of the non-convex graph.
Polygonal fitting function: and fitting the plurality of end points by using a single straight line to change the irregular graph into a polygonal concave graph.
Orb characteristic point extraction: a feature point extraction algorithm based on fast algorithm and rBrief algorithm.
BFMatcher: a common feature point comparison algorithm.
According to an embodiment of the present invention, a medicine box recognition system based on foreground extraction and feature point matching is provided, which includes: the prospect draws module, contacts the medicine box and cuts apart the module, cuts out save module, characteristic point and draws module, characteristic point comparison module, wherein:
a foreground extraction module: the system is used for starting to extract the foreground after receiving the medicine order, compressing the picture returned by the camera to be within 20 ten thousand pixels, and recording the picture returned by the camera and the foreground extraction binary image after the medicine box enters the visual field of the camera and is stable;
a contact cartridge partitioning module: the foreground extraction binary image processing module is used for extracting the outline of the foreground extraction binary image output by the foreground extraction module, screening out the outline with the image proportion lower than 1/20, performing linear fitting on the residual outline to form a closed graph, considering that the non-convex graph is a plurality of medicine boxes, and performing segmentation processing on the closed graph; outputting a binary image after the segmentation processing is finished;
a cutting and storing module: the processing unit is used for performing rotary cutting processing on the picture returned by the camera by taking the processed binary image as a contour basis and outputting a medicine box picture;
the characteristic point extraction and comparison module: the medicine box matching processing module is used for extracting the characteristic points of the medicine box pictures output by the cutting storage module, extracting corresponding medicine box characteristic point data from the database according to the medicine list, circularly comparing and returning the matching condition of the medicine boxes, and indicating that the medicines do not meet the requirement of the medicine list.
According to another aspect of the invention, a medicine box identification method based on foreground extraction and feature point matching is provided, which comprises the following steps:
(1) setting a medicine box identification device, including setting the distance between a camera of the identification device and a background and a shooting mode;
the medicine box identification device (hardware) comprises the following two parts:
the device 1: as in fig. 2, the camera position height is fixed according to the camera depth of field, and the solid (black) background is fixed. In the figure: 1 is a camera, 2 is a black background, and 3 is a target medicine box
The device 2: as shown in fig. 3, an operation table is arranged, the camera is arranged below the operation table to shoot upwards, the extracted section of the medicine box is downward, and the table top distance is set according to the focal length of the camera. In the figure: 1 is a camera, 3 is a target medicine box, and 4 is an operation table.
(2) The section of the medicine box is extracted from the prospect. The target medicine box is placed under a designated camera, a ten million pixels fixed-focus camera is used for acquiring a medicine box image as shown in fig. 4, a foreground binary image is acquired by using a foreground extraction algorithm DPAdaptedMedian as shown in fig. 5 after the image is reduced to be within 20 ten thousand pixels, a background model starts and stops updating and is used as a medicine box to enter a camera view process, the background model stops updating and is used as an algorithm stop basis, the camera returns to the image output at the moment, the algorithm returns to the binary image, the binary image is amplified back to the original size and output, and the average time of each frame of the algorithm is less than 50 ms.
(3) Concave point cutting separation contact kit: for the case of multiple cartridges, it is assumed that there are 3 cartridges, 2 of which are in contact with each other. And (3) firstly, carrying out contour extraction on the obtained foreground binary image in the step (1) to obtain 2 medicine box contours, wherein one of the 2 medicine box contours is a multi-medicine box contour with 2 mutually contacted medicine boxes. The contour points are reduced by a polygonal fitting function, approxboldp, with a precision threshold of 0.001 to linearize the edges. The contour convex hull is computed using a convex hull detection function convexHull. The convex polygon is rendered using a non-concave rendering function convex hull rendering function fillconvex (x) dot. The use of a simple contouring function drawContours allows the thickening of the multi-box contours to reduce meaningless concave regions. The resulting convex polygon minus the thickened outline is used to obtain a plurality of concave regions as shown in FIG. 6. And then, solving the contour of the concave area and solving the corner by using a polygonal fitting function approxPolyDP to reduce the number of contour points of the concave area and reduce the calculation amount. At this time, one concave area is represented as a polygon, the distance between the nearest corner points of the two polygons is the shortest distance of the concave area, and the two corner points are the required concave point pairs. And circularly obtaining the concave point pair of each concave area and the nearest concave area. The two-value maps of the partitioned foreground and foreground are obtained by using the pits to obtain two-value maps of the medicine boxes which are not in contact with each other, as shown in FIG. 7. This method is more suitable for separating a plurality of cartridges which are in small contact, but for example, only 2 cartridges can be separated for cartridges with their edges abutting each other, but this method is not suitable for cartridges with a plurality of cartridges in close contact. The method still has use significance for the fact that the number of the medicine boxes tested simultaneously in the actual application scene is small and the program time is short.
(4) And extracting the outline of the medicine box. And (4) extracting the outline of the binary image obtained in the step (3), and performing rotary cutting on the to-be-processed medicine box picture obtained in the step (2) by using the extracted outline to obtain the to-be-processed medicine box picture. And acquiring a binary image contour by using a contour detection function findContours, and acquiring the minimum circumscribed rectangle angle, length, width and central point information of the contour by using a minimum circumscribed rectangle detection function minAreaRect. The information is used for the medicine box picture to be processed obtained in the step (2), the length and the width are disordered due to direct rotation, the picture is inclined to 0 degrees when the angle is close to 0 degrees, and the picture is inclined to +/-90 degrees when the angle is close to +/-90 degrees. The medicine box is prevented from exceeding the boundary of the original picture after being rotated to carry out proper length and width filling on the original picture. The medicine box in the picture to be processed obtained in the step (2) is cut and stored by using the method as shown in figure 8.
(5) orb the algorithm extracts feature points. And (4) extracting the characteristic points of the picture of the medicine box to be detected obtained in the step (4). The default is 500 feature points. orb algorithm has the main advantage of greatly improving the speed of finding the characteristic points while keeping the required matching accuracy, and meeting the practical application requirements.
(6) The characteristic point comparison algorithm BFMatcher algorithm is used for matching and comparing with the characteristic points of the medicine boxes to be detected as shown in figure 9, a vector difference of 0.75 times is used as a matching threshold value, the medicine boxes can be considered to be matched if the number of the matched characteristic points is generally higher than 40, a complete matching indication or an error indication is returned according to the medicines and the number shown by a medicine sheet, the execution speed of the BFMatcher algorithm is not as high as that of an F L ANN algorithm, and only the step back is carried out if the type of the characteristic points generated by the orb algorithm is not matched with that required by the F L ANN algorithm.
Through the effect of multiple tests and verifications, the method can extract the medicine box placed by the camera into the picture of the medicine box to be tested within 0.5s, can complete the whole process within 0.8s for a single medicine box to realize medicine box matching, and can be used in practical application scenes.
Although illustrative embodiments of the present invention have been described above to facilitate the understanding of the present invention by those skilled in the art, it should be understood that the present invention is not limited to the scope of the embodiments, but various changes may be apparent to those skilled in the art, and it is intended that all inventive concepts utilizing the inventive concepts set forth herein be protected without departing from the spirit and scope of the present invention as defined and limited by the appended claims.
Claims (4)
1. A medicine box recognition system based on prospect extraction and feature point matching is characterized by comprising: the prospect draws module, contacts the medicine box and cuts apart the module, cuts out save module, characteristic point and draws module, characteristic point comparison module, wherein:
a foreground extraction module: the system is used for starting to extract the foreground after receiving the medicine order, compressing the picture returned by the camera to be within 20 ten thousand pixels, and recording the picture returned by the camera and the foreground extraction binary image after the medicine box enters the visual field of the camera and is stable;
a contact cartridge partitioning module: the foreground extraction binary image processing module is used for extracting the outline of the foreground extraction binary image output by the foreground extraction module, screening out the outline with the image proportion lower than 1/20, performing linear fitting on the residual outline to form a closed graph, considering that the non-convex graph is a plurality of medicine boxes, and performing segmentation processing on the closed graph; outputting a binary image after the segmentation processing is finished;
a cutting and storing module: the processing unit is used for performing rotary cutting processing on the picture returned by the camera by taking the processed binary image as a contour basis and outputting a medicine box picture;
the characteristic point extraction and comparison module: the medicine box matching processing module is used for extracting the characteristic points of the medicine box pictures output by the cutting storage module, extracting corresponding medicine box characteristic point data from the database according to the medicine list, circularly comparing and returning the matching condition of the medicine boxes, and indicating that the medicines do not meet the requirement of the medicine list.
2. A medicine box identification method based on foreground extraction and feature point matching is characterized by comprising the following steps:
step (1), setting a medicine box identification device, including setting the distance between a camera of the identification device and a background and a shooting mode;
step (2), extracting a section of the medicine box from the foreground, placing the target medicine box in a camera view field, acquiring a medicine box image by the camera, acquiring a foreground binary image by using a foreground extraction algorithm after the image is reduced to be within a preset size, starting updating an image background model when the medicine box enters the camera view field, starting updating the background model to stop updating as a process that the medicine box enters the camera view field, stopping updating the background model as a basis for stopping the foreground extraction algorithm, outputting a picture returned by the camera at the moment, amplifying the binary image returned by the foreground extraction algorithm to the original size and outputting the amplified binary image, wherein the average time required by each frame of the algorithm is less than 50 ms;
step (3) concave point cutting and separating contact medicine boxes, and for the situation that partial medicine boxes are in contact in the situation of a plurality of medicine boxes, firstly carrying out contour extraction on the foreground binary image obtained in the step (2) and removing the mistaken foreground contour of the algorithm caused by light change with the image ratio lower than 1/20 to obtain a plurality of contours, wherein the contours of the plurality of medicine boxes in mutual contact exist; utilizing a polygonal fitting function to enable the edge of the polygonal fitting function to be linear, and utilizing a convex hull detection function to calculate a contour convex hull; drawing convex polygons by using a non-concave drawing function, thickening original contour lines by using a contour drawing function on the contours of the multi-medicine box to perform simple edge region curvilinearization so as to reduce the operation complexity, subtracting the thickened contours from the obtained convex polygons to obtain a plurality of concave regions, then solving the contours of the concave regions, solving angular points by using a polygonal fitting function to reduce the number of contour points of the concave regions, and reducing the calculated amount, wherein at the moment, one concave region is expressed as a polygon, the distance between the nearest angular points of the two polygons is the shortest distance of the concave regions, and the two angular points are the solved concave point pairs; circularly obtaining a pit point pair of each pit area and the nearest pit area; utilizing the concave point pair to divide the foreground binary image to obtain mutually non-contact medicine box binary images;
extracting the outline of the medicine box according to the outline in the step (4), extracting the outline of the binary image obtained in the step (3), rotationally cutting the picture of the medicine box to be processed obtained in the step (2) by using the extracted outline to obtain the picture of the medicine box to be processed, obtaining the outline of the binary image by using an outline detection function, obtaining the minimum external rectangle angle, length, width and central point information of each outline by using a minimum external rectangle detection function, applying the information to the picture of the medicine box to be processed obtained in the step (2), rotating to 0 degrees when the angle is close to 0 degrees, rotating to +/-90 degrees when the angle is close to +/-90 degrees to enable the required rotation amplitude of the medicine box to be lower than 45 degrees, preventing the medicine box from exceeding the boundary of the original picture after rotating to perform proper length and width filling on the original picture, and cutting and storing the picture of the medicine box to;
step (5) extracting the medicine box features by using an orb feature extraction algorithm, and defaulting the number of extracted features to be 500;
and (6) comparing the characteristic points by using a characteristic point comparison function BFMatcher, comparing the picture characteristics obtained from the database with the characteristics of the to-be-detected medicine box obtained from orb by using the characteristic point comparison function BFMatcher to obtain a matched medicine box, and returning a complete matching indication or indicating errors according to the medicines and the quantity shown in the medicine list.
3. The medicine box identification method based on foreground extraction and feature point matching as claimed in claim 2, wherein:
the identification device is as follows: the camera is located the background board top, and the background board is pure black, and the target medicine box is placed on the background board.
4. The medicine box identification method based on foreground extraction and feature point matching as claimed in claim 2, wherein:
the identification device is as follows: including the operation panel, the operation panel below is arranged in to the camera, and the medicine is placed in the operation panel top, from upwards shooing down, and the image cross-section that the medicine box was drawed is downward, sets up the mesa distance according to the camera focus.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010227943.3A CN111462165A (en) | 2020-03-27 | 2020-03-27 | Medicine box identification system and method based on foreground extraction and feature point matching |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010227943.3A CN111462165A (en) | 2020-03-27 | 2020-03-27 | Medicine box identification system and method based on foreground extraction and feature point matching |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111462165A true CN111462165A (en) | 2020-07-28 |
Family
ID=71683301
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010227943.3A Pending CN111462165A (en) | 2020-03-27 | 2020-03-27 | Medicine box identification system and method based on foreground extraction and feature point matching |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111462165A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112184674A (en) * | 2020-09-30 | 2021-01-05 | 苏州艾隆科技股份有限公司 | Medicine detection method and device, electronic terminal and storage medium |
CN113139401A (en) * | 2021-06-21 | 2021-07-20 | 南京云联数科科技有限公司 | Method for drug recovery, computing device, drug recovery apparatus and medium |
CN113436080A (en) * | 2021-06-30 | 2021-09-24 | 平安科技(深圳)有限公司 | Seal image processing method, device, equipment and storage medium |
CN114191219A (en) * | 2022-01-17 | 2022-03-18 | 牡丹江医学院 | Intelligent dressing change system for nursing |
CN114789870A (en) * | 2022-05-20 | 2022-07-26 | 深圳市信成医疗科技有限公司 | Innovative modular drug storage management implementation mode |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106980852A (en) * | 2017-03-22 | 2017-07-25 | 嘉兴闻达信息科技有限公司 | Based on Corner Detection and the medicine identifying system matched and its recognition methods |
CN107213019A (en) * | 2017-06-01 | 2017-09-29 | 张坚 | Medicine distributing device and method |
CN108176604A (en) * | 2017-12-25 | 2018-06-19 | 华中科技大学同济医学院附属协和医院 | The drug sorting system and method for a kind of automation |
CN110264480A (en) * | 2018-03-12 | 2019-09-20 | 株式会社理光 | A kind of method, apparatus and computer readable storage medium of image segmentation |
CN110599512A (en) * | 2019-08-25 | 2019-12-20 | 南京理工大学 | Medicine name identification method and system based on image identification |
-
2020
- 2020-03-27 CN CN202010227943.3A patent/CN111462165A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106980852A (en) * | 2017-03-22 | 2017-07-25 | 嘉兴闻达信息科技有限公司 | Based on Corner Detection and the medicine identifying system matched and its recognition methods |
CN107213019A (en) * | 2017-06-01 | 2017-09-29 | 张坚 | Medicine distributing device and method |
CN108176604A (en) * | 2017-12-25 | 2018-06-19 | 华中科技大学同济医学院附属协和医院 | The drug sorting system and method for a kind of automation |
CN110264480A (en) * | 2018-03-12 | 2019-09-20 | 株式会社理光 | A kind of method, apparatus and computer readable storage medium of image segmentation |
CN110599512A (en) * | 2019-08-25 | 2019-12-20 | 南京理工大学 | Medicine name identification method and system based on image identification |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112184674A (en) * | 2020-09-30 | 2021-01-05 | 苏州艾隆科技股份有限公司 | Medicine detection method and device, electronic terminal and storage medium |
WO2022067913A1 (en) * | 2020-09-30 | 2022-04-07 | 苏州艾隆科技股份有限公司 | Medicine test method and apparatus, electronic terminal, and storage medium |
CN113139401A (en) * | 2021-06-21 | 2021-07-20 | 南京云联数科科技有限公司 | Method for drug recovery, computing device, drug recovery apparatus and medium |
CN113139401B (en) * | 2021-06-21 | 2021-09-17 | 南京云联数科科技有限公司 | Method for drug recovery, computing device, drug recovery apparatus and medium |
CN113436080A (en) * | 2021-06-30 | 2021-09-24 | 平安科技(深圳)有限公司 | Seal image processing method, device, equipment and storage medium |
CN114191219A (en) * | 2022-01-17 | 2022-03-18 | 牡丹江医学院 | Intelligent dressing change system for nursing |
CN114191219B (en) * | 2022-01-17 | 2023-06-06 | 牡丹江医学院 | Intelligent dressing change system for nursing |
CN114789870A (en) * | 2022-05-20 | 2022-07-26 | 深圳市信成医疗科技有限公司 | Innovative modular drug storage management implementation mode |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111462165A (en) | Medicine box identification system and method based on foreground extraction and feature point matching | |
CN107292248B (en) | Commodity management method and system based on image recognition technology | |
CN108009602B (en) | Book positioning method based on bar code identification, electronic equipment and storage medium | |
CN103310256B (en) | The preparation of the continuous antifalsification label in kind based on image comparison and discrimination method | |
CN102163291B (en) | Laser marking multi-encrypted two-dimensional code fingerprint anti-counterfeit authentication method and system | |
CN102930440B (en) | A kind ofly by internet, method that is false proof and discrimination is carried out to commodity | |
CN109472337B (en) | Label anti-counterfeiting method and device based on random characteristics | |
CN113379720B (en) | Tea cake anti-counterfeiting method based on tea cake image feature code | |
CN110428028B (en) | Identification and verification method, device, equipment and medium based on quasi-dynamic laser label | |
CN103745247A (en) | Mark and anti-fake identification method | |
CN111353540B (en) | Commodity category identification method and device, electronic equipment and storage medium | |
CN110533704B (en) | Method, device, equipment and medium for identifying and verifying ink label | |
CN114092108A (en) | Method for identifying authenticity of Pu' er tea | |
CN111598076B (en) | Method and device for detecting and processing date in label image | |
CN109034694A (en) | Raw materials for production intelligent storage method and system based on intelligence manufacture | |
CN112232336A (en) | Certificate identification method, device, equipment and storage medium | |
CN111160331A (en) | Anti-counterfeit label authentication method, device, medium and template graph generation method | |
JP6628336B2 (en) | Information processing system | |
CN110619060B (en) | Cigarette carton image database construction method and cigarette carton anti-counterfeiting query method | |
JP7449505B2 (en) | information processing system | |
CN115187795A (en) | Tea cake anti-counterfeiting identification method | |
CN110689005A (en) | Commodity identification method based on deep learning fusion position and shape information | |
CN115661624A (en) | Digital method and device for goods shelf and electronic equipment | |
CN115619320A (en) | Product external packing informatization error-preventing system | |
CN115035533A (en) | Data authentication processing method and device, computer equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20200728 |
|
WD01 | Invention patent application deemed withdrawn after publication |