Test tube position determination method and device

By identifying the test tube hole area and test tube position prediction box in the image captured in the test tube rack loading/unloading area, and combining the coordinate data to determine the test tube position, the problem of inaccurate test tube position identification in the prior art is solved, and fast and accurate test tube position detection is achieved.

CN121594751APending Publication Date: 2026-03-03SHENZHEN DYMIND BIOTECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411176086.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

Existing test tube position detection technologies are prone to errors in test tube position identification when there is signal deviation, making it impossible to accurately identify the presence and position of test tubes on the test tube rack.

Method used

By identifying the test tube hole area and test tube position prediction box in the image captured in the test tube rack loading/unloading area, the coordinate data of each test tube hole area and test tube position is obtained. The test tube position is identified using a target detection model, and the location of the test tube is determined by combining the coordinate data of the test tube hole area and test tube position prediction box.

Benefits of technology

It enables rapid and accurate identification of the presence or absence of test tubes on the test tube rack and the position of the test tube holes, thus improving the accuracy of test tube position detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121594751A_ABST
    Figure CN121594751A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of test tube detection, in particular to a test tube position determination method and device. The method comprises the steps that under the condition that a shot image of a test tube rack loading / unloading area represents that a test tube rack exists in the test tube rack loading / unloading area, test tube hole areas in the shot image are recognized, and first coordinate data of all the test tube hole areas in the shot image and position data of test tube holes corresponding to the test tube hole areas are obtained; the position data comprises a test tube rack identifier of the test tube hole and a hole site identifier on the test tube rack; identifying the test tube in the shot image to obtain second coordinate data of the test tube position prediction frame in the shot image; and according to the first coordinate data of the test tube hole area and the second coordinate data of the test tube position prediction frame, determining position data of the test tube hole where the test tube is located. The method can accurately identify the position of the test tube.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of test tube testing technology, and in particular to a method and apparatus for determining the position of a test tube. Background Technology

[0002] In the medical field, the presence and position of test tubes on test tube racks are usually detected.

[0003] Existing test tube presence / absence detection and test tube position detection technologies primarily rely on reflective photoelectric switches or through-beam photoelectric switches to sense the test tube slots on the test tube rack and collect signals. These signals are then analyzed by a signal analysis module to determine the presence and position of test tubes. However, deviations in the collected signals can lead to errors in the signal analysis module's assessment of test tube presence and position, resulting in inaccurate test tube location identification. Summary of the Invention

[0004] Therefore, it is necessary to provide a method and apparatus for determining the position of a test tube that can accurately identify the position of the test tube, in order to address the above-mentioned technical problems.

[0005] In a first aspect, this application provides a method for determining the location of a test tube, the method comprising:

[0006] When the image taken in the test tube rack loading / unloading area indicates the presence of a test tube rack in the area, the test tube hole area in the image is identified, and the first coordinate data of each test tube hole area in the image and the position data of the test tube hole corresponding to the test tube hole area are obtained; the position data includes the test tube rack identifier where the test tube hole is located and the hole position identifier on the test tube rack.

[0007] Identify the test tubes in the captured image and obtain the second coordinate data of the test tube position prediction box in the captured image;

[0008] The position data of the test tube well is determined based on the first coordinate data of the test tube well area and the second coordinate data of the test tube position prediction frame.

[0009] Secondly, this application provides a device for determining the position of a test tube, the device comprising:

[0010] The location data acquisition module is used to identify the test tube hole area in the captured image when the test tube rack loading / unloading area is characterized by the presence of a test tube rack in the test tube rack loading / unloading area, and obtain the first coordinate data of each test tube hole area in the captured image, as well as the location data of the test tube hole corresponding to the test tube hole area; the location data includes the test tube rack identifier where the test tube hole is located and the hole position identifier on the test tube rack.

[0011] The coordinate data acquisition module is used to identify test tubes in the captured image and obtain the second coordinate data of the test tube position prediction box in the captured image.

[0012] The test tube position determination module is used to determine the position data of the test tube well where the test tube is located based on the first coordinate data of the test tube well area and the second coordinate data of the test tube position prediction frame.

[0013] The aforementioned method and apparatus for determining the location of test tubes, by capturing images of the test tube rack loading / unloading area to indicate the presence of a test tube rack, identifies the test tube hole regions in the captured images, obtains the first coordinate data of each test tube hole region in the captured images, and the position data of the test tube holes within the test tube hole regions, identifies the test tubes in the captured images, obtains the second coordinate data of the test tube position prediction frame in the captured images, and determines the position data of the test tube hole where the test tube is located based on the first coordinate data of the test tube hole regions and the second coordinate data of the test tube position prediction frame. This method can not only identify whether there are test tubes on the test tube rack, but also quickly and accurately determine the position data of the test tube hole where the test tube is located. Attached Figure Description

[0014] Figure 1 This is an application environment diagram of a method for determining the position of a test tube in one embodiment;

[0015] Figure 2 This is a flowchart illustrating a method for determining the position of a test tube in one embodiment;

[0016] Figure 3 This is a schematic diagram of a test tube position prediction box in one embodiment;

[0017] Figure 4 This is a schematic diagram of the test tube position prediction frame and the test tube well area in one embodiment;

[0018] Figure 5 This is a schematic diagram of a test tube position prediction box in one embodiment;

[0019] Figure 6 A flowchart illustrating the steps for determining the location data of the test tube well in one embodiment;

[0020] Figure 7 This is a schematic diagram illustrating the relationship between the test tube position prediction frame and the test tube well area in one embodiment;

[0021] Figure 8 This is a schematic diagram of the test tube cutting area in one embodiment;

[0022] Figure 9A This is a schematic diagram showing that the test tube rack loading / unloading area does not contain a test tube rack in one embodiment;

[0023] Figure 9B This is a schematic diagram showing a test tube rack in the test tube rack loading / unloading area of ​​one embodiment;

[0024] Figure 10A for Figure 9A A schematic diagram after edge information extraction;

[0025] Figure 10B for Figure 9B A schematic diagram after edge information extraction;

[0026] Figure 11 This is a schematic diagram of the mean distribution curve in one embodiment;

[0027] Figure 12 This is a schematic diagram of adjacent test tube racks in a segmented captured image in one embodiment;

[0028] Figure 13 This is a schematic diagram of a location prediction box in one embodiment;

[0029] Figure 14 This is a schematic diagram of bisecting the position prediction box and segmenting adjacent test tube racks in the captured image in one embodiment;

[0030] Figure 15 This is a structural block diagram of a device for determining the position of a test tube in one embodiment;

