Sample identification method and device, computer equipment, medium and program product

By identifying the deflection angle of the label in the sample image and rotating the sample, the complexity and cost of sample label recognition in traditional technology are solved, efficient and accurate sample label recognition is achieved, and the processing efficiency of the fully automatic laboratory system is improved. accuracy.

CN119229215AActive Publication Date: 2024-12-31HUNAN YAHUILONG BIOTECHNOLOGY CO LTD +1
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411660315.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2024-12-31
Estimated Expiration
2044-11-20

AI Technical Summary

Technical Problem

In traditional fully automatic laboratory systems, the sample label recognition process is complex, the cost is high, and it is dependent on the rotary code scanning mechanism, which affects the system efficiency and accuracy.

Method used

By collecting sample images through the image, identify the deflection angle between the label and the reference position, rotate the sample to adapt to the detector, realize accurate identification of the label and reduce dependence on the rotation mechanism.

Benefits of technology

It improves the accuracy and processing efficiency of sample tag identification, saves the cost of mobile structure, and ensures the accuracy and consistency of tag reading.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119229215A_ABST
    Figure CN119229215A_ABST
Patent Text Reader

Abstract

The invention relates to a sample identification method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: placing a sample in a preset area, and carrying out image acquisition on the sample to obtain a sample image; a label is arranged outside the sample; identifying a deflection angle between the label and a reference position based on the position of the label in the sample image and the reference position of the sample in the sample image; when the sample is transferred out of the preset area, rotating the sample according to the deflection angle; and after the sample is transferred and rotated, identifying a tag of the sample peripheral through a detector with a preset orientation. By adopting the method, the processing efficiency can be guaranteed, a moving structure is saved, and the tag reading accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of automatic laboratory technology, and in particular to a sample identification method, device, computer equipment, computer-readable storage medium and computer program product. Background Art

[0002] As equipment becomes more and more automated and intelligent, many scenarios are now beginning to use fully automated laboratory systems. Samples in the system need to undergo collection, information entry, sample pre-processing, sample testing, and post-processing. After the samples are online, the sample information and ID code are identified, and online samples are processed based on the identified unit label information. Therefore, the accuracy and reliability of sample label identification is particularly important for fully automated laboratory systems.

[0003] In traditional technology, it is necessary to read sample information by combining rotation and labeling. The structure is complex and a rotation mechanism needs to be designed for each module, which is costly. Summary of the invention

[0004] Based on this, it is necessary to provide a method, device, computer equipment, computer-readable storage medium and computer program product for identifying samples with high accuracy and efficiency in order to address the above technical problems.

[0005] In a first aspect, the present application provides a method for identifying a sample, the method comprising:

[0006] Placing a sample in a preset area and collecting an image of the sample to obtain a sample image; a label is provided outside the sample;

[0007] Based on the position of the tag in the sample image and the reference position of the sample in the sample image, identifying a deflection angle between the tag and the reference position;

[0008] When the sample is transferred out of the preset area, rotating the sample according to the deflection angle;

[0009] After the sample is transferred and rotated, the label of the sample peripheral is identified through a detector with a preset orientation.

[0010] In one embodiment, placing the sample in a preset area and capturing an image of the sample includes:

[0011] When the sample clamp rotates around the sample, if the sample clamp contacts the groove of the rotating code disk, the camera is used to collect images toward the sample to obtain a sample image; wherein the grooves of the rotating code disk are distributed circumferentially;

[0012] After the sample gripper rotates around the sample, the sample is placed in a preset area by the sample gripper.

[0013] In one embodiment, the identifying the deflection angle between the tag and the reference position based on the position of the tag in the sample image and the reference position of the sample in the sample image comprises:

[0014] Among the sample images collected when the sample is rotated to different angles, a target sample image at a target angle is selected according to the length of the label in a reference direction;

[0015] Based on the position of the tag in the target sample image and the reference position of the sample in the target sample image, a deflection angle between the tag and the reference position is identified.

[0016] In one embodiment, the identifying the deflection angle between the tag and the reference position based on the position of the tag in the sample image and the reference position of the sample in the sample image comprises:

[0017] In the sample image, detecting the center position of the label in a reference direction to obtain the label position in the sample image;

[0018] In the sample image, determining a reference position of the sample based on a center position of the sample in the reference direction;

[0019] Calculating a pixel position difference based on the label position and the reference position of the sample to obtain a pixel position difference;

[0020] The pixel position difference is converted into a deflection angle according to the camera parameters of the sample image.

[0021] In one embodiment, the camera parameters include a camera distance and a number of pixels of the camera at the camera distance; the camera distance is a distance between the camera and the sample;

[0022] The step of converting the pixel position difference into a deflection angle according to the camera parameters of the sample image comprises:

[0023] converting the pixel position difference into a deviation position based on a ratio between the camera distance and the number of pixels;

[0024] Angle conversion is performed based on the ratio between the deviation position and the container radius of the sample to obtain a deflection angle.

