Image recognition-based test tube state determination method, device and system

By using image recognition technology to determine the status of test tubes, the problem of uncertain test tube position in serum sample processing is solved, thereby improving the throughput and detection efficiency of the automated line.

CN116385357BActive Publication Date: 2026-03-20MACCURA MEDICAL INSTR CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-24
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

In existing technologies, during serum sample processing, some areas of the test tube tray are empty of test tubes or contain only gel, resulting in redundant clamping operations, which reduces the throughput, detection speed, and accuracy of the automated line.

Method used

Image recognition technology is used to capture images of test tubes after they have been picked up. These images are then binarized to determine the presence of the test tubes and to fit the lower region of the test tubes. The test tube status type is then identified, including empty test tubes, test tubes containing only gel, and test tubes containing serum.

Benefits of technology

It increased the throughput of the production line, reduced redundant operations, and improved the speed and accuracy of serum sample testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116385357B_ABST
    Figure CN116385357B_ABST
Patent Text Reader

Abstract

The application provides a test tube state judgment method, device and system based on image recognition. The test tube state judgment method based on image recognition comprises the following steps: obtaining a shooting image after a test tube clamping operation is performed; performing binaryzation processing on the shooting image to obtain a binaryzation image; determining whether a test tube exists based on the binaryzation image; in the case where the test tube exists, fitting a lower region of the test tube in the binaryzation image and judging a state type of the test tube based on a fitting result, wherein the state type comprises an empty test tube, a test tube containing only gel and a test tube containing serum. The position of the test tube without the test tube or the test tube not meeting the requirements can be excluded in advance before sample processing, subsequent operations are reduced, and the throughput of the pipeline 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 serum sample processing, and in particular to a test tube state judgment method, device and system based on image recognition. BACKGROUND

[0002] In related technologies, the pre-processing stage of serum sample processing is mostly to judge the color and shape of the test tube cap, whether there is a test tube cap, and the size of the test tube. However, if some positions in the test tube tray are empty, or empty test tubes, or test tubes containing only gel, during the serum sample processing process, it will lead to redundant test tube clamping operations and serum sample detection processing operations, reducing the throughput of the pipeline and the detection speed and accuracy of the serum sample. SUMMARY

[0003] To solve the above problems, the present application provides a test tube state judgment method, device and system based on image recognition.

[0004] In a first aspect, the present application provides a test tube state judgment method based on image recognition, comprising:

[0005] obtaining a photographed image after performing a test tube clamping operation;

[0006] performing binaryzation processing on the photographed image to obtain a binaryzation image;

[0007] determining whether there is a test tube based on the binaryzation image;

[0008] in the case of existing test tubes, fitting the lower region of the test tube in the binaryzation image and judging the state type of the test tube based on the fitting result, the state type including empty test tubes, test tubes containing only gel and test tubes containing serum.

[0009] In some implementations, the binaryzation processing on the photographed image to obtain a binaryzation image comprises:

[0010] converting the photographed image into a gray scale image;

[0011] performing filtering processing on the gray scale image;

[0012] performing binaryzation operation on the filtered gray scale image to obtain a binaryzation image. Figure Two

[0013] In some implementations, the determination of whether there is a test tube based on the binaryzation image comprises:

[0014] determining whether the height of the object in the binaryzation image is less than a preset proportion of the height of the photographed image;

[0015] ​In a case where the object height is less than a preset proportion of the height of the photographed image, it is determined that no test tube exists;

[0016] In a case where the object height is not less than a preset proportion of the height of the photographed image, it is determined that a test tube exists.

[0017] In some implementations, the fitting of the lower test tube region in the binary image and the determination of the state type of the test tube based on the fitting result include:

[0018] determining a contour pixel point with a pixel value of 255 in each column of the binary image as the lowest pixel point;

[0019] sorting the coordinates of the contour pixel points according to the y coordinates and determining a maximum value of the y coordinates;

[0020] extracting, from the contour pixel points, a pixel point whose distance from a contour pixel point corresponding to the maximum value of the y coordinates in the y axis direction is not more than a first threshold value;

[0021] performing curve fitting on the extracted pixel point to obtain a first fitting result of the lower test tube region;

[0022] determining whether there is a pixel point exceeding the boundary of the binary image in the first fitting result;

[0023] in a case where there is a pixel point exceeding the boundary of the binary image, determining that the state type of the test tube is a test tube containing only gel.

[0024] In some implementations, the first threshold value is determined based on the width of the test tube, and the first fitting result includes an arc-shaped contour of the lower test tube region.