[0031] Figure 16 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0032] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0033] The method for determining the test tube position provided in this application embodiment can be applied to, for example, Figure 1In the application environment shown, the control terminal 104 transmits images to the camera via a wired or wireless channel. The test tube storage area 102 can be used to place test tubes. The test tube storage area 102 can be any part of the drawer area, quality control area, or test tube rack loading / unloading area in the sample pretreatment system. The control terminal 104 can accurately identify whether there are test tube racks in the test tube storage area 102 and the position of the test tubes. When the control terminal 104 captures an image of the test tube rack loading / unloading area, indicating the presence of test tube racks, it identifies the test tube hole areas in the captured image, obtaining the first coordinate data of each test tube hole area in the captured image, and the position data of the test tube holes within the test tube hole areas. The position data includes the test tube rack identifier where the test tube hole is located and the hole position identifier on the test tube rack. The control terminal 104 identifies the test tubes in the captured image and obtains the second coordinate data of the test tube position prediction box in the captured image. The control terminal 104 determines the position data of the test tube well where the test tube is located based on the first coordinate data of the test tube well area and the second coordinate data of the test tube position prediction frame.

[0034] In one embodiment, such as Figure 2 As shown, a method for determining the position of a test tube is provided, which can be applied to... Figure 1 Taking the control terminal in the example, the following steps are included:

[0035] S202, when the image taken in the test tube rack loading / unloading area indicates the presence of test tube racks, identify the test tube hole regions in the captured image, obtain the first coordinate data of each test tube hole region in the captured image, and the position data of the test tube holes in the test tube hole regions. The position data includes the test tube rack identifier where the test tube hole is located and the hole position identifier on the test tube rack.

[0036] The test tube rack loading / unloading area is the area used to place test tube racks. Images of the test tube rack loading / unloading area can be captured by a camera mounted on the terminal, or by a camera not mounted on the terminal, such as a handheld camera. Images can be taken at any time before the test tube positions are determined.

[0037] When using a camera not mounted on the control terminal to capture images of the test tube rack loading / unloading area, the images can be sent to the control terminal via a connection channel between the camera and the control terminal to determine the test tube positions. This connection channel can be wired or wireless.

[0038] Each test tube rack contains multiple test tube holes, and the test tube hole region refers to a regular area containing the test tube holes. When identifying the first coordinate data of the test tube hole region in the captured image, the control terminal simultaneously identifies the position data of each test tube hole region based on its first coordinate data, thus associating the first coordinate data and position data of the test tube hole region. For example, if two test tube hole regions are identified, they are sorted according to the size of their respective first coordinate data, and the position data of the test tube holes in the two regions are identified sequentially, resulting in (Test Tube Rack 1, Hole Position 1) and (Test Tube Rack 1, Hole Position 2). Test Tube Rack 1 is the test tube rack identifier in the position data, and Hole Position 1 and Hole Position 2 are the hole position identifiers in the position data. (Test Tube Rack 1, Hole Position 1) is associated with the first coordinate data of the first test tube hole region, and (Test Tube Rack 1, Hole Position 2) is associated with the first coordinate data of the second test tube hole region. The first coordinate data is in the form of a coordinate interval.

[0039] In some embodiments, the test tube rack identification includes, but is not limited to, the rack's own serial number and its position in the captured image. For example, the rack identification could be the rack's model number or the rack number X in the captured image. The orifice identification could be the orifice number Y on the rack.

[0040] Optionally, the control terminal acquires images captured by the camera of the test tube rack loading / unloading area. If the presence of a test tube rack in the loading / unloading area is confirmed through the captured images, the terminal identifies the test tube hole regions in the captured images, obtains the first coordinate data of each test tube hole region in the captured images, and determines the position data of the test tube holes in each region based on the order of the first coordinate data of each region. The position data includes the test tube rack identifier where the test tube hole is located and the hole position identifier on the test tube rack; the first coordinate data and position data of the test tube hole regions are correlated.

[0041] S204, identify the test tubes in the captured image and obtain the second coordinate data of the test tube position prediction box in the captured image.

[0042] The identification of test tubes in the captured image can be achieved using an object detection model. The control terminal inputs the captured image into the trained object detection model, which identifies the test tubes in the image. The object detection model then returns predicted bounding boxes for the positions of each test tube in the captured image. A schematic diagram of the predicted test tube positions in the captured image is shown below. Figure 3 As shown in the diagram. The test tube position prediction box 402 and the test tube well area 404 are simultaneously displayed in the captured image. Figure 4 As shown.

[0043] In some embodiments, the object detection model may include, but is not limited to, at least one of the following: Faster Regions with Convolutional Neural Networks (FasterR-CNN), YOLOv5 (You Only Look Once version 5), Region-based FullyConvolutional Networks (R-FCN), SingleShot Multibox Detector (SSD), and instance segmentation models.

[0044] In some embodiments, identifying test tubes in an captured image and obtaining the second coordinate data of the test tube location prediction box in the captured image includes: downsampling the captured image to obtain a downsampled image; identifying test tubes in the downsampled image and obtaining the second coordinate data of the test tube location prediction box in the captured image. This reduces the amount of data that needs to be processed, thereby enabling the rapid acquisition of the second coordinate data of the test tube location prediction box in the captured image.

[0045] In some embodiments, the color of the test tube location prediction box corresponds one-to-one with the sample type in the test tube, so that the sample type in the test tube can be directly determined by the color of the test tube location prediction box.

[0046] The second coordinate data can refer to the coordinates of the diagonal vertices of the test tube location prediction frame, or it can refer to the coordinate range formed by the coordinates of the vertices of the test tube location prediction frame. For example, as... Figure 5 As shown in the test tube position prediction box ABCD, the second coordinate data can be the coordinate data of the diagonal vertex A and diagonal vertex C, or the coordinate data of the diagonal vertex B and diagonal vertex D, or the coordinate interval between the horizontal coordinate x1 and the horizontal coordinate x2, and the coordinate interval between the vertical coordinate y1 and the vertical coordinate y2.

[0047] Optionally, the control terminal inputs the captured image into the target detection model to identify the test tubes in the captured image and obtain the second coordinate data of the predicted box of each test tube in the captured image.

[0048] S206, Based on the first coordinate data of the test tube well area and the second coordinate data of the test tube position prediction box, determine the position data of the test tube well where the test tube is located.

[0049] The location data of the test tube well where the test tube is located can be determined based on the inclusion relationship between the first coordinate data and the second coordinate data.

[0050] Optionally, after obtaining the first coordinate data of the test tube well area and the second coordinate data of the test tube position prediction frame, the control terminal determines the position data of the test tube well in the captured image based on the inclusion relationship between the first coordinate data of the test tube well area and the second coordinate data of the test tube position prediction frame.

[0051] In the aforementioned method for determining the location of test tubes, by capturing images of the test tube rack loading / unloading area to indicate the presence of test tube racks, the method identifies the test tube hole regions in the captured images, obtains the first coordinate data of each test tube hole region in the captured images, and the position data of the test tube holes within the test tube hole regions. It then identifies the test tubes in the captured images, obtains the second coordinate data of the test tube position prediction frame in the captured images, and determines the position data of the test tube hole where the test tube is located based on the first coordinate data of the test tube hole regions and the second coordinate data of the test tube position prediction frame. This method can not only identify whether there are test tubes on the test tube rack but also quickly and accurately determine the position data of the test tube holes where the test tubes are located.