[0025] In one embodiment, converting the pixel position difference into a deflection angle according to the camera parameters of the sample image comprises:

[0026] According to the camera parameters of the sample image, converting the pixel position difference into an initial deflection angle;

[0027] According to a preset corresponding relationship, the initial deflection angle is adjusted to obtain a deflection angle after conversion; the preset corresponding relationship is obtained by fitting a data set of the initial deflection angle and a data set of the deflection angle after conversion;

[0028] When the sample is transferred out of the preset area, rotating the sample according to the deflection angle includes:

[0029] When the sample is transferred out of the preset area, the sample is rotated according to the deflection angle after the conversion.

[0030] In a second aspect, the present application also provides a sample identification device, including:

[0031] A sample placement module is used to place the sample in a preset area and collect images of the sample to obtain a sample image; the sample is provided with a label;

[0032] an angle calculation module, configured to identify a deflection angle between the tag and the reference position based on the position of the tag in the sample image and the reference position of the sample in the sample image;

[0033] A sample transfer module, used for rotating the sample according to the deflection angle when the sample is transferred out of the preset area;

[0034] The label recognition module is used to recognize the label of the sample peripheral device through a detector with a preset orientation after the sample is removed and rotated.

[0035] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of identifying the sample in any of the above embodiments are implemented.

[0036] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of identifying the sample in any of the above embodiments are implemented.

[0037] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of identifying the sample in any of the above embodiments are implemented.

[0038] The above-mentioned sample identification method, device, computer equipment, computer-readable storage medium and computer program product place the sample in a preset area, and at the same time collect images of the sample to obtain a sample image, which can synchronously realize the sample movement process and image collection process to ensure processing efficiency; because the sample itself and the label set outside the sample are relatively independent, forming two relatively independent dimensions, the position of the label in the sample image and the reference position of the sample in the sample image are different, and the deflection angle between the label and the reference position can be identified; further, when the sample moves out of the preset area, the sample is rotated according to the deflection angle, so that the process of moving the sample out of the preset area and the process of rotating the sample can be executed synchronously to ensure processing efficiency, and the orientation of the label can be adapted to the detector of the preset orientation; therefore, after the sample is transferred and rotated, when the label of the sample peripheral is identified by the detector of the preset orientation, the accuracy of label identification can be guaranteed, and there is no need to adjust the angle of the label. Therefore, in the case of sample testing in medical laboratories, etc., processing efficiency is guaranteed, mobile structures are saved, and label reading accuracy is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0040] Figure 1 A diagram of an application environment for collecting sample images and moving samples into a preset area in one embodiment;

[0041] Figure 2 A diagram of an application environment for sample image acquisition and sample transfer in one embodiment;

[0042] Figure 3 A structural environment diagram when the sample is a test tube in an embodiment;

[0043] Figure 4 A structural environment diagram of a sample recognition gripper in one embodiment;

[0044] Figure 5 is a flow chart of a sample identification method in one embodiment;

[0045] Figure 6 A schematic diagram of the structure of a sample and its label in one embodiment;

[0046] Figure 7 is a schematic diagram of a deflection angle and its compensation value in one embodiment;

[0047] Figure 8 A schematic diagram of a fitting of a preset corresponding relationship in an embodiment;

[0048] Fig. 9 is a structural block diagram of a sample identification device in an embodiment;

[0049] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment.

[0050] Description of reference numerals:

[0051] 10-sample loading rack; 20-sample identification gripper; 21-camera; 22-rotating code disk; 23-sample clamp; 30-cache sample rack; 40-sample loading gripper; 50-injection port; 60-conveyor rail; 70-test tube; 71-test tube center; 72-label. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0053] The sample identification method provided in the embodiment of the present application is applied to an application scenario with a sample transfer device and a shooting device; wherein the sample transfer device includes but is not limited to a clamp or a fixture, etc., the shooting device includes but is not limited to a camera, a mobile terminal, etc., and the preset area includes but is not limited to the area where equipment such as a test tube rack and a test tube table are located.

[0054] Optionally, in a Total Laboratory Automation (TLA) system, the sample starts with sample loading, and then is transported by rails for sample pre-processing, sample analysis, and sample post-processing. When the sample enters the unit module, the sample information needs to be identified and confirmed to avoid sample matching errors. When the sample barcode is re-identified in the unit module, two methods, rotating scanning and fixed-angle scanning, can be used. The rotating scanning method requires the addition of a sample rotating scanning mechanism, which not only increases the cost but also affects the system efficiency, while the fixed-angle scanning method places higher requirements on the accuracy of barcode reading and barcode angle recognition during sample injection. In the case where the detector is a fixed-position scanning device, when loading the sample, the method is executed to avoid adding a rotating scanning device to other units, thereby reducing costs; and the camera barcode angle recognition calculation method is optimized to ensure the angle consistency and barcode recognition accuracy of the pipeline system samples when flowing through other units.

