Label positioning method and device for medical tube and blood collection vehicle
By using image recognition technology to accurately locate the edge of medical tube labels, the problem of low positioning accuracy and sensor damage to the collected items in existing technologies has been solved, achieving automated and rapid labeling.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN NUBOMED EQUIP
- Filing Date
- 2023-06-20
- Publication Date
- 2026-05-19
AI Technical Summary
Existing technologies for labeling medical tubes have low positioning accuracy, especially for semi-transparent and transparent labels. Furthermore, some sensor signals may damage the medical items being labeled, making manual labeling time-consuming and labor-intensive.
Image recognition technology is used to acquire images of medical tubes in real time. By fitting straight lines and calculating the set of sampling points, the edge of the label is accurately located, and the medical tube is rotated to the correct position for labeling.
It improves the accuracy and efficiency of medical tube label positioning, avoids damage to the collected items by sensor signals, and realizes automated and rapid labeling.
Smart Images

Figure CN116824561B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of next-generation information technology and biomedical industry technology, and in particular to a label positioning method, device and blood collection vehicle for medical tubes. Background Technology
[0002] Medical tubes are generally used to collect medical supplies, such as blood collection tubes. They have an original label set at the factory. In order to distinguish the collected blood, it is sometimes necessary to re-label the original label. Therefore, it is necessary to position the original label so that a new label can be affixed to the blank space of the original label, or to cover the original label of the blood collection tube with a new label.
[0003] Existing solutions mainly involve manual labeling of medical tubes, which is time-consuming and labor-intensive. Equipment that can automate labeling, such as medical blood collection vehicles, can monitor and calculate the position of the label by rotating the blood collection tube and installing sensors next to it. However, the sensors have low detection accuracy and cannot accurately locate and detect semi-transparent and transparent labels. Furthermore, when collecting medical items, the chemical properties of the collected medical items may cause some sensors to emit signals, such as ultraviolet light or lasers, which may damage the collected medical items. Summary of the Invention
[0004] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a method, device, and blood collection vehicle for label positioning of medical tubes, which can locate the edge of the label of medical tubes through image recognition, thereby improving work efficiency.
[0005] To solve the above-mentioned technical problems, the present invention proposes the following technical solution:
[0006] The first aspect of this application provides a method for label positioning of medical tubes, including:
[0007] The image of the medical tube is acquired in real time, and the image is preprocessed to obtain the target image;
[0008] The target image is fitted with a straight line to obtain the upper edge, lower edge, and label edge;
[0009] A first set of sampling points is obtained by selecting a number of sampling points between the upper edge and the edge of the label in the target image, and a second set of sampling points is obtained by selecting a number of sampling points between the lower edge and the edge of the label in the target image.
[0010] The label positioning information is obtained based on the image information in the first set of sampling points and the second set of sampling points.
[0011] The label positioning method for medical tubes according to the first aspect of this application has at least the following beneficial effects: The label positioning method for medical tubes of this application can acquire images of medical tubes in real time, and perform image recognition based on the images of medical tubes to obtain the upper edge, lower edge and label edge in the image of medical tubes. Then, it calculates based on the upper edge, lower edge and label edge to quickly locate the label edge of the medical tube, that is, to obtain the label positioning information. The label edge of the medical tube is located by image recognition, which improves work efficiency.
[0012] According to some embodiments of the first aspect of this application, the image information includes pixel values, brightness values, or grayscale values, and the method further includes:
[0013] The medical tube is controlled to rotate, and when the label positioning information is obtained, the medical tube is controlled to stop rotating;
[0014] Send a labeling instruction to an external labeling device.
[0015] According to some embodiments of the first aspect of this application, the target image includes a binarized image, and the preprocessing of the image to obtain the target image includes:
[0016] The image is converted to grayscale to obtain a grayscale image;
[0017] The grayscale image is subjected to noise reduction processing to obtain a noise-reduced image;
[0018] The denoised image is binarized to obtain a binarized image.
[0019] According to some embodiments of the first aspect of this application, the step of selecting a plurality of sampling points between the upper edge and the label edge in the target image to obtain a first sampling point set, and selecting a plurality of sampling points between the lower edge and the label edge in the target image to obtain a second sampling point set, includes:
[0020] Obtain the coordinates of several sampling points on the line segment from the upper edge to the midpoint of the label edge to obtain a first coordinate set; obtain the coordinates of several sampling points on the line segment from the lower edge to the midpoint of the label edge to obtain a second coordinate set.
[0021] According to some embodiments of the first aspect of this application, obtaining tag positioning information based on image information in the first set of sampling points and the second set of sampling points includes:
[0022] A first grayscale value set is obtained by calculating based on the first coordinate set and the binarized image; a second grayscale value set is obtained by calculating based on the second coordinate set and the binarized image.
[0023] By comparing the average value of the first grayscale value set with the average value of the second grayscale value set, the label positioning information is obtained.
[0024] According to some embodiments of the first aspect of this application, the step of comparing the average value of the first grayscale value set and the average value of the second grayscale value set to obtain tag positioning information includes:
[0025] When the second grayscale average value is greater than the first grayscale average value, the label positioning information is output as being close to the upper edge of the tube;
[0026] When the first grayscale average value is greater than the second grayscale average value, the label positioning information is output as being close to the lower edge of the tube.
[0027] According to some embodiments of the first aspect of this application, controlling the rotation of the medical tube, and stopping the rotation of the medical tube when the label positioning information is obtained, includes:
[0028] Calculate the vertical distance between the upper edge and the lower edge, and obtain the centerline distance based on the vertical distance, wherein the centerline distance is half of the vertical distance;
[0029] When the label positioning information is close to the upper edge of the tube, the length of the vertical line segment from the upper edge to the midpoint of the label edge is calculated. When the difference between the length and the midline distance meets a preset range, the medical tube is controlled to stop rotating.
[0030] When the label positioning information indicates that the tube is close to the lower edge of the tube, the medical tube is controlled to continue rotating.
[0031] According to some embodiments of the first aspect of this application, when the label positioning information is close to the upper edge of the tube, calculating the length of the vertical line segment from the upper edge to the midpoint of the label edge, and controlling the medical tube to stop rotating when the difference between the length and the midline distance meets a preset range, further includes:
[0032] When the label positioning information is close to the upper edge of the tube, and the length at the previous moment is greater than the length at the current moment, and the length at the current moment is greater than the centerline distance, control the tube to rotate upwards until the difference between the length at the current moment and the centerline distance meets a preset range, and control the medical tube to stop rotating.
[0033] When the label positioning information indicates that the tube is close to the upper edge of the tube, and the current length is simultaneously less than the previous length and the distance to the centerline, the tube is controlled to rotate downwards until the difference between the current length and the distance to the centerline meets a preset range, at which point the medical tube stops rotating.
[0034] A second aspect of this application provides a label positioning device for a medical tube, comprising:
[0035] A labeling box includes a box body, a partition, and a lighting lamp. The partition has a light-transmitting groove, which is located below the medical tube. The lighting lamp is located below the light-transmitting groove and faces the light-transmitting groove.
[0036] An electric motor is used to control the rotation of the medical tube;
[0037] A camera, positioned above the medical tube, is used to acquire images of the medical tube;
[0038] A controller for performing the label positioning method for medical tubes as described in the first aspect of this application.
[0039] A third aspect of this application provides a blood collection vehicle, including a labeling device and a label positioning device as described in the second aspect of this application. The labeling device is disposed on the side of the medical tube and is used to label the medical tube according to the label positioning information when it receives a labeling instruction sent by the label positioning device.
[0040] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0041] Additional aspects and advantages of this application will become apparent and readily understood in conjunction with the following description of the embodiments, in which:
[0042] Figure 1 The main flowchart of a label positioning method for medical tubes provided in an embodiment of this application;
[0043] Figure 2 A sub-flowchart of a label positioning method for a medical tube provided in an embodiment of this application;
[0044] Figure 3 A sub-flowchart of a label positioning method for a medical tube provided in another embodiment of this application;
[0045] Figure 4 A sub-flowchart of a label positioning method for a medical tube provided in another embodiment of this application;
[0046] Figure 5 A sub-flowchart of a label positioning method for a medical tube provided in another embodiment of this application;
[0047] Figure 6 This is a schematic diagram of the label positioning device for medical tubes according to this application;
[0048] Figure 7 The label location information of the medical tube at the previous moment and the label location information of the medical tube at the current moment are provided in an embodiment of this application;
[0049] Figure 8 The label location information of the medical tube at the previous moment and the label location information of the medical tube at the current moment are provided for another embodiment of this application;
[0050] Figure 9 This application provides the label location information of the medical tube at the previous moment and the label location information of the medical tube at the current moment, which are provided in another embodiment of the present application.
[0051] Reference numerals in the attached drawings: label positioning device 600; labeling box 610; box body 611; partition 612; lighting lamp 613; light transmission groove 614; camera 615. Detailed Implementation
[0052] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0053] It should be noted that although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown in the flowchart. The terminology in the specification, claims, and the foregoing figures is used to distinguish similar objects and is not necessarily used to describe a specific order or sequence.
[0054] In the description of this application, the use of "first" and "second" is for the purpose of distinguishing technical features only, and should not be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated or the order of the technical features indicated.
[0055] In the description of this application, unless otherwise expressly defined, terms such as "setup," "installation," and "connection" should be interpreted broadly, and those skilled in the art can reasonably determine the specific meaning of the above terms in this application in conjunction with the specific content of the technical solution.
[0056] Reference Figure 1 In a first aspect, embodiments of this application provide a label positioning method for medical tubes, including but not limited to steps S110, S120, S130, and S140.
[0057] Step S110: Acquire images of the medical tube in real time, preprocess the images to obtain the target image;
[0058] Step S120: Perform line fitting on the target image to obtain the upper edge, lower edge, and label edge;
[0059] Step S130: Select a number of sampling points between the upper edge and the label edge in the target image to obtain a first sampling point set, and select a number of sampling points between the lower edge and the label edge in the target image to obtain a second sampling point set;
[0060] Step S140: Obtain tag positioning information based on the image information in the first sampling point set and the second sampling point set.
[0061] It should be noted that automated blood collection vehicles typically collect blood using transparent medical tubes. These tubes come with an original label. To differentiate the collected blood, the edge of the original label needs to be rotated to a specific position for secondary labeling, covering the original label on the medical tube. During this secondary labeling, the equipment needs to locate the transparent area to prevent the new label from obscuring it. Current solutions involve installing sensors next to the blood collection tubes to monitor and calculate the label's position. However, these sensors have low accuracy and cannot precisely detect semi-transparent or transparent labels. Furthermore, when collecting medical items, the chemical properties of the collected items mean that some sensors emit signals such as ultraviolet light or lasers, which may damage the collected medical items.
[0062] The label positioning method for medical tubes in this application is applied to an edge-finding positioning device. The edge-finding positioning device includes an infrared imaging camera 615, a medical tube shelf, a light-transmitting window, and a light-diffusing plate. The light-diffusing window has an opening, and the medical tube shelf is located at the opening, allowing the medical tubes to be placed on the shelf. Below the light-diffusing window, there is a light-diffusing plate and an infrared LED. The light from the infrared LED shines through the light-diffusing plate onto the light-diffusing window, enabling the infrared imaging camera 615 to more clearly capture images of the medical tubes placed on the shelf. The device also includes a motor electrically connected to the medical tube shelf, which can drive the medical tubes placed on the shelf to rotate. The infrared imaging camera 615 is located above the medical tube shelf and can take pictures of the rotating medical tubes and upload the images of the medical tubes to a terminal that processes the images of the medical tubes.
[0063] According to one embodiment of this application, the light emitted by the infrared LED shines through a diffuser onto a transparent window, allowing the infrared imaging camera 615 to capture a clearer image of the medical tube. The image is then uploaded in real time, enabling the controller to preprocess the image, removing noise and extracting edge features to obtain a target image containing these features. A Hough algorithm is then used to fit a straight line to the target image, extracting the upper edge, lower edge, and label edge. Several sampling points between the upper edge and the label edge are then collected to obtain a first set of sampling points, and several sampling points between the lower edge and the label edge are collected to obtain a second set of sampling points. The first and second sets of sampling points can consist of ten, hundreds, or thousands of points. After obtaining the first and second sets of sampling points, calculations are performed based on the image information in these sets to determine the label's location, thus obtaining the label positioning information.
[0064] Understandably, after obtaining the label positioning information, this application will also locate the label based on the label positioning information for secondary labeling, thereby improving the labeling speed.
[0065] It should be noted that the label positioning method for medical tubes in this application can acquire images of medical tubes in real time, and perform image recognition based on the images of medical tubes to obtain the upper edge, lower edge and label edge in the image of medical tubes. Then, based on the upper edge, lower edge and label edge, calculations are performed to quickly locate the position of the label, that is, to obtain the label positioning information. The label is automatically applied based on the label positioning information, which improves the labeling efficiency.
[0066] Reference Figure 2 In the first aspect, embodiments of this application provide a label positioning method for medical tubes, including but not limited to steps S210 and S220.
[0067] Step S210: Control the rotation of the medical tube; when the tag positioning information is obtained, control the medical tube to stop rotating.
[0068] Step S220: Send a labeling instruction to an external labeling device.
[0069] According to one embodiment of this application, the image information includes pixel values, brightness values, or grayscale values. After obtaining the label positioning information based on the image information in the first sampling point set and the second sampling point set, this application will further determine the label positioning information and determine whether to label the medical tube based on the label positioning information at the current moment. When the label positioning information is close to the lower edge of the tube, the medical tube is controlled to continue rotating. When the label positioning information is close to the upper edge of the tube, and the difference between the length of the vertical line segment from the upper edge to the midpoint of the label edge and the distance from the midline meets a preset range, the medical tube is controlled to stop rotating, and a labeling instruction is sent to an external labeling device so that the external labeling device labels the medical tube.
[0070] Reference Figure 3 In a first aspect, embodiments of this application provide a label positioning method for medical tubes, including but not limited to steps S310, S320, and S330.
[0071] Step S310: Perform grayscale conversion on the image to obtain a grayscale image;
[0072] Step S320: Denoise the grayscale image to obtain a denoised image;
[0073] Step S330: Binarize the denoised image to obtain a binarized image.
[0074] According to one embodiment of this application, the image of the medical tube is RGB data. After obtaining the image of the medical tube, it is necessary to perform grayscale conversion processing to convert the RGB data into a grayscale image, so as to facilitate the subsequent determination of the grayscale value of each coordinate point by combining the first sampling point set and the second sampling point set. To improve the accuracy of image processing, this application will also perform noise reduction processing on the grayscale image using a preset 3*3 Gaussian kernel to obtain a noise-reduced image. To better extract the upper edge, lower edge, and label edge, this application will also perform edge feature extraction on the noise-reduced image using the Canny operator, and then obtain a target image containing only the upper edge, lower edge, and label edge by using horizontal or vertical differentiation. The target image includes a binarized image. Specifically, this application reduces the noise in the image of the medical tube through preprocessing steps, obtaining a binarized image containing the upper edge, lower edge, and label edge, which facilitates the subsequent extraction of the upper edge, lower edge, and label edge in the binarized image and improves the accuracy of the calculated label positioning information.
[0075] It is understandable that selecting several sampling points between the top edge and the label edge in the target image to obtain a first set of sampling points, and selecting several sampling points between the bottom edge and the label edge in the target image to obtain a second set of sampling points, includes: obtaining the coordinates of several sampling points on the line segment from the top edge to the midpoint of the label edge to obtain a first set of coordinates; obtaining the coordinates of several sampling points on the line segment from the bottom edge to the midpoint of the label edge to obtain a second set of coordinates.
[0076] According to one embodiment of this application, the upper edge refers to the position of the upper edge in the image, the lower edge refers to the position of the lower edge in the image, and the label edge refers to the position of the label edge in the image. After obtaining the upper edge, lower edge, and label edge, this application first calculates the coordinates of the midpoint of the label edge, then calculates the vertical distance from the midpoint of the label edge to the upper edge based on the midpoint of the label edge and the upper edge, and obtains several coordinates on this line segment of vertical distance, i.e., the first coordinate set; similarly, this application also calculates the vertical distance from the midpoint of the label edge to the lower edge, and obtains several coordinates on this line segment of vertical distance, i.e., the second coordinate set.
[0077] Specifically, according to one embodiment of this application, after obtaining the upper edge, lower edge, and label edge, this application will automatically establish a coordinate system and obtain the formulas A1x+B1y+C1=0 for the upper edge, A2x+B2y+C2=0 for the lower edge, and A3x+B3y+C3=0 for the label edge, respectively. Based on these data, the coordinates (x, y) of the midpoint of the label edge can be calculated. Further, this application will also calculate the length PQ1 of the vertical line segment from the upper edge (A1x+B1y+C1=0) to the midpoint of the label edge according to the formula PQ1=|A1x+B1y+C1| / √(A1^2+B1^2). Simultaneously, the coordinates of 10 points on the vertical line segment PQ1 of the vertical line segment from the upper edge to the midpoint of the label edge are collected to obtain the first coordinate set O={O1,O2,O3...O10}. This application will also calculate the length of the vertical line segment from the midpoint of the label edge (x, y) to the lower edge of the formula A2x+B2y+C2=0, based on the formula PQ2=|A2x+B2^2+C2| / √(A2^2+B2^2), and simultaneously collect the coordinates of 10 points on the vertical line segment PQ2 from the lower edge to the midpoint of the label edge, to obtain the second coordinate set O'={O1',O2',O3'...O10'}.
[0078] It should be noted that the "collection of coordinates of 10 points on line segment PQ1" and "collection of coordinates of 10 points on line segment PQ2" mentioned in this application are only for better illustrating the calculation process of this application and do not constitute a limitation on this application. It can be understood that this application can collect 20 points or 30 points on line segment PQ1, as long as it can obtain sufficiently accurate tag positioning information in the future.
[0079] Reference Figure 4 In the first aspect, embodiments of this application provide a label positioning method for medical tubes, including but not limited to steps S410 and S420.
[0080] Step S410: Calculate the first grayscale value set based on the first coordinate set and the binarized image; calculate the second grayscale value set based on the second coordinate set and the binarized image.
[0081] Step S420: Compare the average value of the first grayscale value set with the average value of the second grayscale value set to obtain the label positioning information.
[0082] According to one embodiment of this application, after obtaining the first coordinate set O and the second coordinate set O', this application also needs to substitute the first coordinate set O = {O1, O2, O3... O10} and the second coordinate set O' = {O1', O2', O3'... O10'} into the grayscale image to obtain the corresponding first grayscale value set BO and the second grayscale value set BO', and take the average value of the first grayscale value set BO and the second grayscale value set BO' respectively, and compare the magnitude values.
[0083] Specifically, the grayscale image is divided into 256 levels, with grayscale values ranging from 0 to 255. This means the current grayscale image is similar to a two-dimensional array, where the grayscale value of each pixel is known. For example, if coordinate point O is found, the grayscale value BO of the pixel corresponding to coordinate point O is also known. More specifically, this application first calculates a first grayscale value set BO = {BO1, BO2, BO3...BO10} based on the first coordinate set and the grayscale image. Simultaneously, it calculates a second grayscale value set BO' = {BO1', BO2', BO3'...BO10'} based on the second coordinate set and the grayscale image. Then, it calculates the average values of the first and second grayscale value sets to obtain the first and second average grayscale values. Both the first and second average grayscale values are specific numerical values. This application can obtain tag positioning information based on the magnitude of the first and second average grayscale values.
[0084] Understandably, the label positioning information is obtained by comparing the average value of the first grayscale value set and the average value of the second grayscale value set, including: when the average value of the second grayscale value is greater than the average value of the first grayscale value, the label positioning information is output as being closer to the upper edge of the tube; when the average value of the first grayscale value is greater than the average value of the second grayscale value, the label positioning information is output as being closer to the lower edge of the tube.
[0085] According to one embodiment of this application, areas with smaller grayscale values represent labels, and areas with larger grayscale values represent transparent medical tubes. Based on this, this application determines the magnitude of a first average grayscale value and a second average grayscale value. When the second average grayscale value is greater than the first average grayscale value, the label positioning information is closer to the upper edge of the tube; when the first average grayscale value is greater than the second average grayscale value, the label positioning information is closer to the lower edge of the tube.
[0086] Reference Figure 5 In a first aspect, embodiments of this application provide a label positioning method for medical tubes, including but not limited to steps S510, S520, and S530.
[0087] Step S510: Calculate the vertical distance between the upper and lower edges, and obtain the centerline distance based on the vertical distance, where the centerline distance is half of the vertical distance;
[0088] Step S520: When the label positioning information is close to the upper edge of the tube, calculate the length of the vertical line segment from the upper edge to the midpoint of the label edge. When the difference between the length and the distance to the midline meets the preset range, control the medical tube to stop rotating.
[0089] Step S530: When the label positioning information indicates that the tube is close to the lower edge, control the medical tube to continue rotating.
[0090] According to one embodiment of this application, in order to better perform secondary labeling, this application will also calculate the vertical distance S from the upper edge to the lower edge based on the upper and lower edges, and then calculate the centerline distance L based on the vertical distance S from the upper edge to the lower edge, where L = S / 2. Specifically, when the label positioning information is close to the upper edge of the tube, that is, when the second grayscale average value is greater than the first grayscale average value, and at this time the length of the vertical line segment PQ1 from the upper edge to the midpoint of the label edge is equal to the centerline distance L, the medical tube is controlled to stop rotating and the label is applied to the medical tube. To increase the fault tolerance of this application, when the difference between the length PQ1 of the vertical line segment from the upper edge to the midpoint of the label edge and the distance L from the center line is less than a preset error distance, the medical tube can be controlled to stop rotating, and a labeling command can be sent to the external labeling device, so that the external labeling device can label the medical tube; when the label positioning information is close to the lower edge of the tube, that is, the second grayscale average value is less than the first grayscale average value, and no stop operation or labeling operation is performed at this time, the medical tube continues to rotate until the label positioning information changes to be close to the upper edge of the tube, and the difference between the length PQ1 of the vertical line segment from the upper edge to the midpoint of the label edge and the distance L from the center line is less than the preset error distance, then the medical tube is controlled to stop rotating, and a labeling command can be sent to the external labeling device, so that the external labeling device can label the medical tube.
[0091] Understandably, when the label positioning information is close to the top edge of the tube, the length of the vertical line segment from the top edge to the midpoint of the label edge is calculated. When the difference between the length and the midline distance meets a preset range, the medical tube is controlled to stop rotating. This also includes: when the label positioning information is close to the top edge of the tube, and the length at the previous moment is greater than the length at the current moment, and the length at the current moment is greater than the midline distance, the tube is controlled to rotate upwards until the difference between the current length and the midline distance meets a preset range, at which point the medical tube stops rotating; when the label positioning information is close to the top edge of the tube, and the current length is simultaneously less than both the length at the previous moment and the midline distance, the tube is controlled to rotate downwards until the difference between the current length and the midline distance meets a preset range, at which point the medical tube stops rotating.
[0092] According to one embodiment of this application, the medical tube is generally rotated clockwise, that is, rotated towards the upper edge of the medical tube. When the label causes the medical tube to not stop at the position of the center line due to the machine or other reasons, it is necessary to control the rotation direction of the medical tube so that the label can quickly lock the position of the center line.
[0093] It should be noted that, Figures 7 to 9 The dashed line in the image is the center line, and the shaded area indicates the label's position. (See reference...) Figure 7 , Figure 7This application provides label positioning information for a medical tube at the previous moment and label positioning information for a medical tube at the current moment, as provided in one embodiment. When the second grayscale average value is greater than the first grayscale average value (i.e., the label positioning information is close to the top edge of the tube), and the length of the vertical line segment from the top edge of the tube to the midpoint of the label edge at the previous moment is greater than the length of the vertical line segment from the top edge of the tube to the midpoint of the label edge at the current moment is greater than the centerline distance, the medical tube is controlled to rotate towards the top edge of the medical tube until the difference between the length of the vertical line segment from the top edge of the tube to the midpoint of the label edge at the current moment and the centerline distance meets a preset range, and the medical tube is labeled. (Refer to...) Figure 8 , Figure 8 This application provides label positioning information for a medical tube at a previous moment and label positioning information for a medical tube at the current moment, as part of another embodiment. When the second grayscale average value is greater than the first grayscale average value (i.e., the label positioning information is near the top edge of the tube), and the length of the vertical line segment from the top edge of the tube to the midpoint of the label edge at the previous moment is greater than the centerline distance, which is greater than the length of the vertical line segment from the top edge of the tube to the midpoint of the label edge at the current moment, the medical tube is controlled to rotate towards the bottom edge of the medical tube until the difference between the length of the vertical line segment from the top edge of the tube to the midpoint of the label edge and the centerline distance at the current moment meets a preset range, and the medical tube is labeled. (Refer to...) Figure 9 , Figure 9 This application provides label positioning information for a medical tube at a previous moment and label positioning information for a medical tube at the current moment, as part of another embodiment. When the second grayscale average value is greater than the first grayscale average value (i.e., the label positioning information is close to the top edge of the tube), and the centerline distance is greater than the length of the vertical line segment from the top edge of the tube to the midpoint of the label edge at the previous moment, which is greater than the length of the vertical line segment from the top edge of the tube to the midpoint of the label edge at the current moment, the medical tube is controlled to rotate towards the bottom edge of the medical tube until the difference between the length of the vertical line segment from the top edge of the tube to the midpoint of the label edge at the current moment and the centerline distance meets a preset range, and the medical tube is then labeled. The preset range can be set according to the detailed dimensions of the label and the medical tube.
[0094] Specifically, the above steps are all based on the premise that the second grayscale average value is greater than the first grayscale average value, that is, when the label positioning information is close to the top edge of the tube. At this time, the positional relationship between the label edge and the center line can be determined in time based on the length of the vertical line segment from the top edge of the tube to the midpoint of the label edge at the previous moment, the length of the vertical line segment from the top edge of the tube to the midpoint of the label edge at the current moment, and the center line distance. This ensures that the label edge can quickly reach the center line. Otherwise, the medical tube will continue to rotate in the original direction. If the label edge does not stop in time at the point where the difference between the length of the vertical line segment from the top edge of the tube to the midpoint of the label edge and the center line distance is less than the preset error distance, it can only rotate one more revolution until it reaches the point where the difference between the length of the vertical line segment from the top edge of the tube to the midpoint of the label edge and the center line distance is less than the preset error distance at the next moment. This will reduce the labeling efficiency.
[0095] Secondly, this application discloses a label positioning device 600 for a medical tube, referring to... Figure 6 , Figure 6 This is a schematic diagram of the medical tube label positioning device 600 of this application. It can be understood that the medical tube label positioning device 600 of this application includes: a labeling box 610, including a box body 611, a partition 612, and a lighting lamp 613; the partition 612 has a light-transmitting groove 614, which is located below the medical tube; the lighting lamp 613 is located below the light-transmitting groove 614 and faces the light-transmitting groove 614; a motor for controlling the rotation of the medical tube; and a camera 615, located above the medical tube, for acquiring images of the medical tube.
[0096] A controller for performing a label positioning method for a medical tube as described in the first aspect of this application.
[0097] For example, execute the above description. Figure 1 Method steps S110 to S140 in the text Figure 2 Method steps S210 to S220, Figure 3 Method steps S310 to S330 in the text Figure 4 Method steps S410 to S420 in the text Figure 5 Method steps S510 to S530.
[0098] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0099] Based on the above description of the embodiments, those skilled in the art will understand that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable signals, data structures, instruction modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible by a computer. Furthermore, as is known to those skilled in the art, communication media typically contain computer-readable signals, data structures, instruction modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0100] According to one embodiment of this application, during the edge-finding and positioning process of the medical tube, the motor controls the medical tube to rotate continuously, and the light emitted by the lighting lamp 613 shines on the medical tube through the light-transmitting groove 614, so that the camera 615 above the medical tube can capture the image of the medical tube more clearly and transmit the image of the medical tube to the controller in real time, so that the controller can perform edge-finding and positioning on the image of the medical tube to obtain the tag positioning information.
[0101] Thirdly, this application discloses a blood collection vehicle, including a labeling device and a label positioning device 600 as described in the second aspect of this application. The labeling device is disposed on the side of the medical tube and is used to label the medical tube according to the label positioning information when it receives a labeling instruction sent by the label positioning device 600.
[0102] Understandably, after obtaining the label positioning information based on the image information in the first sampling point set and the second sampling point set, this application will further determine the label positioning information and decide whether to label the medical tube based on the label positioning information at the current moment. When the label positioning information is close to the lower edge of the tube, the medical tube is controlled to continue rotating. When the label positioning information is close to the upper edge of the tube, and the difference between the length of the vertical line segment from the upper edge to the midpoint of the label edge and the distance from the midline meets the preset range, the label positioning device 600 controls the medical tube to stop rotating and sends a labeling instruction to the labeling device, so that the labeling device labels the medical tube.
[0103] The embodiments of this application have been described in detail above with reference to the accompanying drawings. However, this application is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of this application.
Claims
1. A method for label positioning of medical tubes, characterized in that, include: Images of medical tubes are acquired in real time, and the images are preprocessed to obtain a target image; wherein, the target image includes a binarized image; The target image is fitted with a straight line to obtain the upper edge, lower edge, and label edge; A first set of sampling points is obtained by selecting a number of sampling points between the upper edge and the edge of the label in the target image, and a second set of sampling points is obtained by selecting a number of sampling points between the lower edge and the edge of the label in the target image. Based on the image information in the first set of sampling points and the second set of sampling points, the tag positioning information is obtained; The step of selecting a number of sampling points between the upper edge and the label edge in the target image to obtain a first sampling point set, and selecting a number of sampling points between the lower edge and the label edge in the target image to obtain a second sampling point set, includes: Obtain the coordinates of several sampling points on the line segment from the upper edge to the midpoint of the label edge to obtain a first coordinate set; obtain the coordinates of several sampling points on the line segment from the lower edge to the midpoint of the label edge to obtain a second coordinate set; The step of obtaining tag positioning information based on image information from the first set of sampling points and the second set of sampling points includes: A first grayscale value set is obtained by calculating based on the first coordinate set and the binarized image; a second grayscale value set is obtained by calculating based on the second coordinate set and the binarized image. When the average value of the second grayscale value set is greater than the average value of the first grayscale value set, the label positioning information is output as being close to the upper edge of the tube; When the average value of the first grayscale value set is greater than the average value of the second grayscale value set, the label positioning information is output as being close to the lower edge of the tube.
2. The label positioning method for medical tubes according to claim 1, characterized in that, The image information includes pixel values, brightness values, or grayscale values, and the method further includes: The medical tube is controlled to rotate, and when the label positioning information is obtained, the medical tube is controlled to stop rotating; Send a labeling instruction to an external labeling device.
3. The label positioning method for medical tubes according to claim 2, characterized in that, The preprocessing of the image to obtain the target image includes: The image is converted to grayscale to obtain a grayscale image; The grayscale image is subjected to noise reduction processing to obtain a noise-reduced image; The denoised image is binarized to obtain a binarized image.
4. The label positioning method for medical tubes according to claim 3, characterized in that, The control of the rotation of the medical tube, and the control of the medical tube to stop rotating when the label positioning information is obtained, includes: Calculate the vertical distance between the upper edge and the lower edge, and obtain the centerline distance based on the vertical distance, wherein the centerline distance is half of the vertical distance; When the label positioning information is close to the upper edge of the tube, the length of the vertical line segment from the upper edge to the midpoint of the label edge is calculated. When the difference between the length and the midline distance meets a preset range, the medical tube is controlled to stop rotating. When the label positioning information indicates that the tube is close to the lower edge of the tube, the medical tube is controlled to continue rotating.
5. The label positioning method for medical tubes according to claim 4, characterized in that, When the label positioning information indicates the tube is near its upper edge, the length of the vertical line segment from the upper edge to the midpoint of the label edge is calculated. When the difference between the length and the midline distance meets a preset range, the medical tube is controlled to stop rotating. The method further includes: When the label positioning information is close to the upper edge of the tube, and the length at the previous moment is greater than the length at the current moment, and the length at the current moment is greater than the centerline distance, control the tube to rotate upwards until the difference between the length at the current moment and the centerline distance meets a preset range, and control the medical tube to stop rotating. When the label positioning information indicates that the tube is close to the upper edge of the tube, and the current length is simultaneously less than the previous length and the distance to the centerline, the tube is controlled to rotate downwards until the difference between the current length and the distance to the centerline meets a preset range, at which point the medical tube stops rotating.
6. A label positioning device for a medical tube, characterized in that, include: A labeling box includes a box body, a partition, and a lighting lamp. The partition has a light-transmitting groove, which is located below the medical tube. The lighting lamp is located below the light-transmitting groove and faces the light-transmitting groove. An electric motor is used to control the rotation of the medical tube; A camera, positioned above the medical tube, is used to acquire images of the medical tube; A controller for performing the label positioning method for medical tubes as described in any one of claims 1-5.
7. A blood collection vehicle, comprising a labeling device and a label positioning device as described in claim 6, wherein the labeling device is disposed on the side of the medical tube, and the labeling device is used to label the medical tube according to the label positioning information when receiving a labeling instruction sent by the label positioning device.