[0052] In one embodiment, such as Figure 6 As shown, the second coordinate data is the coordinate data of the diagonal vertex of the test tube position prediction frame in the captured image. Based on the first coordinate data of the test tube well region and the second coordinate data of the test tube position prediction frame, the position data of the test tube well where the test tube is located is determined, including:

[0053] S602, determine the position data of the candidate test tube wells based on the first coordinate data of the test tube well region and the second coordinate data of the diagonal vertex of the test tube position prediction box.

[0054] In this context, the diagonal vertices of the test tube location prediction frame refer to the two vertices on the diagonal of the prediction frame. For example, as shown... Figure 5 As shown, the diagonal vertices can be vertices A and C, or vertices B and D.

[0055] The position data of candidate test tube wells can be determined based on the inclusion relationship between the first coordinate data and the second coordinate data. For example, the second coordinate data are the coordinates x1, y1, x2, and y2 of diagonal vertices A(x1, y1) and C(x2, y2). In the first coordinate data of each test tube well region, the first coordinate data of test tube well region 1 contains x1 and y1, and the first coordinate data of test tube well region 2 contains x2 and y2. Then, the position data of the test tube wells in test tube well region 1 and the position data of the test tube wells in test tube well region 2 are the position data of candidate test tube wells.

[0056] Optionally, the control terminal determines the position data of the candidate test tube well in the captured image from multiple test tube well position data based on the inclusion relationship between the first coordinate data of the test tube well region and the second coordinate data of the diagonal vertex of the test tube position prediction box.

[0057] S604, based on the offset of each test tube in the captured image, determine the position data of the test tube well where the test tube is located from the position data of the candidate test tube wells.

[0058] The offset of each test tube can be determined based on the distribution of the test tube position prediction frame within the test tube well area. For example, if the test tube position prediction frame is located at the lower right corner of the test tube well area, then the offset of each test tube in the captured image can be determined to be biased towards the lower right corner of the test tube well area.

[0059] The distribution of the test tube position prediction frame within the test tube well area can be determined based on the second coordinate data of the diagonal vertices of the test tube position prediction frame and the first coordinate data of the test tube well area. For example, if the first coordinate data of test tube well area 1 includes the second coordinate data of diagonal vertices A and B of the test tube position prediction frame, and the second coordinate data is located at the lower right corner of the first coordinate data, then the test tube position prediction frame can be determined to be located at the lower right corner of the test tube well area.

[0060] The relationship between the test tube position prediction frame and the test tube well area is as follows: Figure 7As shown, the black filled block represents the test tube position prediction box, and the black square represents the test tube well area. When the test tube position prediction box is located in the lower right corner of the test tube well area, the position data of the test tube well can be determined from the candidate test tube well position data using IDx = min(IDx1, IDx2) and IDy = min(IDy1, IDy2). When the test tube position prediction box is located in the upper right corner of the test tube well area, the position data of the test tube well can be determined from the candidate test tube well position data using IDx = max(IDx1, IDx2) and IDy = min(IDy1, IDy2). Determine the location data of the test tube well where the test tube is located; when the test tube location prediction box is located in the upper left corner of the test tube well area, the location data of the test tube well where the test tube is located can be determined from the candidate test tube well location data by using IDx = max(IDx1, IDx2) and IDy = max(IDy1, IDy2); when the test tube location prediction box is located in the lower left corner of the test tube well area, the location data of the test tube well where the test tube is located can be determined from the candidate test tube well location data by using IDx = min(IDx1, IDx2) and IDy = max(IDy1, IDy2). Wherein, IDx represents the test tube rack identifier of the test tube well where the test tube is located, IDy represents the well position identifier of the test tube well where the test tube is located, IDx1 represents the test tube rack identifier of the candidate test tube well corresponding to the first coordinate data containing coordinate x1, IDx2 represents the test tube rack identifier of the candidate test tube well corresponding to the first coordinate data containing coordinate x2, IDy1 represents the well position identifier of the candidate test tube well corresponding to the first coordinate data containing coordinate y1, and IDy2 represents the well position identifier of the candidate test tube well corresponding to the first coordinate data containing coordinate y2.

[0061] Optionally, the control terminal determines the offset of each test tube in the captured image based on the distribution of the test tube position prediction frame in the test tube well area. Based on the offset of each test tube, the control terminal determines the calculation method for the obtained test tube well position data, and determines the test tube well position data from the candidate test tube well position data according to the determined calculation method.

[0062] In this embodiment, the position data of the candidate test tube well where the test tube is located is determined by using the first coordinate data of the test tube well area and the second coordinate data of the diagonal vertex. Based on the offset of each test tube in the captured image, the position data of the test tube well where the test tube is located is determined from the position data of the candidate test tube wells. Even when most of the test tube position prediction frame does not match the actual reagent well area, the position data of the candidate test tube well where the test tube is located can be determined only by using the second coordinate data of the diagonal vertex of the test tube position prediction frame and the first coordinate data of the test tube well area. This improves the accuracy of the position data of the candidate test tube well where the test tube is located determined by using the first coordinate data and the second coordinate data of the diagonal vertex.

[0063] In one embodiment, the position data of candidate test tube wells are determined based on the first coordinate data of the test tube well region and the second coordinate data of the diagonal vertex of the test tube position prediction frame, including:

[0064] The second coordinate data of the diagonal vertex of the test tube position prediction frame is matched with the first coordinate data of the test tube well region to determine the first test tube well region where the diagonal vertex of the test tube position prediction frame is located.

[0065] Based on the location data of the test tube wells corresponding to the first test tube well area, the location data of the candidate test tube wells where the test tube is located are obtained.

[0066] The matching of the second coordinate data of the diagonal vertex of the test tube position prediction frame with the first coordinate data of the test tube well region can be understood as whether there is a portion of the second coordinate data in the first coordinate data, or whether the second coordinate data is within the coordinate range of the first coordinate data. For example, if the second coordinate data of the diagonal vertices A(x1, y1) and C(x2, y2) of the test tube position prediction frame are x1 = 1, y1 = 1, x2 = 2, y2 = 2, and the first coordinate data includes the coordinate ranges (x3 = 0, x4 = 3) and (y3 = 0, y4 = 3), and x1 = 1 and x2 = 1 are within the coordinate range (x3 = 0, x4 = 3), and y1 = 1 and y2 = 2 are within the coordinate range (y3 = 0, y4 = 3), then it indicates that at least a portion of the second coordinate data exists in the first coordinate data, meaning that the second coordinate data of the diagonal vertex of the test tube position prediction frame matches the first coordinate data of the test tube well region. Therefore, the test tube well region to which the first coordinate data belongs is the first test tube well region where the diagonal vertex of the test tube position prediction box is located.