[0055] Optionally, the sample identification method provided in the embodiment of the present application can be applied to Figure 1 In the application scenario shown, the application scenario includes a sample loading rack 10, a sample identification gripper 20 and a cache sample rack 30 in a preset area; the sample identification gripper 20 can place the sample in the sample loading rack 10 into the cache sample holder 30; the sample identification gripper 20 is provided with a camera 21, a rotating code disk 22 and a sample clamp 23, so that before the sample is placed in the cache sample holder 30, the rotating code disk 22 detects the rotation of the sample clamp 23, thereby controlling the camera 21 to collect the corresponding sample image; then based on the position of the sample peripheral label in the sample image and the reference position of the sample in the sample image, the deflection angle between the label and the reference position is identified, and when the sample is transferred out of the cache sample rack 30, the sample is rotated according to the deflection angle. Finally, after the sample is transferred and rotated, the label of the sample peripheral is identified by a detector with a preset orientation.

[0056] Optionally, in Figure 1 Based on this, the sample recognition method provided in the embodiment of the present application can be applied to Figure 2 In the scenario shown. During the injection, the sample is transferred out of the cache sample rack 30 by the sample injection gripper 40, and the sample is rotated by the sample injection gripper 40 according to the deflection angle so that the label of the sample faces the outside of the injection port 50, and then the sample is transported to the detector of the corresponding identification unit through the transport rail 60, and then the label of the sample peripheral is identified by the detector with the preset direction.

[0057] Alternatively, if Figure 3As shown, the sample is a test tube 70; correspondingly, before the sample clamp 23 grasps the test tube 70, the rotating code disk 22 detects the rotation of the sample clamp 23 to control the camera 21 to collect sample images of the test tube 70 at different angles; then, the test tube 70 is grasped by the sample clamp 23 to be placed in a preset area. At this time, the position of the test tube center 71 is different from that of the label 72, and the test tube center 71 can be a reference position of the sample.

[0058] In an exemplary embodiment, Figure 5 As shown, a sample identification method is provided, which is applied in scenarios such as medical laboratories, and includes the following steps 502 to 508. Among them:

[0059] Step 502, placing the sample in a preset area, and capturing an image of the sample to obtain a sample image; a label is provided outside the sample.

[0060] The sample is a container containing the liquid to be tested. Optionally, the sample can be a container such as a test tube, a sampling bottle, a cryotube, etc.; the liquid to be tested includes but is not limited to biological samples and microbial samples, etc.; biological samples are blood, saliva, etc.; microbial samples are cell samples, microbial samples, etc.

[0061] The preset area is an area for placing samples. At least one sample is placed in the preset area, and the preset area can be a sample rack or a sample table. Optionally, the preset area is a cache area for the sampling process, and the samples in the preset area are samples to be tested, and before the samples in the preset area are tested, corresponding rotation and other processing are required. Optionally, since the sample collection process and the label scanning process have different rates, different equipment or different areas, it is necessary to use the preset area for caching. For example: the sample gripper places 20 samples in the preset area per minute, and the label detector scans 90 samples per minute. At this time, samples in multiple preset areas are placed separately and transmitted to the detector of the same label respectively, so that the collection process and the label scanning process have matching rates.

[0062] The sample image can convert the information of the physical sample into sample data. The sample image reflects the information of the sample itself and the information of the label set on the outside of the sample to provide information in two dimensions. The sample image is collected when the sample is placed in the preset area to ensure processing efficiency.

[0063] The label is an identifier that carries sample information. The label supports the scanning function of the detector. The label can be a barcode, a QR code or a radio frequency tag to accurately reflect the sample information. Optionally, the label can indicate the object to which the sample belongs, the composition of the sample or other sample information. For example: In a barcode, it indicates that the sample belongs to user A, and the composition of this sample is blood.

[0064] Optionally, during the process of the sample gripper rotating around the sample, if the sample gripper rotates to a preset position, an image is captured toward the sample by a camera to obtain a sample image; after the sample gripper rotates around the sample, the sample is placed in a preset area by the sample gripper. The sample gripper may also be referred to as a gripper finger, which is used to grip or place a sample. Optionally, the sample gripper can move in three-dimensional space X / Y / Z, and at the same time has a rotational freedom in the Z-axis direction. The sample gripper grabs the sample and places it in a cache sample rack in a preset area through three-dimensional movement.

[0065] Step 504 , based on the position of the tag in the sample image and the reference position of the sample in the sample image, identifying the deflection angle between the tag and the reference position.

[0066] The reference position is the position of the body of the sample in the sample image, and the reference position can reflect the position of the label detector for label recognition. Since the sample image is an image under the camera's perspective, there is a positional difference between the reference position and the position of the label in the sample image. Optionally, the reference position can be the center line or center point of the sample, so that the center line or center point indicates the position of the sample under the corresponding camera's perspective.

