Search

CN-121971294-A - Quantitative liquid medicine suction method and device based on machine vision

CN121971294ACN 121971294 ACN121971294 ACN 121971294ACN-121971294-A

Abstract

The invention discloses a quantitative liquid medicine suction method and device based on machine vision, and belongs to the technical fields of image recognition technology and intelligent medicine dispensing technology. Compared with the prior art, the intelligent liquid medicine suction device has the advantages that whether the liquid medicine suction stroke is reached or not is judged through the liquid medicine suction quantity, errors caused by different liquid level heights at different angles and liquid level fluctuation in a middle side process caused by taking the liquid level as a detection standard are avoided, so that the intelligent liquid medicine suction reliability is improved, the liquid medicine suction device is shot at multiple angles in real time, errors caused by different liquid medicine suction quantity monitoring results in a medicine bottle caused by a single angle are avoided, the intelligent liquid medicine suction reliability is further improved, the calculation of the liquid medicine suction quantity is simultaneously realized through the medicine bottle and an aspirator piston, the aspirator is prevented from being failed, and errors caused by only running but not extracting the liquid medicine are further improved.

Inventors

  • FU XIAOYANG
  • TAN LILI
  • LIAO WEN

Assignees

  • 美蓝(杭州)医药科技有限公司

Dates

Publication Date
20260505
Application Date
20260123

Claims (10)

  1. 1. A machine vision-based quantitative aspiration method for a liquid drug, the method comprising: After the liquid medicine starts to be sucked, a plurality of images of the liquid medicine extracting device are photographed in real time through a camera at multiple angles; identifying a plurality of partial images of the plurality of images including a vial and an aspirator piston; Calculating a plurality of liquid medicine extraction amounts and a plurality of aspirator piston activities indicated by the plurality of partial images, respectively; Judging whether an extraction stroke is reached or not according to the average liquid medicine extraction amount obtained by the liquid medicine extraction amounts and the average aspirator piston activity amount obtained by the aspirator piston activity amounts, wherein the extraction stroke is used for indicating the medicine bottle capacity and the aspirator piston activity amount required when the current target liquid medicine extraction amount is extracted; If yes, stopping sucking, and replacing the medicine bottle or the aspirator; otherwise, the vial is replaced and extraction is continued.
  2. 2. The method of claim 1, wherein the method further comprises, prior to the initiation of aspiration of the medical fluid: The extraction stroke is calculated based on the vial capacity and the maximum aspirator piston activity.
  3. 3. The method of claim 1, wherein the identifying a plurality of partial images of the plurality of images including a vial and an aspirator piston comprises: identifying a vial image of the plurality of images; identifying a base point and an edge point of a vial in a plurality of said vial images; identifying an aspirator piston image of the plurality of images; and identifying the base points and the edge points of the aspirator pistons in the plurality of aspirator piston images.
  4. 4. A method according to claim 3, characterized in that the method further comprises: If the base point position of the medicine bottle is in a first position threshold interval and the distance between the base point and the edge point of the medicine bottle is in a first distance threshold interval, judging that the base point of the medicine bottle is credible, otherwise, judging that the base point of the medicine bottle is not credible; If the base point of the aspirator piston is in a second position threshold interval and the distance between the base point and the edge point of the aspirator piston is in a second distance threshold interval, the base point of the aspirator piston is determined to be credible, otherwise, the base point of the aspirator piston is determined to be not credible.
  5. 5. A method according to claim 3, wherein said calculating a plurality of medical fluid extraction amounts respectively indicated by the plurality of partial images comprises: Calculating a first distance between a base point and an edge point of the medicine bottle, and calculating a first liquid medicine extraction amount corresponding to the first distance according to the capacity of the medicine bottle; And calculating a second distance between the base point and the edge point of the aspirator piston, and calculating a second liquid medicine extraction amount corresponding to the second distance according to the maximum extraction amount of the aspirator.
  6. 6. The method of claim 5, wherein determining whether an extraction stroke is reached based on an average of the plurality of drug solution extraction amounts comprises: For the current single image, if the extraction amount difference between the first liquid medicine extraction amount and the second liquid medicine extraction amount is smaller than a first error threshold value, recording the first liquid medicine extraction amount, otherwise, not recording the first liquid medicine extraction amount; Continuing to judge whether the extraction amount difference value between the first liquid medicine extraction amount and the second liquid medicine extraction amount corresponding to the next single image is smaller than the first error threshold value or not until the last image; averaging the recorded plurality of first liquid medicine extraction amounts to obtain an average liquid medicine extraction amount; And judging whether the error between the average liquid medicine extraction amount and the extraction stroke is smaller than a second error threshold value, if so, judging that the extraction stroke is reached, and if not, judging that the extraction stroke is not reached.
  7. 7. The method of claim 5, wherein determining whether an extraction stroke is reached based on an average of the plurality of drug solution extraction amounts comprises: Acquiring a correlation curve between the extraction travel and time; if the average liquid medicine extraction amount in the current time accords with the correlation curve, judging that the extraction stroke is reached, otherwise, judging that the extraction stroke is not reached.
  8. 8. The method according to claim 6 or 7, wherein the determining whether the withdrawal stroke is reached based on the average withdrawal amount of the plurality of withdrawal amounts of the liquid medicine further comprises: and if the extraction amount difference value between the first liquid medicine extraction amount and the second liquid medicine extraction amount corresponding to all the plurality of images is larger than the first error threshold value, recording the average value corresponding to the extraction amount difference values.
  9. 9. The method of claim 5, wherein the changing the vial and continuing to withdraw comprises: calculating the current liquid medicine extraction amount according to the first liquid medicine extraction amount and the second liquid medicine extraction amount; and calculating the target liquid medicine extraction amount indicated by the next extraction stroke according to the current liquid medicine extraction amount.
  10. 10. The utility model provides a liquid medicine ration suction device based on machine vision, its characterized in that, liquid medicine ration suction device includes liquid medicine extraction device and the camera that different angles were shot, the camera is used for shooing liquid medicine extraction device, liquid medicine extraction device still includes aspirator, aspirator piston and medicine bottle, the device still includes: after the liquid medicine starts to be sucked, the camera shoots a plurality of images of the liquid medicine extracting device in real time at multiple angles; The identifying module is used for identifying a plurality of partial images comprising the aspirator piston and the aspirator piston in the plurality of images; a calculating module for calculating a plurality of liquid medicine extraction amounts indicated by the plurality of partial images respectively; the judging module is used for judging whether the extraction stroke is reached or not according to the average liquid medicine extraction amount obtained by the liquid medicine extraction amounts; the device also comprises a control module; If the judging module judges that the extraction stroke is reached, the control module is used for stopping the suction and prompting the replacement of the medicine bottle or the replacement of the aspirator; And if the judging module judges that the extraction stroke is not reached, the control module is used for replacing the medicine bottle and continuing to extract.