[0067] Each test tube well region has a first coordinate data with a horizontal coordinate range and a vertical coordinate range. The second coordinate data also has two horizontal coordinate data and two vertical coordinate data. Therefore, there are at most four first coordinate data that match the second coordinate data. The first test tube well region where the diagonal vertex of the test tube position prediction box is located is also at most four.

[0068] Optionally, the control terminal matches the second coordinate data of the diagonal vertex of the test tube position prediction frame with the first coordinate data of the test tube well region, and determines the test tube well region where the first coordinate data that matches the second coordinate data is located as the first test tube well region where the diagonal vertex of the test tube position prediction frame is located. The control terminal uses the position data of the test tube wells in the first test tube well region as the position data of the candidate test tube wells where the test tube is located.

[0069] In this embodiment, by matching the second coordinate data of the diagonal vertex of the test tube position prediction frame with the first coordinate data of the test tube well region, the first test tube well region where the diagonal vertex of the test tube position prediction frame is located is determined. Based on the position data of the test tube wells corresponding to the first test tube well region, the position data of the candidate test tube well where the test tube is located is obtained. Even if most of the test tube position prediction frame does not match the actual reagent well region, only the first coordinate data that matches the second coordinate data of the diagonal vertex of the test tube position prediction frame can be determined, thereby improving the accuracy of the obtained position data of the test tube well where the test tube is located.

[0070] In one embodiment, the method for determining the location of the test tube further includes:

[0071] In the case of test tubes with unknown locations whose location data cannot be determined based on the test tube location prediction frame, the test tube cut-out area is extracted from the test tube location prediction frame of the test tube with unknown locations based on the preset length range and preset width range.

[0072] Obtain the third coordinate data of the diagonal vertex of the test tube cut-off region.

[0073] The third coordinate data of the diagonal vertex of the test tube cut-off area is matched with the first coordinate data of the test tube well area to determine the second test tube well area where the diagonal vertex of the test tube cut-off area is located.

[0074] Based on the location data of the test tube holes corresponding to the second test tube hole region, the location data of the candidate test tube holes for the unknown location test tube are obtained.

[0075] The preset length range and preset width range can be set by the user. For example, the preset length range is (h / 4, h*3 / 4), and the preset width range is (w / 4, w*3 / 4), where h represents the height of the test tube location prediction box and w represents the width of the test tube location prediction box.

[0076] like Figure 8 As shown, the test tube cut-off region is a portion of the test tube location prediction frame. For example, continuing the previous example, the test tube cut-off region is the area within the test tube location prediction frame with a height of (h / 4, h*3 / 4) and a width of (w / 4, w*3 / 4). Since the second coordinate data of the diagonal vertex of the test tube location prediction frame may not exist in the first coordinate data, it might be impossible to determine the test tube's location. Therefore, a portion of the test tube location prediction frame is cut off as the test tube cut-off region to obtain a new diagonal vertex and its third coordinate data. Based on the matching between the third coordinate data and the first coordinate data of the diagonal vertex of the test tube cut-off region, the second test tube hole region where the diagonal vertex of the test tube cut-off region is located can be determined. Therefore, based on the location data of the test tube holes corresponding to the second test tube hole region, the location data of the candidate test tube holes for the test tube at an unknown location can be obtained.

[0077] Whether the third coordinate data of the diagonal vertex of the test tube cutting area matches the first coordinate data of the test tube well area can be understood as whether there is a part of the third coordinate data in the first coordinate data, or whether the third coordinate data is within the coordinate range of the first coordinate data. For example, the third coordinate data of the diagonal vertices A(x1, y1) and C(x2, y2) of the test tube cutting area are x1=1, y1=1, x2=2, y2=2. The first coordinate data includes the coordinate intervals (x3=0, x4=3) and (y3=0, y4=3). x1=1 and x2=1 are within the coordinate interval (x3=0, x4=3), and y1=1 and y2=2 are within the coordinate interval (y3=0, y4=3). This means that there is at least a part of the third coordinate data in the first coordinate data. That is, the third coordinate data of the diagonal vertices of the test tube cutting area matches the first coordinate data of the test tube well area. Therefore, the test tube well area to which the first coordinate data belongs is the second test tube well area where the diagonal vertices of the test tube cutting area are located.

[0078] Each test tube well region has a first coordinate data with a horizontal coordinate range and a vertical coordinate range, while the third coordinate data also has two horizontal coordinate data and two vertical coordinate data. Therefore, there are at most four first coordinate data that match the third coordinate data, and there are also at most four second test tube well regions where the diagonal vertex of the test tube cut-off region is located.

[0079] Optionally, when test tubes with uncertain location data exist, the control terminal, based on a preset length and width range, extracts a portion of the predicted test tube location from the test tube location prediction frame of the undetermined location data as the test tube extraction area, and simultaneously acquires the third coordinate data of the diagonal vertex of the extraction area. The control terminal matches the third coordinate data of the diagonal vertex of the extraction area with the first coordinate data of the test tube well area, and determines the well area where the first coordinate data that matches the third coordinate data is located as the second well area where the diagonal vertex of the extraction area is located. The control terminal uses the position data of the test tube wells in the second well area as the position data of the candidate wells where the test tube is located.

[0080] In this embodiment, when there are test tubes with undetermined location data, the test tube cutting area is determined according to a preset length range and a preset width range within the test tube position prediction frame of the test tube with undetermined location data. The third coordinate data of the diagonal vertex of the test tube cutting area is obtained. Thus, coordinate data matching the third coordinate data of the diagonal vertex of the test tube cutting area can be determined from the first coordinate data. Therefore, the position data of the test tube hole corresponding to the coordinate data matching the third coordinate data of the diagonal vertex of the test tube cutting area can be determined as the position data of the candidate test tube hole where the test tube is located.

[0081] In one embodiment, determining the position data of the test tube well where the test tube is located based on the first coordinate data of the test tube well region and the second coordinate data of the test tube position prediction frame includes:

[0082] Based on the overlap between the first coordinate data of the test tube well region and the second coordinate data of the test tube position prediction frame, determine the proportion of each test tube position prediction frame in the at least partially overlapping test tube well region.

[0083] Based on the proportion of each test tube location prediction frame in the test tube well area that at least partially overlaps with the test tube well area, determine the test tube well area with the largest proportion where each test tube location prediction frame is located.

[0084] Based on the location data of the test tube holes in the test tube hole area with the largest proportion of the test tube location prediction frame, the location data of the test tube hole is obtained.

[0085] The second coordinate data of the test tube location prediction frame refers to the coordinate interval formed by the vertex coordinates of the test tube location prediction frame. The first coordinate data includes a coordinate interval in the horizontal direction and a coordinate interval in the vertical direction.