[0067] The deflection angle is the angle value of the label position in the sample image that deviates from the reference position. When the deflection angle is determined, the label can be matched with the reference position by rotating the sample, thereby improving the accuracy of label recognition. Since the label of the sample is set in the columnar part, after calculating the deflection angle, the label orientation can be adjusted more efficiently and accurately by rotating.

[0068] Optionally, one or more sample images may be selected from sample images captured at different angles according to the attributes of the label in the sample images, and the deflection angle between the label and the reference position may be identified through the selected sample images to ensure accuracy. For example, a sample image may be selected according to the length of the label in the reference direction, and the deflection angle between the label and the reference position may be identified through the selected sample image. Thus, by selecting information at multiple angles, the deflection angle may be relatively small, and thus the rotation angle may be relatively small, thereby improving processing efficiency and accuracy.

[0069] Optionally, the angle difference between the tag and the reference position may be used as the deflection angle, or mapping may be performed based on the angle difference, and the mapping result may be used as the deflection angle.

[0070] Step 506: When the sample is transferred out of the preset area, the sample is rotated according to the deflection angle.

[0071] Optionally, the sample may be rotated along a preset rotation direction until a deflection angle is reached and the rotation is stopped.

[0072] Optionally, after the sample is transferred out of the cache sample rack in the preset area by the sample injection gripper, the sample is rotated until it reaches a deflection angle, the rotation process around the sample is stopped, and the sample is placed on a transmission rail, and then the sample is transferred to the outside of the preset area through the transmission rail, and then the label of the sample peripheral is identified by a detector outside the preset area.

[0073] Optionally, the sample injection gripper can move in three-dimensional space X / Y / Z and has rotational freedom in the Z-axis direction, and the sample injection gripper grabs the sample and places it on the transmission rail in a preset area through three-dimensional movement. The sample injection gripper may have a sample clamp.

[0074] Optionally, the sample is placed from the sample injection rack to the cache sample rack in the preset area by the sample identification gripper; after receiving the sample injection instruction from the system, the sample is transferred from the preset area to the track loading port by the sample injection gripper, and the sample injection gripper rotates the sample on the Z axis according to the deflection angle of the sample binding to ensure the consistency of the barcode orientation of all loaded sample tubes. The sample identification gripper and the sample injection gripper both include their own sample grippers, and the sample identification gripper is also provided with a camera for collecting sample images.

[0075] Step 508, after the sample is transferred and rotated, the label of the sample peripheral is identified through a detector with a preset orientation.

[0076] The detector is a device used to identify the label. Since the detector is pre-oriented, it can detect labels in a single orientation. The detector and the label have matching technology; for example, if the sample has a barcode on the outside, the detector is a barcode detector.

[0077] Optionally, after the sample is transferred out of a preset area and rotated until the offset angle is reached, the label of the sample peripheral is scanned by a detector with a preset orientation to perform sample identification.

[0078] Since the sample has been rotated according to the deflection angle, it can be adapted to the detector with a preset orientation, thereby ensuring accuracy. When the orientation of the detector is fixed, it can provide higher processing efficiency. Therefore, both efficiency and accuracy can be taken into account.

[0079] In the above sample identification method, the sample is placed in a preset area, and an image of the sample is collected at the same time to obtain a sample image, which can realize the sample movement process and the image collection process simultaneously to ensure processing efficiency; because the sample itself and the label set outside the sample are relatively independent, forming two relatively independent dimensions, the position of the label in the sample image and the reference position of the sample in the sample image are different, and the deflection angle between the label and the reference position can be identified; further, when the sample moves out of the preset area, the sample is rotated according to the deflection angle, so that the process of moving the sample out of the preset area and the process of rotating the sample can be executed synchronously to ensure processing efficiency, and the orientation of the label can be adapted to the detector of the preset orientation; therefore, after the sample is transferred and rotated, when the label of the sample peripheral is identified by the detector of the preset orientation, the accuracy of label identification can be guaranteed, and there is no need to adjust the angle of the label. Therefore, in the case of sample testing in medical laboratories, etc., processing efficiency is guaranteed, mobile structures are saved, and label reading accuracy is improved.

[0080] In one embodiment, the sample is placed in a preset area and an image of the sample is captured, including: during the process of the sample clamp rotating around the sample, if the sample clamp contacts the groove of the rotating code disk, an image is captured toward the sample by a camera to obtain a sample image; wherein the groove of the rotating code disk is distributed circumferentially; after the sample clamp rotates around the sample, the sample is placed in the preset area by the sample clamp.

[0081] The rotary code disk is used to detect whether the sample gripper rotates to a preset position. The rotary code disk is provided with circumferentially distributed grooves, so that when the sample gripper rotates to a preset position, a corresponding signal jump can be generated through the grooves to instruct the camera to collect an image. Optionally, the grooves of the rotary code disk are evenly distributed circumferentially, so that under the signal trigger, the barcode information of the sample in multiple directions can be photographed.