[0025] In some implementations, the fitting of the lower test tube region in the binary image and the determination of the state type of the test tube based on the fitting result further include:

[0026] in a case where there is no pixel point exceeding the boundary of the binary image, extracting a minimum value of the x coordinates and a maximum value of the x coordinates in the first fitting result, performing straight line fitting on pixel points corresponding to the minimum value of the x coordinates and the maximum value of the x coordinates respectively to obtain a second fitting result of the lower test tube region;

[0027] counting the number of pixel points with a pixel value equal to 255 and the total number of pixel points in a closed region formed based on the first fitting result and the second fitting result;

[0028] calculating a ratio of the number of pixel points with a pixel value equal to 255 to the total number of pixel points in the closed region;

[0029] determine whether the state type of the test tube is a test tube containing serum based on a relationship between the ratio and a second threshold value.

[0030] In some implementations, the second threshold value includes an upper threshold value and a lower threshold value; and the determining whether the state type of the test tube is a test tube containing serum based on the relationship between the ratio and the second threshold value includes:

[0031] if the ratio is not less than the upper threshold value, determining that the state type of the test tube is a test tube containing serum;

[0032] if the ratio is not greater than the lower threshold value, determining that the state type of the test tube is an empty test tube.

[0033] In some implementations, the state type further includes an abnormal test tube; and the determining whether the state type of the test tube is a test tube containing serum based on the relationship between the ratio and the second threshold value further includes:

[0034] if the ratio is greater than the lower threshold value and less than the upper threshold value, determining that the state type of the test tube is an abnormal test tube.

[0035] In a second aspect, an embodiment of the present application provides a test tube state determination device based on image recognition, comprising:

[0036] an acquisition module configured to acquire a photographed image after a test tube gripping operation is performed;

[0037] a binarization module configured to perform binarization processing on the photographed image to obtain a binarized image;

[0038] a determination module configured to determine whether a test tube exists based on the binarized image, and in the case where a test tube exists, fit a lower region of the test tube in the binarized image and determine a state type of the test tube based on a fitting result, the state type including an empty test tube, a test tube containing only gel, and a test tube containing serum.

[0039] In some implementations, the binarization module is configured to convert the photographed image into a grayscale image, perform filtering processing on the grayscale image, perform a threshold value operation on the grayscale image after the filtering processing to obtain a binarized image. Figure Two

[0040] In some implementations, the determination module is configured to:

[0041] determine whether an object height in the binarized image is less than a preset proportion of a height of the photographed image;

[0042] in the case where the object height is less than the preset proportion of the height of the photographed image, determine that no test tube exists;

[0043] ​In a case where the object height is not less than a preset proportion of a height of the captured image, it is determined that the test tube exists.

[0044] In some implementations, the judging module is configured to:

[0045] In a case where the test tube exists, the profile pixel point with the lowest pixel value of 255 in each column of pixels of the binary image is determined.

[0046] The coordinates of the profile pixel points are sorted according to the y coordinates, and the maximum value of the y coordinates is determined.

[0047] The pixel points in the profile pixel points corresponding to the maximum value of the y coordinates in the y axis direction and having a distance not more than a first threshold value are extracted.

[0048] Curve fitting is performed on the extracted pixel points to obtain a first fitting result of a lower region of the test tube.

[0049] It is determined whether there are pixel points in the first fitting result that are out of the boundary of the binary image.

[0050] In a case where there are pixel points out of the boundary of the binary image, it is determined that the state type of the test tube is a test tube containing only gel.

[0051] In some implementations, the first threshold value is determined based on the width of the test tube, and the first fitting result includes an arc-shaped profile of the lower region of the test tube.

[0052] In some implementations, the judging module is further configured to:

[0053] In a case where there are no pixel points out of the boundary of the binary image, the minimum value of the x coordinates and the maximum value of the x coordinates in the first fitting result are extracted, and straight line fitting is performed on the pixel points corresponding to the minimum value of the x coordinates and the maximum value of the x coordinates, respectively, to obtain a second fitting result of the lower region of the test tube.

[0054] For a closed region formed based on the first fitting result and the second fitting result, the number of pixel points with a pixel value equal to 255 and the total number of pixel points in the closed region are counted.

[0055] The ratio of the number of pixel points with a pixel value equal to 255 to the total number of pixel points in the closed region is calculated.

[0056] Based on the relationship between the ratio and a second threshold value, it is determined whether the state type of the test tube is a test tube containing serum.