[0086] The overlap between the first coordinate data of the test tube well region and the second coordinate data of the test tube position prediction frame includes the overlap between the coordinate interval of the first coordinate data in the horizontal direction and the coordinate interval of the test tube position prediction frame in the horizontal direction, as well as the overlap between the coordinate interval of the first coordinate data in the vertical direction and the coordinate interval of the test tube position prediction frame in the vertical direction. For example, the first coordinate data of test tube well region A has a coordinate interval of (x1=0, x2=3) in the horizontal direction and (y1=0, y2=3) in the vertical direction; the first coordinate data of test tube well region B has a coordinate interval of (x3=3, x4=6) in the horizontal direction and (y3=0, y4=3) in the vertical direction; the coordinate interval of the test tube position prediction frame in the horizontal direction is (x5=1, x6=3.5) and (y3=0, y4=3) in the vertical direction. The coordinate interval in the direction is (y5=1, y6=3), while (x1=0, x2=3) and (x3=3, x4=6) have the same interval as (x5=1, x6=3.5), and (y1=0, y2=3) and (y3=0, y4=3) have the same interval as (y5=1, y6=3.5). Therefore, the first coordinate data of the test tube well region A and the first coordinate data of the test tube well region B have overlapping parts with the second coordinate data of the test tube position prediction box.

[0087] The percentage of each test tube position prediction frame in the test tube well area that at least partially overlaps includes the percentage of the test tube position prediction frame in the test tube well area that at least partially overlaps in the horizontal axis direction and the percentage of the test tube position prediction frame in the test tube well area that at least partially overlaps in the vertical axis direction. For example, continuing the example above, on the horizontal axis, the proportion of the test tube position prediction frame in the test tube A well area is (3-1) / (3-0) = 2 / 3, and the proportion of the test tube position prediction frame in the test tube B well area is (3.5-3) / (6-3) = 1 / 6. On the vertical axis, the proportion of the test tube position prediction frame in the test tube A well area is (3-1) / (3-0) = 2 / 3, and the proportion of the test tube position prediction frame in the test tube B well area is (3-1) / (3-0) = 2 / 3. Therefore, the proportion of the test tube position prediction frame in the test tube A well area is 2 / 3 + 2 / 3 = 4 / 3, and the proportion of the test tube position prediction frame in the test tube B well area is 1 / 6 + 2 / 3 = 5 / 6. The test tube A well area is the well area with the largest proportion of the test tube position prediction frame.

[0088] Optionally, the control terminal determines the proportion of each test tube position prediction frame in the at least partially overlapping test tube position area based on the overlap between the first coordinate data of the test tube well area and the second coordinate data of the test tube position prediction frame. Based on the proportion of each test tube position prediction frame in the at least partially overlapping test tube position area, the control terminal determines the test tube position area with the largest proportion where each test tube position prediction frame is located. Based on the position data of the test tubes in the test tube position area with the largest proportion where the test tube position prediction frame is located, the control terminal obtains the position data of the test tube well where the test tube is located.

[0089] In this embodiment, by calculating the proportion of each test tube position prediction frame in the test tube well area that at least partially overlaps, and determining the test tube well area with the largest proportion, the position data of the test tube well where the test tube is located can be effectively identified.

[0090] In one embodiment, the method for determining the location of the test tube further includes:

[0091] Edge information is extracted from the captured images of the test tube rack loading / unloading area to obtain an edge image, and the target region in the edge image is determined.

[0092] Determine the first pixel mean of multiple pixels within the target area.

[0093] If the average value of the first pixel is greater than the first threshold, it is determined that a test tube rack exists in the test tube rack loading / unloading area.

[0094] Edge information can be extracted using edge detection algorithms. These algorithms include, but are not limited to, the Sobel operator, the Roberts operator, and the Prewitt operator.

[0095] The Sobel operator has two convolution kernels: the gradient in the X direction and the gradient in the X direction. gradient in the Y direction Use the Sobel operator to respectively Figure 9A and Figure 9B The result obtained by performing gradient calculation and taking the absolute value of the output is as follows: Figure 10A and Figure 10B As shown.

[0096] The target region can be any area in the edge image, or a segment on either side of the center line of the edge image. Since the left and right sides of the image are not test tube rack areas, gradient calculations will introduce some noise. Therefore, when determining whether there are test tube racks in the loading / unloading area, using a segment on either side of the center line of the edge image as the target region avoids noise interference, thus correctly determining whether there are test tube racks in the loading / unloading area. The segment on either side of the center line can be determined using the formula... We obtain w, which represents the number of pixels in the horizontal or vertical direction of the edge image.

[0097] The first pixel mean refers to the average pixel value of all pixels within the target area. For example, if there are pixels A, B, and C within the target area, with pixel value 'a' for pixel A, 'b' for pixel B, and 'c' for pixel C, then the first pixel mean of all pixels within the target area is (a+b+c) / 3. The first and second thresholds can be set manually.

[0098] Optionally, the control terminal uses an edge detection algorithm to extract edge information from the captured images of the test tube rack loading / unloading area, obtaining the edge image corresponding to the captured image. The control terminal then uses the formula... The target region in the edge image is determined, and the first pixel mean value among all pixels within the target region is calculated. The control terminal compares the first pixel mean value with a first threshold value, and if the first pixel mean value is greater than the first threshold value, it determines that a test tube rack exists in the test tube rack loading / unloading area.

[0099] In this embodiment, edge information is extracted from the captured image of the test tube rack loading / unloading area to obtain an edge image. The first pixel mean of multiple pixels in the target area of ​​the edge image is determined, so that the first pixel mean can be compared with a first threshold. Based on the size of the first pixel mean and the first threshold, it can be accurately determined whether the test tube rack exists in the test tube rack loading / unloading area.

[0100] In one embodiment, identifying test tube well regions in an image, obtaining first coordinate data of each test tube well region in the image, and position data of the test tube wells within the test tube well regions, including:

[0101] The captured image is binarized to obtain a grayscale image.

[0102] Determine the second pixel mean of each row of pixels in the grayscale image. The second pixel mean of each row of pixels is used to construct the mean distribution curve.

[0103] The row containing the minimum value in the mean distribution curve is used as the dividing row between adjacent test tube racks in the captured image; the minimum value is the extreme value among multiple second pixel means.

[0104] Based on the segmentation rows, adjacent test tube racks in the captured image are segmented to identify the test tube well regions in the captured image, thereby obtaining the first coordinate data of each test tube well region in the captured image, as well as the position data of the test tube wells in the test tube well regions.

[0105] Binarization is a commonly used technique in image processing and pattern recognition. Its purpose is to convert grayscale or color images into grayscale images containing only black and white. Binarization simplifies image data, reduces computational complexity, and highlights image features, making them easier to analyze and process.