[0082] In an optional embodiment, if the sample clamp contacts the groove of the rotating code disk, the camera is used to capture an image toward the sample to obtain a sample image, including: if the clamping finger of the sample clamp rotates to the groove of the rotating code disk and triggers the groove of the rotating code disk to generate a sensor signal, the rotating code disk transmits the sensor signal to the camera at a preset position, and controls the camera to capture an image to obtain a sample image. Thus, the sample image capture process is accurately controlled by the rotational relationship between the clamping finger of the sample clamp and the groove.

[0083] In an optional embodiment, if the sample clamp contacts the groove of the rotating code disk, an image is captured toward the sample by a camera to obtain a sample image, including: if the sample clamp set by the sample identification gripper contacts the groove of the rotating code disk, an image is captured toward the sample by a camera fixed by the sample identification gripper to obtain a sample image.

[0084] Optionally, the sample identification gripper is equipped with a barcode recognition camera, which takes pictures in sequence while the sample gripper rotates around the Z axis. When the sample gripper rotates 360° around the Z axis, the four slots of the rotating code disk will trigger the sensor to jump four times, thereby triggering the camera to take pictures four times. Because the slots of the rotating code disk are evenly distributed in the circumference, the sample images in the four directions of front, back, left, and right can be captured under the signal triggering.

[0085] In this embodiment, the sample gripper rotates around the sample, and the image acquisition process is controlled by the grooves distributed circumferentially on the rotating code disk. When the camera is fixed, the corresponding acquisition signal can be triggered by the grooves to acquire the sample image at the angle corresponding to the grooves, and there is no need to adjust the camera parameters such as the focal length of the camera, thereby ensuring that the clarity of the sample image is relatively high and improving the processing efficiency. After the sample gripper rotates around the sample, the sample is placed in a preset area by the sample gripper, and the same sample gripper can be used to perform the rotation process and the placement process, thereby avoiding equipment redundancy and ensuring processing efficiency.

[0086] In one embodiment, based on the position of the label in the sample image and the reference position of the sample in the sample image, the deflection angle between the label and the reference position is identified, including: in the sample images collected when the sample is rotated to different angles, according to the length of the label in the reference direction, selecting the target sample image at the target angle; based on the position of the label in the target sample image and the reference position of the sample in the target sample image, the deflection angle between the label and the reference position is identified.

[0087] The reference direction is a partial direction of the image dimension contained in the sample image. Optionally, the reference direction is the direction of the sample image in the width dimension, and correspondingly, the length of the label in the reference direction is the width of the label in the sample image; in this case, when the label is arranged in the test tube along the height direction, the length of the label in the reference direction is relatively small, and the deflection angle is relatively small to ensure processing efficiency.

[0088] Optionally, the reference direction is the direction of the sample image in the height dimension, and correspondingly, the length of the label in the reference direction is the height of the label in the sample image; at this time, when the label is arranged in the test tube along the width direction, the length of the label in the reference direction is relatively small, and the deflection angle is relatively small to ensure processing efficiency.

[0089] The target angle is one of the different angles. The target angle is determined based on the conditions that the length of the tag in the reference direction meets. Figure 6 As shown, the camera 21 collects a corresponding sample image toward the sample 70 , the radius of the sample 70 is r, and the width of the label 72 is w.

[0090] In an optional embodiment, among the sample images acquired when the sample is rotated to different angles, a target sample image at a target angle is selected according to the length of the label in a reference direction, including: among the sample images acquired when the sample is rotated to different angles, a target sample image with the largest label width is selected; wherein the angle at which the target sample image with the largest label width is located is the target angle.

[0091] Optionally, since the sample image is acquired, the sample image is related to the camera angle of view, so when the sample tube is placed in the preset area, the angle of the label orientation is difficult to determine, and the widest label under the camera angle of view can always be found in the four acquired images, so that the deflection angle can be relatively small. For example, the deflection angle between the barcode center and the sample tube center angle can be less than or equal to 45 degrees.

[0092] In this embodiment, the sample is controlled to rotate to different angles, so there is no need to adjust the camera parameters such as the focal length of the camera, which ensures that the clarity of the sample image is relatively high and improves the processing efficiency; moreover, according to the length of the label in the reference direction, the target sample image at the target angle is selected, and the data dimension of the sample image can be reduced through the reference direction, so that the image dimension is converted into the dimension of the reference direction, so as to ensure the processing efficiency through less data. Moreover, the difference between the label position and the reference position can be accurately measured through the length of the reference direction to ensure the accuracy of the deflection angle. Finally, the deflection angle is determined based on the target sample image, which can remove redundant sample images and improve processing efficiency.

[0093] In one embodiment, based on the position of the label in the sample image and the reference position of the sample in the sample image, the deflection angle between the label and the reference position is identified, including: in the sample image, detecting the center position of the label in the reference direction to obtain the label position in the sample image; in the sample image, determining the reference position of the sample based on the center position of the sample in the reference direction; calculating the pixel position difference based on the label position and the reference position of the sample to obtain the pixel position difference; and converting the pixel position difference into the deflection angle according to the camera parameters of the sample image.