[0057] In some implementations, the second threshold includes an upper threshold and a lower threshold; and determining, based on the relationship between the ratio and the second threshold, whether the state type of the test tube is a test tube containing serum, includes:

[0058] If the ratio is not less than the upper threshold, it is determined that the state type of the test tube is a test tube containing serum.

[0059] If the ratio is not greater than the lower threshold, it is determined that the state type of the test tube is an empty test tube.

[0060] In some implementations, the state type further includes an abnormal test tube; and determining, based on the relationship between the ratio and the second threshold, whether the state type of the test tube is a test tube containing serum, further includes:

[0061] If the ratio is greater than the lower threshold and less than the upper threshold, it is determined that the state type of the test tube is an abnormal test tube.

[0062] In a third aspect, an embodiment of the present application provides a computer readable storage medium, and the computer readable storage medium stores a computer program. When the computer program is executed by at least one processor, the method according to the first aspect is implemented.

[0063] In a fourth aspect, an embodiment of the present application provides a full-automatic sample processing system, which includes a memory and at least one processor. The memory stores a computer program, and the computer program is executed by the at least one processor to implement the method according to the first aspect.

[0064] In some implementations, the full-automatic sample processing system further includes:

[0065] A test tube clamping device configured to perform a test tube clamping operation to move a test tube away from a test tube rack.

[0066] A photographing device configured to perform image photographing after the test tube clamping operation.

[0067] One or more embodiments of the present application bring at least the following beneficial effects:

[0068] The present application acquires a photographed image after performing a test tube clamping operation, performs a binaryzation process on the photographed image, determines whether a test tube exists based on the obtained binaryzation image, and in the case where a test tube exists, fits a lower region of the test tube in the binaryzation image and judges a state type of the test tube based on a fitting result. It can be determined whether a test tube exists at each position of a test tube storage region, and in the case where a test tube exists, the state type of the test tube is identified as an empty test tube, a test tube containing only gel, a normal test tube containing serum, or even an abnormal test tube. Therefore, positions without a test tube or test tubes not meeting requirements can be excluded in advance before sample processing, subsequent operations are reduced, and the throughput of a pipeline is improved. Attached Figure Description

[0069] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope.

[0070] Figure One This is a flowchart of the test tube status judgment method based on image recognition provided in an embodiment of the present invention;

[0071] Figure Two This is an example of a set of images taken after performing a test tube clamping operation, provided by an embodiment of the present invention, wherein (a) is an image taken without a test tube; (b) is an image taken with an empty test tube; (c) is an image taken with a test tube containing only gel; and (d) is an image taken with a normal test tube containing serum.

[0072] Figure Three Here are examples of a set of binarized images provided in the embodiments of the present invention, wherein (a) is a binarized image without a test tube; (b) is a binarized image of an empty test tube; (c) is a binarized image of a test tube containing only gel; and (d) is a binarized image of a normal test tube containing serum.

[0073] Figure Four Examples of fitting results for the lower region of a test tube in a binarized image provided in this embodiment of the invention are shown below. (a) is the fitting result for an empty test tube; (b) is the fitting result for a test tube containing only gel; and (c) is the fitting result for a normal test tube containing serum.

[0074] Figure Five This is a block diagram of a test tube status determination device based on image recognition provided in an embodiment of the present invention. Detailed Implementation

[0075] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0076] Example One

[0077] This embodiment provides a test tube status determination method based on image recognition, such as... Figure One As shown, it includes:

[0078] Step S101: Obtain the image after performing the test tube clamping operation.

[0079] In practical applications, serum tubes are placed in the test tube storage area. Test tube clamps are used within a specific sealed cavity to remove the tubes from the rack. During this process, uniform lighting is maintained within the cavity to avoid interfering with image capture. After removal, the tubes are moved into the designated space for image capture.

[0080] For situations where there are no test tubes, empty test tubes, or test tubes containing only gel in certain locations of the storage area due to insufficient samples or misoperation, this embodiment performs a test tube clamping operation on the test tube rack where serum test tubes should be stored, and then takes an image. Based on the captured image, subsequent steps identify whether test tubes are present in each location, and if test tubes are present, identify the state type of the test tubes: empty test tubes, test tubes containing only gel, or normal test tubes containing serum.

[0081] Figure Two Examples of images taken after a test tube clamping operation are shown, wherein (a) shows an image without a test tube, i.e., the test tube clamping operation was performed but the corresponding position in the storage area did not have a test tube, and the test tube could not be clamped; (b) shows an image of an empty test tube; (c) shows an image of a test tube containing only gel; and (d) shows an image of a normal test tube containing serum.