[0106] The second pixel mean of each row of pixels in a grayscale image refers to the average pixel value of all pixels in that row. For example, in a grayscale image with two rows of pixels, the first row contains pixels A, B, and C, with pixel value 'a', 'b', and 'c'. The second pixel mean of the first row is (a+b+c) / 3. The second row contains pixels D, E, and F, with pixel value 'd', 'e', ​​and 'f'. The second pixel mean of the second row is (d+e+f) / 3. The second pixel mean of multiple rows can be calculated using the formula... In this representation, w is the image width, i.e., the number of pixels in the vertical direction, and (x, y) represents the y-th pixel in the x-th row. x,y The mean value represents the pixel value of the y-th pixel in the x-th row. x This represents the average value of the second pixel in the x-th row.

[0107] The mean value of the second pixel in each row, along with the row containing that mean value, can form a mean distribution curve. The form of the mean distribution curve is as follows: Figure 11 As shown, Figure 11 The horizontal axis represents the number of rows, and the vertical axis represents the average pixel value.

[0108] A local minimum is the minimum value that a function can reach within a certain interval. For example... Figure 11 As shown, the minimum value in the mean distribution curve is located at the trough of the curve. Since the area between the test tube racks is blank, the pixel value in this area should be lower than the pixel values ​​on either side. Therefore, the row containing the minimum value in the mean distribution curve can be used as the segmentation row between adjacent test tube racks in the captured image. This allows for the segmentation of adjacent test tube racks in the captured image, enabling the identification of the test tube well regions in the captured image. This yields the first coordinate data of each test tube well region in the captured image, as well as the position data of the test tube wells within those regions. A schematic diagram of segmenting adjacent test tube racks in the captured image is shown below. Figure 12 As shown.

[0109] Optionally, the control terminal performs binarization processing on the captured image to obtain a grayscale image corresponding to the captured image. The control terminal calculates the second pixel mean of each row of pixels in the grayscale image, and constructs a mean distribution curve using the second pixel mean and the row where the second pixel mean is located. Based on the mean distribution curve, the control terminal determines the row containing the minimum value among multiple second pixel means, and uses the row containing the minimum value as the segmentation row between adjacent test tube racks in the captured image. The control terminal segments adjacent test tube racks in the captured image according to the segmentation rows to identify the test tube well regions in the captured image, obtaining the first coordinate data of each test tube well region in the captured image, as well as the position data of the test tube wells in the test tube well regions.

[0110] In this embodiment, the captured image is binarized to obtain a grayscale image. This removes redundant information from the captured image, simplifies the image structure, enhances contrast, and makes image features more prominent. Using the minimum value as the criterion for segmentation rows allows for precise segmentation of adjacent test tube racks in the captured image, avoiding segmentation errors caused by factors such as image quality and lighting changes, thereby improving the accuracy of test tube well region identification.

[0111] In one embodiment, segmenting adjacent test tube racks in an image based on segmented rows to identify test tube well regions in the image includes:

[0112] Through template matching, the system outputs multiple candidate location prediction boxes for each test tube rack in the captured image, as well as the confidence level of each candidate location prediction box.

[0113] The candidate location prediction boxes are sorted according to their confidence scores to obtain the ranking results.

[0114] Based on the sorting results, each candidate location prediction box is traversed sequentially, and the intersection-union ratio between the currently traversed candidate location prediction box and each subsequent candidate location prediction box is determined.

[0115] Candidate location prediction boxes with an intersection-union ratio greater than a preset intersection-union ratio are removed, and the remaining candidate location prediction boxes are used as the location prediction boxes for each test tube rack in the captured image.

[0116] Based on the preset number of test tube wells in the test tube rack, the position prediction box is divided equally, and based on the segmentation row, adjacent test tube racks in the captured image are segmented to identify the test tube well area in the captured image.

[0117] Template matching involves traversing every possible location in the captured image and comparing it to a template image. When the similarity is high enough, a candidate bounding box is considered found. Since template matching typically yields a large number of matches, non-maximum suppression can be used to determine the final bounding box from multiple candidate bounding boxes. A schematic diagram of the final determined bounding box is shown below. Figure 13 As shown.

[0118] The preset number of test tube wells can be set according to the number of wells on the test tube rack. Since the size of each well area on the test tube rack is fixed, and each well area contains exactly one well, dividing the position prediction frame of each test tube rack equally according to the preset number of wells can separate each well area on the rack. The segmentation rows can then segment adjacent test tube racks in the captured image. Therefore, by equally dividing the position prediction frame and segmenting adjacent test tube racks in the captured image, the identification of the well areas is achieved. A schematic diagram of equally dividing the position prediction frame and segmenting adjacent test tube racks in the captured image is shown below. Figure 14 As shown.

[0119] Optionally, the control terminal, through template matching, outputs multiple candidate location prediction boxes for each test tube rack in the captured image, along with the confidence level of each candidate location prediction box. The control terminal sorts the candidate location prediction boxes according to their confidence levels from highest to lowest, obtaining a sorting result. Starting with the candidate location prediction box with the highest confidence level, the control terminal sequentially traverses each candidate location prediction box, calculating the intersection-union ratio (IUGR) between the currently traversed candidate location prediction box and all subsequent candidate location prediction boxes. The control terminal removes all subsequent candidate location prediction boxes with IUGR values ​​greater than a preset IUGR. The control terminal continues to traverse the next candidate location prediction box according to the sorting result, repeating the steps of calculating the IUGR and removing candidate location prediction boxes with IUGR values ​​greater than the preset IUGR, until all candidate location prediction boxes have been traversed. The control terminal uses the remaining candidate location prediction boxes as the location prediction boxes for each test tube rack in the captured image. The control terminal divides the position prediction box of each test tube rack according to the preset number of test tube holes to separate the area of ​​each test tube hole on the test tube rack. At the same time, it divides the adjacent test tube racks in the image to be captured based on the segmentation to realize the recognition of the test tube hole area.

[0120] In this embodiment, by sorting the candidate position prediction boxes according to their confidence levels and removing candidate position prediction boxes with an intersection-union ratio greater than a preset intersection-union ratio, and using the remaining candidate position prediction boxes as the position prediction boxes for each test tube rack in the captured image, the uncertainty of position prediction can be reduced. This ensures that the final remaining position prediction boxes all correspond to a real test tube rack, avoiding the situation where each test tube rack corresponds to multiple position prediction boxes or where there is no corresponding position prediction box for a test tube rack.

[0121] In one embodiment, the method for determining the location of the test tube further includes:

[0122] Based on the average second pixel value of each row of pixels, determine the target row where the average second pixel value is less than the second threshold.

[0123] Remove the non-test tube rack area consisting of the target row from the captured image.

[0124] The second threshold can be a user-defined threshold. The target row refers to the row where the average value of the second pixel is less than the second threshold. Since the area formed by the target row is outside the test tube rack area, i.e., the area unrelated to the process of determining the test tube position, it can be removed.