[0094] The center position is the center point or center line of the object contained in the sample image. Optionally, the center position of the label in the reference direction is the center point of the label, and the center position of the sample in the reference direction is the center point of the sample; for example: on the x-axis of the sample image, a set of relative edge coordinates of the label is A and B, then the center position of the label is (A+B) / 2; on the x-axis of the sample image, a set of relative edge coordinates of the sample is C and D, then the center position of the label is (C+D) / 2.

[0095] The label position is the position of the label in the sample image. The label position can be the center position of the sample in the reference direction, or it can be the center position of the sample in the reference direction adjusted.

[0096] The pixel position difference is the pixel position difference between the tag position and the reference position in the reference direction. Optionally, the pixel position difference can be the distance difference between pixels, or the distance difference between pixel blocks composed of multiple pixels. When the pixel position difference is the distance difference between pixel blocks, the amount of data can be further reduced to improve processing efficiency.

[0097] The camera parameters are the shooting parameters of the sample image during the acquisition process, which are used to reflect the camera's viewing angle. Optionally, the camera parameters include the camera distance and the camera's resolution in the reference direction; the camera distance is the distance between the camera and the sample, so as to convert the information in the sample image into the information in the actual scene.

[0098] In an optional embodiment, in a sample image, the center position of the label in a reference direction is detected to obtain the label position in the sample image, including: in the sample image, based on the length of the label in the width direction, determining the center position of the label in the width direction; and obtaining the label position in the sample image based on the center position.

[0099] In an optional embodiment, in the sample image, the reference position of the sample is determined based on the center position of the sample in the reference direction, including: in the sample image, based on the length of the sample in the width direction, determining the center position of the sample in the width direction; and obtaining the reference position of the sample based on the center position of the sample in the width direction.

[0100] In an optional embodiment, a pixel position difference is calculated based on the label position and the reference position of the sample to obtain the pixel position difference, including: a difference calculation is performed based on the x-coordinate of the label center point in the sample image and the x-coordinate of the sample center point in the sample image to obtain the pixel position difference.

[0101] In this embodiment, the label position and the reference position of the sample are both positions in the reference direction, so both belong to position data in the same dimension, and therefore the pixel position difference also belongs to the pixel difference in the reference direction dimension. Then, according to the camera parameters of the sample image, the pixel position difference is converted into a deflection angle, which enables the data to be converted to the dimension of the actual scene, thereby helping to improve the accuracy of the deflection angle.

[0102] In one embodiment, the camera parameters include the camera distance and the number of pixels of the camera at the camera distance; the camera distance is the distance between the camera and the sample. The camera distance indicates the distance between the camera installation position and the sample. The farther the camera is from the sample, the more pixels are captured, and the corresponding shooting distance is also longer. In this case, the ratio between the camera distance and the number of pixels can more accurately reflect the position difference between the position in the sample image and the actual position.

[0103] According to the camera parameters of the sample image, the pixel position difference is converted into a deflection angle, including: based on the ratio between the camera distance and the number of pixels, the pixel position difference is converted into a deviation position; based on the ratio between the deviation position and the container radius of the sample, an angle conversion is performed to obtain the deflection angle.

[0104] The deviation position is the position difference between the label and the position detected by the detector in the actual coordinate system. The difference between the pixel position difference and the deviation position is that the pixel position difference belongs to the position difference in the image sample; correspondingly, the deviation position is the actual position difference between the label and the sample. Exemplarily, the pixel position difference is the pixel position difference between the label position (x1, y2) and the reference position x2, that is, P=|x1-x2|; while the deviation position is the angle at which the label deviates from the central axis of the test tube, which is converted based on the ratio k between the camera distance and the number of pixels, that is, Z=k|x1-x2|.

[0105] The container radius of the sample is the radius of the sample tube or sample bottle. Since the reference position is determined based on the center position of the sample in the sample image, the deviation position can be determined more accurately by its container radius.

[0106] Optionally, the expression for the deflection angle is as follows:

[0107] α=arctan [(P*109.1 / 1536) / r]*180 / π;

[0108] Wherein, arctan is an inverse trigonometric function, P is the number of pixels that the center point of the barcode deviates from the center axis of the test tube, that is, the pixel position difference; r is the radius of the sample container; 109.1 is the camera distance; 1536 is the number of pixels in the vertical direction between the camera and the sample tube. When the camera distance is 91mm, the corresponding number of pixels is 109.4mm; (P*109.1 / 1536) is the deviation position; 180 / π is the constant for converting radians to angles.

[0109] In this embodiment, the ratio between the camera distance and the number of pixels can reflect the viewing angle of the camera for image acquisition. Therefore, through this ratio, the pixel position difference is converted into a deviation position, which can more accurately determine the distance that the label deviates from the center of the sample; and based on the angle conversion based on the ratio between the deviation position and the container radius of the sample, the deviation position can be further refined based on the structure of the sample to obtain a deflection angle that is closer to the actual scene, so as to more accurately identify the label.