[0082] Step S102: Binarize the captured image to obtain a binarized image.

[0083] To improve the recognition of the presence and type of test tubes, the captured images are binarized. Subsequent identification of the presence of test tubes, and in the case of test tubes, whether the test tube is empty, contains only gel, or contains serum, is based on the binarized images.

[0084] In some implementations, the captured image is binarized to obtain a binary image, including:

[0085] Step S102a: Convert the captured image to grayscale;

[0086] Step S102b: Filter the grayscale image;

[0087] Step S102c: Process the filtered grayscale values. Figure Two The binarization operation yields a binarized image.

[0088] After converting the captured image from an RGB color image to a grayscale image, there may be some interfering data (noise) in the image. In this embodiment, the grayscale image is filtered and then binarized to effectively remove the interference in the image, making the object outline in the binarized image clearer and the recognition result more accurate.

[0089] Filtering can include, but is not limited to, Gaussian filtering. Binarization operations can be performed using, but are not limited to, Otsu's method. For example, histogram methods, entropy algorithms, and adaptive thresholding methods can also be used.

[0090] Figure Three Examples of a set of binarized images are shown, wherein (a) shows a binarized image without a test tube; (b) shows a binarized image of an empty test tube; (c) shows a binarized image of a test tube containing only gel; and (d) shows a binarized image of a normal test tube containing serum.

[0091] Step S103: Determine whether a test tube exists based on the binarized image.

[0092] In some implementations, the presence of a test tube is determined based on a binary image, including:

[0093] Step S103a: Determine whether the height of the object in the binarized image is less than a preset ratio of the height of the captured image; if the height of the object is less than the preset ratio of the height of the captured image, determine that there is no test tube; if the height of the object is not less than the preset ratio of the height of the captured image, determine that there is a test tube.

[0094] In a preferred implementation, the preset ratio is 1 / 2. Therefore, if the height of an object in the binarized image is less than half the height of the original RGB image, it indicates that the object height is too low and does not meet the height requirement of the test tube; therefore, in this case, the test tube is determined to be absent. Conversely, if the height of an object in the binarized image is not less than half the height of the original RGB image, it indicates that the object height meets the height requirement of the test tube; in this case, the test tube exists.

[0095] If test tubes are present, proceed to step S104.

[0096] Step S104: Fit the lower region of the test tube in the binarized image and determine the state type of the test tube based on the fitting result. The state types include empty test tube, test tube containing only gel, and test tube containing serum.

[0097] In a case where it is determined that the test tube exists in the binarized image, a lower region of the test tube is further fitted to obtain a contour shape of the lower region of the test tube and / or a distribution of the white part, so as to determine a specific state type of the test tube according to corresponding features of different state types.

[0098] In some implementations, fitting the lower region of the test tube in the binarized image and determining the state type of the test tube based on the fitting result can include:

[0099] In step S104a, contour pixel points with a pixel value of 255 in the lowermost part of each column of pixel points in the binarized image are determined. By determining the contour pixel points of the white (pixel value of 255) part of the lower region in the binarized image, the contour shape of the lower region of the test tube can be obtained, and then whether the test tube in the current binarized image is a serum-free test tube containing only gel (which needs to be excluded) can be determined according to the contour shape of the lower region of the test tube.

[0100] The coordinates of the contour pixel points with a pixel value of 255 in the lowermost part of each column of pixel points in the binarized image are recorded to obtain a first coordinate array x0, y0; x1, y1; x2, y2;...; xn, yn, where n represents the number of contour pixel points.

[0101] In step S104b, the coordinates of the contour pixel points are sorted according to the y coordinate to determine the maximum value of the y coordinate.

[0102] In step S104b, the coordinates of the contour pixel points are sorted according to the y coordinate to determine the maximum value of the y coordinate.

[0103] In step S104b, the coordinates of the contour pixel points are sorted according to the y coordinate to determine the maximum value of the y coordinate.

[0104] In order to enable the fitting result to cover the lower region of the test tube and avoid the influence of the test tube label on the state type judgment, and to obtain an accurate state type judgment result, pixel points in the first threshold of the contour pixel points corresponding to the maximum y coordinate in the y direction from the second coordinate array are extracted. The first threshold can be set according to actual conditions. In some cases, the first threshold can be determined based on the width of the test tube. For example, the value of the first threshold is equal to or approximately equal to the number of pixel points occupied by the width of the test tube, so that the first fitting result contains the arc-shaped contour of the lower region of the test tube. In one example, in order to enable the curve contained in the first fitting result to cover the arc-shaped region of the bottom of the test tube, the first threshold takes any value in 50 to 70. It should be understood that the value of the first threshold is not limited to this value range, and the first threshold can be set according to the width of the test tube or other factors in actual application.