Description

Quantitative liquid medicine suction method and device based on machine vision Technical Field The invention relates to the technical fields of image recognition technology and intelligent dispensing technology, in particular to a quantitative liquid medicine suction method and device based on machine vision. Background In an intelligent medicine dispensing system, intelligent suction of medicine liquid is a key ring, the suction of the medicine liquid is usually automatically realized by a medicine liquid suction device, and as the medicine dispensing has high requirements for grasping the medicine amount, how to accurately realize quantitative suction of the medicine liquid is always a concern. In the prior art, the height of the residual liquid medicine in the container is calculated by shooting an image of the transparent container and analyzing the image, and the extracted medicine quantity can be calculated by combining the total height of the liquid medicine in the medicine bottle. However, in the existing visual detection method, no matter the medicine bottle is detected or the medicine liquid extractor is detected, the liquid level is usually used as a detection reference, and certain difference may exist in the height of the liquid level from different directions, so that larger errors easily occur in the existing detection method, and the reliability of intelligent medicine liquid suction is reduced. In addition, because in the process of sucking, the liquid level is unstable due to the fact that vibration or shaking can possibly occur, and in this case, the liquid level is unstable, and in addition, different image acquisition visual angles are adopted, for example, the measurement of the height of the liquid level can be influenced by the look-up or overlook of a person, so that the reliability of intelligent liquid medicine sucking is further reduced. Disclosure of Invention In order to solve the problems in the prior art, the invention provides a liquid medicine quantitative suction method and device based on machine vision, comprising the following steps: in one aspect, a machine vision-based method for quantitative aspiration of a medical fluid is provided, the method comprising: After the liquid medicine starts to be sucked, a plurality of images of the liquid medicine extracting device are photographed in real time through a camera at multiple angles; identifying a plurality of partial images of the plurality of images including a vial and an aspirator piston; Calculating a plurality of liquid medicine extraction amounts and a plurality of aspirator piston activities indicated by the plurality of partial images, respectively; Judging whether an extraction stroke is reached or not according to the average liquid medicine extraction amount obtained by the liquid medicine extraction amounts and the average aspirator piston activity amount obtained by the aspirator piston activity amounts, wherein the extraction stroke is used for indicating the medicine bottle capacity and the aspirator piston activity amount required when the current target liquid medicine extraction amount is extracted; If yes, stopping sucking, and replacing the medicine bottle or the aspirator; otherwise, the vial is replaced and extraction is continued. Optionally, before the suction of the liquid medicine is started, the method further comprises: The extraction stroke is calculated based on the vial capacity and the maximum aspirator piston activity. Optionally, the identifying the plurality of partial images including the drug vial and the aspirator piston in the plurality of images includes: the identifying a portion of the plurality of images that includes a vial includes: identifying a vial image of the plurality of images; identifying a base point and an edge point of a vial in a plurality of said vial images; identifying an aspirator piston image of the plurality of images; and identifying the base points and the edge points of the aspirator pistons in the plurality of aspirator piston images. Optionally, the method further comprises: If the base point position of the medicine bottle is in a first position threshold interval and the distance between the base point and the edge point of the medicine bottle is in a first distance threshold interval, judging that the base point of the medicine bottle is credible, otherwise, judging that the base point of the medicine bottle is not credible; If the base point of the aspirator piston is in a second position threshold interval and the distance between the base point and the edge point of the aspirator piston is in a second distance threshold interval, the base point of the aspirator piston is determined to be credible, otherwise, the base point of the aspirator piston is determined to be not credible. Optionally, the calculating the plurality of liquid medicine extraction amounts respectively indicated by the plurality of partial images includes: Calculating a first di