[0125] In some embodiments, when performing template matching, multiple candidate position rectangles for each test tube rack in the image after removing non-test tube rack areas, as well as the confidence scores of each candidate position rectangle, can be output through template matching. This can reduce the amount of data that needs to be processed during template matching, reduce noise interference from non-test tube rack areas, and improve the output efficiency and accuracy of candidate position rectangles and the confidence scores of each candidate position rectangle.

[0126] In some embodiments, the second coordinate data of the test tube position prediction box in the captured image can also be obtained by identifying test tubes in the image after removing non-test tube areas. This can reduce the amount of data that needs to be processed when identifying test tubes, while reducing noise interference from non-test tube rack areas, and improving the efficiency and accuracy of acquiring the second coordinate data.

[0127] In this embodiment, by removing the non-test tube rack area composed of the target row in the captured image, the noise interference caused by the non-test tube rack area can be reduced, which helps to more accurately locate and identify each test tube and test tube well in the test tube rack.

[0128] This application also provides an application scenario in which the above-described method for determining the position of the test tube is applied. Specifically, the determination of the test tube position is applied in this scenario as follows:

[0129] The control terminal uses an edge detection algorithm to extract edge information from the captured images of the test tube rack loading / unloading area, obtaining the edge image corresponding to the captured image. The control terminal then uses the formula... The target region in the edge image is determined, and the first pixel mean value among all pixels within the target region is calculated. The control terminal compares the first pixel mean value with a first threshold value, and if the first pixel mean value is greater than the first threshold value, it determines that a test tube rack exists in the test tube rack loading / unloading area.

[0130] The control terminal binarizes the captured image to obtain a grayscale image. It calculates the second pixel mean for each row of pixels in the grayscale image and constructs a mean distribution curve using these second pixel means and the row containing them. Based on the mean distribution curve, the control terminal determines the row containing the minimum value among the multiple second pixel means and uses this row as the segmentation row between adjacent test tube racks in the captured image. The control terminal segments adjacent test tube racks in the captured image according to these segmentation rows. Through template matching, the control terminal outputs multiple candidate location prediction boxes and the confidence score of each candidate location prediction box for each test tube rack in the captured image. The control terminal sorts the candidate location prediction boxes from highest to lowest confidence score. Starting with the candidate location prediction box with the highest confidence score, the control terminal iterates through each candidate location prediction box sequentially, calculating the intersection-union ratio (IUGR) between the currently traversed candidate location prediction box and all subsequent candidate location prediction boxes. The control terminal discards all subsequent candidate location prediction boxes with an IUGR greater than a preset IUGR. The control terminal continues to traverse the next candidate location prediction box according to the sorting result, and repeats the steps of calculating the intersection-union ratio (IU) and eliminating candidate location prediction boxes with IU values ​​greater than the preset IU, until every candidate location prediction box has been traversed. The control terminal uses the retained candidate location prediction boxes as the location prediction boxes for each test tube rack in the captured image. The control terminal divides the location prediction boxes of each test tube rack according to the preset number of test tube wells to separate the area of ​​each test tube well on the rack, thereby realizing the identification of the test tube well area. The control terminal inputs the captured image into the target detection model to identify the test tubes in the captured image and obtain the second coordinate data of the test tube location prediction box in the captured image.

[0131] The control terminal matches the second coordinate data of the diagonal vertex of the test tube position prediction frame with the first coordinate data of the test tube well region. The well region containing the first coordinate data that matches the second coordinate data is then identified as the first test tube well region containing the diagonal vertex of the test tube position prediction frame. Based on the position data of the test tube wells in the first test tube well region, the control terminal obtains the position data of the candidate test tube wells where the test tube is located.

[0132] When a test tube with uncertain location data exists, the control terminal, based on a preset length and width range, extracts a portion of the predicted test tube location from the test tube location prediction frame as the test tube extraction area. Simultaneously, it acquires the third coordinate data of the diagonal vertex of this extraction area. The control terminal matches the third coordinate data of the diagonal vertex of the extraction area with the first coordinate data of the test tube well area. The well area containing the first coordinate data that matches the third coordinate data is designated as the second well area containing the diagonal vertex of the extraction area. Based on the well location data within this second well area, the control terminal obtains the candidate well location data for the test tube.

[0133] The control terminal determines the offset of each test tube in the captured image based on the distribution of the test tube position prediction frame within the test tube well area. Based on the offset of each test tube, the control terminal determines the calculation method for the obtained test tube well position data, and then, according to the determined calculation method, determines the test tube well position data from the candidate test tube well position data.

[0134] The control terminal determines the proportion of each test tube position prediction frame in the at least partially overlapping test tube position area based on the overlap between the first coordinate data of the test tube well area and the second coordinate data of the test tube position prediction frame. Based on the proportion of each test tube position prediction frame in the at least partially overlapping test tube position area, it determines the test tube well area with the largest proportion where each test tube position prediction frame is located. Based on the position data of the test tube well in the test tube well area with the largest proportion where the test tube position prediction frame is located, it obtains the position data of the test tube well where the test tube is located.

[0135] In this embodiment, by capturing images of the test tube rack loading / unloading area to indicate the presence of a test tube rack, the method identifies the test tube hole regions in the captured images, obtains the first coordinate data of each test tube hole region in the captured images, and the position data of the test tube holes within the test tube hole regions. It then identifies the test tubes in the captured images, obtains the second coordinate data of the test tube position prediction frame in the captured images, and determines the position data of the test tube hole where the test tube is located based on the first coordinate data of the test tube hole regions and the second coordinate data of the test tube position prediction frame. This method can not only identify whether there are test tubes on the test tube rack, but also quickly and accurately determine the position data of the test tube hole where the test tube is located.

[0136] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0137] Based on the same inventive concept, this application also provides a test tube position determination device for implementing the test tube position determination method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more test tube position determination device embodiments provided below can be found in the limitations of the test tube position determination method described above, and will not be repeated here.

[0138] In one embodiment, such as Figure 15 As shown, a device for determining the position of a test tube is provided, comprising:

[0139] The location data acquisition module 1502 is used to identify the test tube hole regions in the captured images of the test tube rack loading / unloading area, when test tube racks are present in the area. The module obtains the first coordinate data of each test tube hole region in the captured image, as well as the location data of the corresponding test tube holes. The location data includes the test tube rack identifier where the test tube hole is located and the hole position identifier on the test tube rack.

[0140] The coordinate data acquisition module 1504 is used to identify test tubes in the captured image and obtain the second coordinate data of the test tube position prediction box in the captured image.

[0141] The test tube position determination module 1506 is used to determine the position data of the test tube well where the test tube is located based on the first coordinate data of the test tube well area and the second coordinate data of the test tube position prediction box.