[0105] Step S104d, curve fitting is performed on the extracted pixel points to obtain a first fitting result of the lower region of the test tube. Curve fitting is performed on the contour pixel points of the lower region of the test tube extracted in the foregoing to obtain a fitting curve, so as to judge the state type of the current test tube.

[0106] Step S104e, it is determined whether there are pixel points exceeding the boundary of the binary image in the first fitting result. In the case where there are pixel points exceeding the boundary of the binary image, step S104f is performed.

[0107] Step S104f, it is determined that the state type of the test tube is a test tube containing only gel.

[0108] If any pixel point of the fitting exceeds the boundary of the binary image and cannot be fitted into a curve on the binary image, the current test tube is a test tube containing only gel. The boundary of the binary image can be determined according to the size of the photographed image. If the first fitting result is a curve, the curve reflects the arc-shaped contour of the lower region of the test tube, and it is further determined whether the current test tube is a test tube containing serum.

[0109] In some implementations, fitting the lower region of the test tube in the binary image and judging the state type of the test tube based on the fitting result further includes:

[0110] Step S104g, in the case where there are no pixel points exceeding the boundary of the binary image, the minimum x coordinate and the maximum x coordinate in the first fitting result are extracted, and straight line fitting is performed on the pixel points corresponding to the minimum x coordinate and the maximum x coordinate respectively to obtain a second fitting result of the lower region of the test tube.

[0111] Straight line fitting is performed on the pixel points corresponding to the minimum x coordinate and the maximum x coordinate extracted from the first fitting result, so that the liquid level contour in the test tube can be determined.

[0112] Step S104h, for the closed region formed based on the first fitting result and the second fitting result, counting the number of pixel points with pixel value equal to 255 and the total number of pixel points in the closed region.

[0113] Step S104i, calculating the ratio of the number of pixel points with pixel value equal to 255 to the total number of pixel points in the closed region.

[0114] Step S104j, determining whether the state type of the test tube is a test tube containing serum based on the relationship between the ratio and the second threshold value.

[0115] Since the test tube label may not be uniformly attached, but will avoid the bottom arc-shaped area, based on the arc-shaped contour and the liquid level contour of the lower part of the test tube obtained in the foregoing, a closed region can be obtained, which is the part of the test tube bottom arc, avoiding the influence of the test tube label on the judgment result. Further, the ratio R of the number of white pixel points in this part to the total number of pixel points in this part is calculated, which can determine whether the current test tube is a test tube containing serum. If the proportion of white pixel points below the liquid level in the test tube reaches a certain degree, it indicates that the current test tube is a normal test tube containing serum. This method does not need to consider whether the liquid level is horizontal, even if the test tube is placed at a certain inclination angle, it will not affect the judgment of the state type. Therefore, it is not necessary to correct the liquid level to be horizontal before judging, and the judgment process is accurate and efficient.

[0116] Figure Four Fitting result examples of the lower part of the test tube in the binary image are shown, wherein (a) is the fitting result of an empty test tube; (b) is the fitting result of a test tube containing only gel; and (c) is the fitting result of a normal test tube containing serum.

[0117] Since factors such as image quality, red blood cell state, fitting deviation, etc. may affect the judgment result, the second threshold value is set in the embodiment to further judge the case of a possible normal test tube containing serum, so as to improve the accuracy of the state type judgment and eliminate empty test tubes.

[0118] In some implementations, the second threshold value includes an upper threshold value t0 and a lower threshold value t1; and determining whether the state type of the test tube is a test tube containing serum based on the relationship between the ratio and the second threshold value includes:

[0119] If the ratio is not less than the upper threshold value, it is determined that the state type of the test tube is a test tube containing serum.

[0120] If the ratio is not greater than the lower threshold value, it is determined that the state type of the test tube is an empty test tube.

[0121] In some implementations, the state type of the test tube further includes an abnormal test tube; and determining whether the state type of the test tube is a test tube containing serum based on the relationship between the ratio and the second threshold value further includes:

[0122] If the ratio is greater than the lower threshold value and less than the upper threshold value, it is determined that the state type of the test tube is an abnormal test tube.