[0110] In one embodiment, according to the camera parameters of the sample image, the pixel position difference is converted into a deflection angle, including: according to the camera parameters of the sample image, the pixel position difference is converted into an initial deflection angle; according to a preset correspondence, the initial deflection angle is adjusted to obtain a converted deflection angle; the preset correspondence is obtained by fitting a data set of the initial deflection angle and a data set of the converted deflection angle.

[0111] Correspondingly, when the sample is transferred out of the preset area, the sample is rotated according to the deflection angle, including: when the sample is transferred out of the preset area, the sample is rotated according to the deflection angle after conversion.

[0112] The initial deflection angle is obtained by mapping the pixel position difference based on the camera parameters. Optionally, the pixel position difference can be converted into an angle to obtain the initial deflection angle; optionally, the pixel position difference can be converted into a deviation position based on the ratio between the camera distance and the number of pixels; the angle conversion is performed based on the ratio between the deviation position and the container radius of the sample to obtain the initial deflection angle.

[0113] The preset corresponding relationship is obtained by fitting the data set of the initial deflection angle and the data set of the converted deflection angle. Optionally, the preset corresponding relationship is obtained based on polynomial linear fitting.

[0114] Optionally, the expression of the preset corresponding relationship is as follows:

[0115] α0 = 0.0128α 2 + 0.9947α;

[0116] Among them, α0 is the deflection angle after conversion, and α is the initial deflection angle.

[0117] like Figure 7 As shown, the initial deflection angle is α, and the corresponding compensation value is β; correspondingly, the fitting process of the preset corresponding relationship is as follows Figure 8 As shown; after obtaining the preset corresponding relationship, α can be converted to obtain the converted deflection angle α0 to ensure accuracy. The relationship between the initial deflection angle, compensation value, and converted deflection angle is shown in Table 1, which is as follows:

[0118] Table 1

[0119] Calculated value α Compensation value β <![CDATA[Deflection angle α0 after conversion]]> 31.37 13.628 44.998 29.14 9.726 38.866 26.244 8.758 35.002 23.479 6.461 29.94 20.162 4.778 24.94 16.486 3.454 19.94 12.635 2.304 14.939 8.561 1.378 9.939 4.338 0.602 4.94 0 0 0

[0120] In this embodiment, based on the relatively small angle between the center of the maximum width barcode and the center of the test tube of the sample image, since the camera shoots at a planar perspective, there will be a deviation angle between the initial deflection angle and the actual angle between the center of the barcode and the center of the sample. In order to eliminate the angle deviation value, the parameters in the data set are taken under different angle conditions and fitted to improve accuracy.

[0121] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0122] Based on the same inventive concept, the embodiment of the present application also provides a sample identification device for implementing the sample identification method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiment of the identification device for one or more samples provided below can refer to the limitations of the sample identification method above, and will not be repeated here.

[0123] In an exemplary embodiment, Fig. 9 As shown, a sample identification device is provided, comprising:

[0124] The sample placement module 902 is used to place the sample in a preset area and collect an image of the sample to obtain a sample image; the sample is provided with a label;

[0125] An angle calculation module 904, used to identify the deflection angle between the tag and the reference position based on the position of the tag in the sample image and the reference position of the sample in the sample image;

[0126] A sample transfer module 906, configured to rotate the sample according to the deflection angle when the sample is transferred out of the preset area;

[0127] The label recognition module 908 is used to recognize the label of the sample peripheral device through a detector with a preset orientation after the sample is removed and rotated.

[0128] In one embodiment, the sample placement module 902 is used to:

[0129] When the sample clamp rotates around the sample, if the sample clamp contacts the groove of the rotating code disk, the camera is used to collect images toward the sample to obtain a sample image; wherein the grooves of the rotating code disk are distributed circumferentially;

[0130] After the sample gripper rotates around the sample, the sample is placed in a preset area by the sample gripper.

[0131] In one embodiment, the angle calculation module 904 is used to:

[0132] Among the sample images collected when the sample is rotated to different angles, a target sample image at a target angle is selected according to the length of the label in a reference direction;

[0133] Based on the position of the tag in the target sample image and the reference position of the sample in the target sample image, a deflection angle between the tag and the reference position is identified.

[0134] In one embodiment, the angle calculation module 904 is used to:

[0135] In the sample image, detecting the center position of the label in a reference direction to obtain the label position in the sample image;

[0136] In the sample image, determining a reference position of the sample based on a center position of the sample in the reference direction;

[0137] Calculating a pixel position difference based on the label position and the reference position of the sample to obtain a pixel position difference;

[0138] The pixel position difference is converted into a deflection angle according to the camera parameters of the sample image.