[0142] In this embodiment, by capturing images of the test tube rack loading / unloading area to indicate the presence of a test tube rack, the method identifies the test tube hole regions in the captured images, obtains the first coordinate data of each test tube hole region in the captured images, and the position data of the test tube holes within the test tube hole regions. It then identifies the test tubes in the captured images, obtains the second coordinate data of the test tube position prediction frame in the captured images, and determines the position data of the test tube hole where the test tube is located based on the first coordinate data of the test tube hole regions and the second coordinate data of the test tube position prediction frame. This method can not only identify whether there are test tubes on the test tube rack, but also quickly and accurately determine the position data of the test tube hole where the test tube is located.

[0143] Each module in the aforementioned test tube location determination device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0144] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 16 As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements a method for determining the position of a test tube. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.

[0145] Those skilled in the art will understand that Figure 16 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0146] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0147] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0148] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0149] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0150] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0151] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0152] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for determining the position of a test tube, characterized in that, The method includes: When the image taken in the test tube rack loading / unloading area indicates the presence of a test tube rack in the area, the test tube hole area in the image is identified, and the first coordinate data of each test tube hole area in the image and the position data of the test tube hole corresponding to the test tube hole area are obtained; the position data includes the test tube rack identifier where the test tube hole is located and the hole position identifier on the test tube rack. Identify the test tubes in the captured image and obtain the second coordinate data of the test tube position prediction box in the captured image; The position data of the test tube well is determined based on the first coordinate data of the test tube well area and the second coordinate data of the test tube position prediction frame.

2. The method according to claim 1, characterized in that, The second coordinate data is the coordinate data of the diagonal vertex of the test tube position prediction frame in the captured image; The step of determining the position data of the test tube well where the test tube is located based on the first coordinate data of the test tube well region and the second coordinate data of the test tube position prediction frame includes: Based on the first coordinate data of the test tube well region and the second coordinate data of the diagonal vertex of the test tube position prediction box, the position data of the candidate test tube wells of the test tube are determined. Based on the offset of each test tube in the captured image, the position data of the test tube hole where the test tube is located is determined from the position data of the candidate test tube holes.

3. The method according to claim 2, characterized in that, The step of determining the position data of the candidate test tube wells based on the first coordinate data of the test tube well region and the second coordinate data of the diagonal vertex of the test tube position prediction frame includes: The second coordinate data of the diagonal vertex of the test tube position prediction frame is matched with the first coordinate data of the test tube hole region to determine the first test tube hole region where the diagonal vertex of the test tube position prediction frame is located. Based on the location data of the test tube holes corresponding to the first test tube hole area, the location data of the candidate test tube hole where the test tube is located is obtained.

4. The method according to claim 3, characterized in that, The method further includes: In the case of test tubes with unknown locations whose location data cannot be determined based on the test tube location prediction frame, the test tube cut-out area is obtained from the test tube location prediction frame of the test tubes with unknown locations based on the preset length range and the preset width range. Obtain the third coordinate data of the diagonal vertex of the test tube cut-off region; The third coordinate data of the diagonal vertex of the test tube cutting area is matched with the first coordinate data of the test tube hole area to determine the second test tube hole area where the diagonal vertex of the test tube cutting area is located. Based on the position data of the test tube holes corresponding to the second test tube hole region, the position data of the candidate test tube holes for the unknown position test tube are obtained.

5. The method according to claim 1, characterized in that, The step of determining the position data of the test tube well where the test tube is located based on the first coordinate data of the test tube well region and the second coordinate data of the test tube position prediction frame includes: Based on the overlap between the first coordinate data of the test tube hole area and the second coordinate data of the test tube position prediction frame, determine the proportion of each test tube position prediction frame in the at least partially overlapping test tube hole area. Based on the proportion of each test tube position prediction frame in the test tube hole area that at least partially overlaps, determine the test tube hole area with the largest proportion where each test tube position prediction frame is located. Based on the location data of the test tube holes in the test tube hole area with the largest proportion of the test tube location prediction frame, the location data of the test tube hole where the test tube is located is obtained.

6. The method according to claim 1, characterized in that, The method further includes: Edge information is extracted from the captured images of the test tube rack loading / unloading area to obtain an edge image, and the target region in the edge image is determined. Determine the first pixel mean of multiple pixels within the target area; If the average value of the first pixel is greater than the first threshold, it is determined that a test tube rack exists in the test tube rack loading / unloading area.

7. The method according to claim 1, characterized in that, The step of identifying the test tube well regions in the captured image and obtaining first coordinate data of each test tube well region in the captured image, as well as position data of the test tube wells in the test tube well regions, includes: The captured image is binarized to obtain a grayscale image; Determine the second pixel mean of each row of pixels in the grayscale image; the second pixel mean of each row of pixels is used to construct a mean distribution curve. The row containing the minimum value in the mean distribution curve is used as the dividing row between adjacent test tube racks in the captured image; the minimum value is the extreme value among multiple second pixel means. Based on the segmentation rows, adjacent test tube racks in the captured image are segmented to identify test tube hole regions in the captured image, thereby obtaining first coordinate data of each test tube hole region in the captured image, and position data of the test tube holes in the test tube hole regions.

8. The method according to claim 7, characterized in that, The step of segmenting adjacent test tube racks in the captured image based on the segmented rows to identify test tube well regions in the captured image includes: By matching templates, the system outputs multiple candidate position prediction boxes for each test tube rack in the captured image, as well as the confidence level of each candidate position prediction box. The candidate location prediction boxes are sorted according to their confidence scores to obtain a sorting result. According to the sorting result, each candidate location prediction box is traversed sequentially, and the intersection-union ratio between the currently traversed candidate location prediction box and each subsequent candidate location prediction box is determined. Candidate position prediction boxes with intersection-union ratios greater than a preset intersection-union ratio are removed, and the remaining candidate position prediction boxes are used as the position prediction boxes for each test tube rack in the captured image. Based on the preset number of test tube holes in the test tube rack, the position prediction frame is divided equally, and based on the segmentation row, adjacent test tube racks in the captured image are segmented to identify the test tube hole region in the captured image.

9. The method according to claim 7, characterized in that, The method further includes: Based on the second pixel mean of each row of pixels, determine the target row where the second pixel mean is less than the second threshold; Remove the non-test tube rack area composed of the target row from the captured image, and then perform test tube well area identification and test tube identification based on the image after removing the non-test tube rack area.

10. A device for determining the position of a test tube, characterized in that, The device includes: The location data acquisition module is used to identify the test tube hole area in the captured image when the test tube rack loading / unloading area is characterized by the presence of a test tube rack in the test tube rack loading / unloading area, and obtain the first coordinate data of each test tube hole area in the captured image, as well as the location data of the test tube hole corresponding to the test tube hole area; the location data includes the test tube rack identifier where the test tube hole is located and the hole position identifier on the test tube rack. The coordinate data acquisition module is used to identify test tubes in the captured image and obtain the second coordinate data of the test tube position prediction box in the captured image. The test tube position determination module is used to determine the position data of the test tube well where the test tube is located based on the first coordinate data of the test tube well area and the second coordinate data of the test tube position prediction frame.