[0123] If R≥t0, it indicates that the current test tube is a normal test tube containing serum; if R≤t1, it indicates that the current test tube is an empty test tube; if t1

[0124] In actual applications, the method of the embodiment can perform test tube clamping operations on multiple positions of the test tube rack to determine whether a test tube exists at each position, and identify the state type of the test tube as an empty test tube, a test tube containing only gel, or a normal test tube containing serum, or even an abnormal test tube. In this way, positions without test tubes or test tubes that do not meet the requirements can be excluded in advance before sample processing, reducing subsequent operations and improving the throughput of the pipeline.

[0125] Example Two

[0126] The embodiment provides a test tube state judgment device based on image recognition, as shown in FIG. 1, comprising: Figure Five An acquisition module 201 is configured to acquire a photographed image after performing a test tube clamping operation.

[0127] A binarization module 202 is configured to perform binarization processing on the photographed image to obtain a binarized image.

[0128] A judgment module 203 is configured to determine whether a test tube exists based on the binarized image; in the case where a test tube exists, fit a lower region of the test tube in the binarized image and determine the state type of the test tube based on the fitting result, the state type of the test tube including an empty test tube, a test tube containing only gel, and a test tube containing serum.

[0129] In some implementations, the binarization module 202 is configured to convert the photographed image into a grayscale image, perform filtering processing on the grayscale image, and perform a binarization operation on the filtered grayscale image to obtain the binarized image.

[0130] Figure Two

[0131] ​​In some implementations, the determining module 203 is configured to: determine whether the height of the object in the binary image is less than a preset proportion of the height of the photographed image; determine that there is no test tube if the height of the object is less than the preset proportion of the height of the photographed image; and determine that there is a test tube if the height of the object is not less than the preset proportion of the height of the photographed image.

[0132] In some implementations, the determining module 203 is configured to:

[0133] In the case where there is a test tube, the lowest pixel point with a pixel value of 255 in each column of pixels in the binary image is determined as a contour pixel point.

[0134] The coordinates of the contour pixel points are sorted according to the y coordinates, and the maximum value of the y coordinates is determined.

[0135] The pixel points in the y-axis direction corresponding to the contour pixel point with the maximum y coordinate are extracted, and the distance between the pixel points is not more than a first threshold value.

[0136] Curve fitting is performed on the extracted pixel points to obtain a first fitting result of the lower region of the test tube.

[0137] It is determined whether there are pixel points that exceed the boundary of the binary image in the first fitting result.

[0138] In the case where there are pixel points that exceed the boundary of the binary image, it is determined that the state type of the test tube is a test tube containing only gel.

[0139] In some implementations, the determining module 203 is further configured to:

[0140] In the case where there are no pixel points that exceed the boundary of the binary image, the minimum x coordinate and the maximum x coordinate of the first fitting result are extracted, and straight line fitting is performed on the pixel points corresponding to the minimum x coordinate and the maximum x coordinate to obtain a second fitting result of the lower region of the test tube.

[0141] For a closed region formed based on the first fitting result and the second fitting result, the number of pixel points with a pixel value equal to 255 and the total number of pixel points in the closed region are counted.

[0142] The ratio of the number of pixel points with a pixel value equal to 255 to the total number of pixel points in the closed region is calculated.

[0143] Based on the relationship between the ratio and a second threshold value, it is determined whether the state type of the test tube is a test tube containing serum.

[0144] In some implementations, the second threshold value includes an upper threshold value and a lower threshold value; and based on the relationship between the ratio and the second threshold value, it is determined whether the state type of the test tube is a test tube containing serum, including:

[0145] If the ratio is not less than the upper threshold, the state type of the test tube is determined as a serum-containing test tube.

[0146] If the ratio is not greater than the lower threshold, the state type of the test tube is determined as an empty test tube.

[0147] In some implementations, the state type of the test tube further includes an abnormal test tube; and determining whether the state type of the test tube is a serum-containing test tube based on the relationship between the ratio and the second threshold value further includes: if the ratio is greater than the lower threshold and less than the upper threshold, the state type of the test tube is determined as an abnormal test tube.

[0148] It should be understood that the device of the embodiment has at least all the beneficial effects of the first embodiment.

[0149] Example Three

[0150] The embodiment provides a computer readable storage medium, and the computer readable storage medium stores a computer program. When the computer program is executed by at least one processor, the method of the foregoing embodiment is implemented.

[0151] The computer readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, for example, a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic memory, a flash memory, a magnetic disk or an optical disk.

[0152] Example Four