[0139] In one embodiment, the camera parameters include a camera distance and a number of pixels of the camera at the camera distance; the camera distance is a distance between the camera and the sample;

[0140] The angle calculation module 904 is used to:

[0141] converting the pixel position difference into a deviation position based on a ratio between the camera distance and the number of pixels;

[0142] Angle conversion is performed based on the ratio between the deviation position and the container radius of the sample to obtain a deflection angle.

[0143] In one embodiment, the angle calculation module 904 is used to:

[0144] According to the camera parameters of the sample image, converting the pixel position difference into an initial deflection angle;

[0145] According to a preset corresponding relationship, the initial deflection angle is adjusted to obtain a deflection angle after conversion; the preset corresponding relationship is obtained by fitting a data set of the initial deflection angle and a data set of the deflection angle after conversion;

[0146] Correspondingly, the sample transfer module 906 is used to:

[0147] When the sample is transferred out of the preset area, the sample is rotated according to the deflection angle after the conversion.

[0148] Each module in the above sample identification device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0149] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig.10As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (Near Field Communication, NFC) or other technologies. When the computer program is executed by the processor, a sample recognition method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0150] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0151] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0152] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

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

[0154] 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, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0155] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0156] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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 application.

[0157] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A sample identification method, characterized in that: The method comprises: Placing a sample in a preset area and collecting an image of the sample to obtain a sample image; a label is provided outside the sample; Based on the position of the tag in the sample image and the reference position of the sample in the sample image, identifying a deflection angle between the tag and the reference position; When the sample is transferred out of the preset area, rotating the sample according to the deflection angle; After the sample is transferred and rotated, the label of the sample peripheral is identified through a detector with a preset orientation.

2. The method according to claim 1, characterized in that Placing the sample in a preset area and capturing an image of the sample includes: When the sample clamp rotates around the sample, if the sample clamp contacts the groove of the rotating code disk, the camera is used to collect images toward the sample to obtain a sample image; wherein the grooves of the rotating code disk are distributed circumferentially; After the sample gripper rotates around the sample, the sample is placed in a preset area by the sample gripper.

3. The method according to claim 1, characterized in that The step of identifying a deflection angle between the label and the reference position based on the position of the label in the sample image and the reference position of the sample in the sample image comprises: Among the sample images collected when the sample is rotated to different angles, a target sample image at a target angle is selected according to the length of the label in a reference direction; Based on the position of the tag in the target sample image and the reference position of the sample in the target sample image, a deflection angle between the tag and the reference position is identified.

4. The method according to claim 1, characterized in that: The step of identifying a deflection angle between the label and the reference position based on the position of the label in the sample image and the reference position of the sample in the sample image comprises: In the sample image, detecting the center position of the label in a reference direction to obtain the label position in the sample image; In the sample image, determining a reference position of the sample based on a center position of the sample in the reference direction; Calculating a pixel position difference based on the label position and the reference position of the sample to obtain a pixel position difference; The pixel position difference is converted into a deflection angle according to the camera parameters of the sample image.

5. The method according to claim 4, characterized in that The camera parameters include a camera distance and the number of pixels of the camera at the camera distance; the camera distance is the distance between the camera and the sample; The step of converting the pixel position difference into a deflection angle according to the camera parameters of the sample image comprises: converting the pixel position difference into a deviation position based on a ratio between the camera distance and the number of pixels; Angle conversion is performed based on the ratio between the deviation position and the container radius of the sample to obtain a deflection angle.

6. The method according to claim 4, characterized in that The step of converting the pixel position difference into a deflection angle according to the camera parameters of the sample image comprises: According to the camera parameters of the sample image, converting the pixel position difference into an initial deflection angle; According to a preset corresponding relationship, the initial deflection angle is adjusted to obtain a deflection angle after conversion; the preset corresponding relationship is obtained by fitting a data set of the initial deflection angle and a data set of the deflection angle after conversion; When the sample is transferred out of the preset area, rotating the sample according to the deflection angle includes: When the sample is transferred out of the preset area, the sample is rotated according to the deflection angle after the conversion.

7. A sample identification device, characterized in that: The device comprises: A sample placement module is used to place the sample in a preset area and collect images of the sample to obtain a sample image; the sample is provided with a label; an angle calculation module, configured to identify a deflection angle between the tag and the reference position based on the position of the tag in the sample image and the reference position of the sample in the sample image; A sample transfer module, used for rotating the sample according to the deflection angle when the sample is transferred out of the preset area; The label recognition module is used to recognize the label of the sample peripheral device through a detector with a preset orientation after the sample is removed and rotated.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Rotation angle detection method and device, model training method and device, equipment and medium

    CN116957046A

  • Sample processing system

    CN117805406A

  • Method for preparing for and carrying out the acquisition of image stacks of a sample from various orientation angles

    US20150153560A1

  • Method, device, and non-transitory computer readable medium for detecting label on curved container

    US20230368420A1

  • System and method for automatically orienting product containers

    US20240278952A1