[0153] The embodiment provides a full-automatic sample processing system, which includes a memory and at least one processor. The memory stores a computer program, and the computer program is executed by the at least one processor to implement the foregoing method.

[0154] The processor can be an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a controller, a microcontroller unit (MCU), a microprocessor, or other electronic elements, which are used to execute the methods in the above embodiments.

[0155] In some implementations, the fully automatic sample processing system further comprises:

[0156] A test tube clamping device is configured to perform a test tube clamping operation to make the test tube leave the test tube rack.

[0157] A shooting device is configured to perform image shooting after the test tube clamping operation.

[0158] The test tube clamping device can include a test tube clamp, and the shooting device can include a camera.

[0159] When the state type of the test tube is classified in the front end of the fully automatic sample processing system, there can be a case of no test tube, a case of empty test tube, a case of test tube containing only gel, and a case of test tube containing normal serum. This relates to the detection speed and judgment of a series of subsequent serum samples. The fully automatic sample processing system of the embodiment can automatically control the test tube clamping device to perform a test tube clamping operation on each position of the storage area, and automatically control the camera to shoot the test tube when the test tube is clamped to a suspended state. It should be understood that if there is no test tube in a certain position, the image shot after the test tube clamping operation only contains the test tube clamp but no test tube.

[0160] In several embodiments provided in the embodiments of the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device and method embodiments described above are only illustrative.

[0161] It should be noted that, in the present document, the terms "first", "second", and the like, in the description and in the claims of the present application and in the above-described drawings, are intended to distinguish similar objects and not necessarily to describe a particular chronological or sequential order. The terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by an indefinite article "a" does not exclude the existence, under the same conditions, of two or more identical elements.

[0162] Although the embodiments of the present application have been disclosed as above, the above-described content is only for the purpose of facilitating the understanding of the present application, and is not intended to limit the present application. Any person skilled in the art of the present application can make any modification and change in the form of implementation and details without departing from the spirit and scope of the present application, but the patent protection scope of the present application shall be subject to the scope defined by the appended claims.

Claims

1. A method for determining the state of a test tube based on image recognition, characterized in that, include: Acquire images after performing the test tube clamping operation; The captured image is binarized to obtain a binarized image; The presence of a test tube is determined based on the binarized image; In the presence of a test tube, the bottommost contour pixel with a value of 255 in each column of pixels in the binarized image is identified; the coordinates of each contour pixel are sorted according to the y-coordinate, and the maximum y-coordinate value is determined; pixels in the contour pixel whose distance from the contour pixel corresponding to the maximum y-coordinate value in the y-axis direction does not exceed a first threshold are extracted; curve fitting is performed on the extracted pixels to obtain a first fitting result for the lower region of the test tube; it is determined whether there are pixels in the first fitting result that exceed the boundary of the binarized image; if there are pixels that exceed the boundary of the binarized image, the state type of the test tube is determined to be a test tube containing only gel, and the state type includes an empty test tube, a test tube containing only gel, and a test tube containing serum.

2. The method according to claim 1, characterized in that, The step of binarizing the captured image to obtain a binarized image includes: Convert the captured image into a grayscale image; The grayscale image is then filtered. Binarize the filtered grayscale image to obtain a binary image.

3. The method according to claim 1, characterized in that, The step of determining whether a test tube exists based on the binarized image includes: Determine whether the height of the object in the binarized image is less than a preset ratio of the height of the captured image; If the height of the object is less than a preset proportion of the height of the captured image, it is determined that no test tube exists. If the height of the object is not less than a preset proportion of the height of the captured image, then the presence of a test tube is confirmed.

4. The method according to claim 1, characterized in that, The first threshold is determined based on the width of the test tube, and the first fitting result includes the arc-shaped profile of the lower region of the test tube.

5. The method according to claim 1, characterized in that, The step of fitting the lower region of the test tube in the binarized image and determining the state type of the test tube based on the fitting result further includes: In the absence of any pixels that exceed the boundary of the binarized image, the minimum and maximum x-coordinate values ​​in the first fitting result are extracted, and a straight line is fitted based on the pixels corresponding to the minimum and maximum x-coordinate values ​​respectively to obtain the second fitting result for the lower region of the test tube. For the closed region formed based on the first fitting result and the second fitting result, count the number of pixels with a pixel value equal to 255 and the total number of pixels within the closed region. Calculate the ratio of the number of pixels with a pixel value of 255 to the total number of pixels within the closed area; The relationship between this ratio and the second threshold determines whether the test tube is a test tube containing serum.

6. The method according to claim 5, characterized in that, The second threshold includes an upper threshold and a lower threshold; determining whether the test tube's state type is a test tube containing serum based on the relationship between this ratio and the second threshold includes: If the ratio is not less than the upper limit threshold, the test tube is determined to be a test tube containing serum. If the ratio is not greater than the lower threshold, the test tube is determined to be an empty test tube.

7. The method according to claim 6, characterized in that, The status type also includes abnormal test tubes; the step of determining whether the status type of a test tube is a test tube containing serum based on the relationship between the ratio and the second threshold also includes: If the ratio is greater than the lower threshold and less than the upper threshold, the test tube is determined to be an abnormal test tube.

8. A test tube state determination device based on image recognition, characterized in that, include: The acquisition module is used to acquire images after the test tube clamping operation is performed; The binarization module is used to perform binarization processing on the captured image to obtain a binarized image; The judgment module is used to determine whether a test tube exists based on the binarized image; In the presence of a test tube, the bottommost contour pixel with a value of 255 in each column of pixels in the binarized image is identified; the coordinates of each contour pixel are sorted according to the y-coordinate, and the maximum y-coordinate value is determined; pixels in the contour pixel whose distance from the contour pixel corresponding to the maximum y-coordinate value in the y-axis direction does not exceed a first threshold are extracted; curve fitting is performed on the extracted pixels to obtain a first fitting result for the lower region of the test tube; it is determined whether there are pixels in the first fitting result that exceed the boundary of the binarized image; if there are pixels that exceed the boundary of the binarized image, the state type of the test tube is determined to be a test tube containing only gel, and the state type includes an empty test tube, a test tube containing only gel, and a test tube containing serum.

9. The apparatus according to claim 8, characterized in that, The binarization module is used to convert the captured image into a grayscale image, filter the grayscale image, and binarize the filtered grayscale image to obtain a binarized image.

10. The apparatus according to claim 8, characterized in that, The judgment module is used for: Determine whether the height of the object in the binarized image is less than a preset ratio of the height of the captured image; If the height of the object is less than a preset proportion of the height of the captured image, it is determined that no test tube exists. If the height of the object is not less than a preset proportion of the height of the captured image, then the presence of a test tube is confirmed.

11. The apparatus according to claim 8, characterized in that, The first threshold is determined based on the width of the test tube, and the first fitting result includes the arc-shaped profile of the lower region of the test tube.

12. The apparatus according to claim 8, characterized in that, The judgment module is also used for: In the absence of any pixels that exceed the boundary of the binarized image, the minimum and maximum x-coordinate values ​​in the first fitting result are extracted, and a straight line is fitted based on the pixels corresponding to the minimum and maximum x-coordinate values ​​respectively to obtain the second fitting result for the lower region of the test tube. For the closed region formed based on the first fitting result and the second fitting result, count the number of pixels with a pixel value equal to 255 and the total number of pixels within the closed region. Calculate the ratio of the number of pixels with a pixel value of 255 to the total number of pixels within the closed area; The relationship between this ratio and the second threshold determines whether the test tube is a test tube containing serum.

13. The apparatus according to claim 12, characterized in that, The second threshold includes an upper threshold and a lower threshold; determining whether the test tube's state type is a test tube containing serum based on the relationship between this ratio and the second threshold includes: If the ratio is not less than the upper limit threshold, the test tube is determined to be a test tube containing serum. If the ratio is not greater than the lower threshold, the test tube is determined to be an empty test tube.

14. The apparatus according to claim 13, characterized in that, The status type also includes abnormal test tubes; the step of determining whether the status type of a test tube is a test tube containing serum based on the relationship between the ratio and the second threshold also includes: If the ratio is greater than the lower threshold and less than the upper threshold, the test tube is determined to be an abnormal test tube.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by at least one processor, implements the method as described in any one of claims 1 to 7.

16. A fully automated sample processing system, characterized in that, It includes a memory and at least one processor, wherein the memory stores a computer program that, when executed by the at least one processor, implements the method as described in any one of claims 1 to 7.

17. The fully automated sample processing system according to claim 16, characterized in that, Also includes: A test tube clamping device is used to perform test tube clamping operations, so that the test tubes are removed from the test tube rack; An imaging device for taking images after performing a test tube clamping operation.

Citation Information

Patent Citations

  • Size measurement and screening method of tiny mechanical part under movement background

    CN108470349A

  • Monocular visual pose measurement system and method based on feature cursor point

    CN110332887A