Sample testing device and red blood cell volume calculation method
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-11
- Publication Date
- 2026-08-11
AI Technical Summary
[0003]现有的样本检测装置在通过图像进行红细胞体积计算时,需要基于一定的形态建模特征来获取准确的体积信息,当细胞的形状特征发生变化时,识别的准确性会降低
[0015] This application provides a sample detection device and a method for calculating red blood cell volume. The sample detection device includes a sample carrier, a detection mechanism, and a processor. The sample carrier receives the sample to be detected. The detection mechanism is disposed on one side of the sample carrier and is used to acquire an image of the sample to be detected, thereby obtaining a first red blood cell image of the sample. The processor performs contour detection on the first red blood cell image to obtain a first red blood cell contour in the first red blood cell image. Based on a first pixel value within the first red blood cell contour and a second pixel value outside the first red blood cell contour, the first red blood cell contour is adjusted to obtain a second red blood cell contour. The red blood cell volume parameter of the sample to be detected is calculated based on the number of pixels within the second red blood cell contour. This application, by using a processor to adjust the first red blood cell contour based on the first pixel value within the first red blood cell contour and the second pixel value outside the first red blood cell contour to obtain a second red blood cell contour, and calculating the red blood cell volume parameter of the sample to be detected based on the number of pixels within the second red blood cell contour, makes the second red blood cell contour more closely match the actual contour of the red blood cell, improving the accuracy of red blood cell recognition, and thus improving the accuracy of the red blood cell volume parameter.
Smart Images

Figure CN122545487A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of sample detection technology, and in particular to sample detection devices and methods for calculating red blood cell volume. Background Technology
[0002] When the sample detection device performs red blood cell detection using the cell imaging method, it applies the sample to a glass slide and then uses a detection mechanism to capture images of the sample on the slide. Based on the captured images, subsequent red blood cell counting and volume calculations are performed.
[0003] Existing sample detection devices require certain morphological modeling features to obtain accurate volume information when calculating red blood cell volume from images. When the shape features of the cells change, the accuracy of recognition decreases. Summary of the Invention
[0004] To address the aforementioned technical problems, this application provides a sample detection device and a method for calculating red blood cell volume.
[0005] To address the aforementioned problems, this application provides a first technical solution: a sample detection device, comprising a sample carrier, a detection mechanism, and a processor. The sample carrier is used to receive a sample to be detected. The detection mechanism is disposed on one side of the sample carrier and is used to acquire an image of the sample to be detected to obtain a first red blood cell image of the sample. The processor is connected to the detection mechanism and is used to: perform contour detection on the first red blood cell image to obtain a first red blood cell contour in the first red blood cell image; adjust the first red blood cell contour based on a first pixel value within the first red blood cell contour and a second pixel value outside the first red blood cell contour to obtain a second red blood cell contour; and calculate the red blood cell volume parameter of the sample to be detected based on the number of pixels within the second red blood cell contour.
[0006] Optionally, the processor is configured to: filter out noise data of the first red blood cell image based on the first pixel value and the second pixel value to obtain a second red blood cell image; obtain a first pixel point in the second red blood cell image corresponding to a pixel value within a first preset range in the outline of the first red blood cell based on the correspondence between the pixel positions of the first red blood cell image and the second red blood cell image, so as to generate a third red blood cell image based on the first pixel point; and perform contour detection on the third red blood cell image to obtain the outline of the second red blood cell.
[0007] Optionally, the processor is configured to generate a fourth red blood cell image based on the first pixel value and the second pixel value, wherein the pixel value within the first red blood cell outline of the fourth red blood cell image is equal to the first pixel value, and the pixel value outside the first red blood cell outline of the fourth red blood cell image is the average value of the second pixel value; the processor is further configured to perform binarization processing on the fourth red blood cell image to obtain the second red blood cell image.
[0008] Optionally, the processor is configured to acquire a second pixel in the second red blood cell image with a pixel value within the outline of the first red blood cell as a first threshold, and acquire the pixel value of a third pixel in the fourth red blood cell image corresponding to the pixel position of the second pixel; the processor is further configured to sort the third pixel according to the pixel value, and select a first pixel located within the first preset range from the sorted sequence of the third pixel according to a preset ratio.
[0009] Optionally, the processor is used to generate an image in which the pixel value of all pixels is a first threshold, and to set the pixel value of the pixel corresponding to the pixel position of the first pixel to a second threshold, so as to obtain the third red blood cell image.
[0010] Optionally, the aforementioned detection mechanism is used to acquire images of the sample to be tested to obtain an original acquired image, and the aforementioned processor is used to perform red blood cell detection on the original acquired image to obtain detection data of the sample to be tested. The aforementioned processor is also used to acquire red blood cell prediction boxes in the aforementioned detection data and enlarge the corner positions of the aforementioned red blood cell prediction boxes to obtain the aforementioned first red blood cell image.
[0011] Optionally, the processor is configured to perform contour detection on the first red blood cell image to obtain the contour radius of the cell circumcircle of the first red blood cell image. The processor is also configured to use the corresponding cell circumcircle as the contour of the first red blood cell when the contour radius is within a second preset range.
[0012] Optionally, the processor is used to perform grayscale processing on the first red blood cell image and filter the processed first red blood cell image to perform contour detection on the filtered first red blood cell image.
[0013] Optionally, the aforementioned detection mechanism is used to acquire images of the sample to be detected to obtain several first red blood cell images of the sample to be detected at multiple detection sites. The processor is used to calculate the average number of pixels within the second red blood cell contour of the sample to be detected based on the number of pixels within the second red blood cell contour corresponding to the several first red blood cell images. The processor is also used to calculate the red blood cell volume parameter of the sample to be detected based on the average number of pixels within the second red blood cell contour. The number of pixels within the second red blood cell contour and the red blood cell volume parameter have a linear relationship.
[0014] To address the aforementioned problems, this application provides a second technical solution: a method for calculating red blood cell volume in a sample detection device, comprising: acquiring an image of a sample to be detected to obtain a first red blood cell image of the sample to be detected; performing contour detection on the first red blood cell image to obtain a first red blood cell contour in the first red blood cell image; adjusting the first red blood cell contour based on a first pixel value within the first red blood cell contour and a second pixel value outside the first red blood cell contour to obtain a second red blood cell contour; and calculating the red blood cell volume parameter of the sample to be detected based on the number of pixels within the second red blood cell contour.
[0015] This application provides a sample detection device and a method for calculating red blood cell volume. The sample detection device includes a sample carrier, a detection mechanism, and a processor. The sample carrier receives the sample to be detected. The detection mechanism is disposed on one side of the sample carrier and is used to acquire an image of the sample to be detected, thereby obtaining a first red blood cell image of the sample. The processor performs contour detection on the first red blood cell image to obtain a first red blood cell contour in the first red blood cell image. Based on a first pixel value within the first red blood cell contour and a second pixel value outside the first red blood cell contour, the first red blood cell contour is adjusted to obtain a second red blood cell contour. The red blood cell volume parameter of the sample to be detected is calculated based on the number of pixels within the second red blood cell contour. This application, by using a processor to adjust the first red blood cell contour based on the first pixel value within the first red blood cell contour and the second pixel value outside the first red blood cell contour to obtain a second red blood cell contour, and calculating the red blood cell volume parameter of the sample to be detected based on the number of pixels within the second red blood cell contour, makes the second red blood cell contour more closely match the actual contour of the red blood cell, improving the accuracy of red blood cell recognition, and thus improving the accuracy of the red blood cell volume parameter. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein:
[0017] Figure 1 This is a schematic diagram of the structure of an embodiment of the sample detection device provided in this application;
[0018] Figure 2 This is a schematic diagram illustrating the identification of the first red blood cell outline provided in this application;
[0019] Figure 3 This is a schematic diagram illustrating the identification of the second red blood cell outline provided in this application;
[0020] Figure 4 This is a schematic diagram of an embodiment of the original red blood cell prediction frame provided in this application;
[0021] Figure 5 This is a schematic diagram of an embodiment of the enlarged red blood cell prediction frame provided in this application;
[0022] Figure 6 This is a schematic diagram illustrating the correlation between the number of pixels and MCV provided in this application;
[0023] Figure 7 This is a schematic diagram illustrating the correlation between the number of pixels to the power of 1.5 and MCV provided in this application;
[0024] Figure 8 This is a flowchart illustrating an embodiment of the red blood cell volume calculation method provided in this application. Detailed Implementation
[0025] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0026] It should be noted that if the embodiments of this application involve directional indicators (such as up, down, left, right, front, back, etc.), the directional indicators are only used to explain the relative positional relationship and movement of the components in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indicators will also change accordingly.
[0027] Furthermore, if the embodiments of this application involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the technical solutions of various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application.
[0028] This application first provides a sample detection device for detecting red blood cells in a sample using cell imaging. The sample to be detected can be a blood sample that has undergone simple preprocessing followed by labeling, staining, or fluorescence treatment, or it can be a blood sample that has only undergone simple preprocessing; no specific limitation is made here. Please refer to... Figures 1-3 , Figure 1 This is a schematic diagram of the structure of one embodiment of the sample detection device provided in this application. Figure 2 This is a schematic diagram illustrating the identification of the first red blood cell outline provided in this application. Figure 3 This is a schematic diagram illustrating the identification of the second red blood cell outline provided in this application. (Example) Figures 1-3 As shown, the sample detection device in this embodiment includes a sample carrier, a detection mechanism, and a processor.
[0029] The sample carrier is used to receive the sample to be tested; the detection mechanism is set on one side of the sample carrier and is used to acquire images of the sample to be tested to obtain a first red blood cell image of the sample to be tested; the processor is connected to the detection mechanism and is used to: perform contour detection on the first red blood cell image to obtain a first red blood cell contour in the first red blood cell image; adjust the first red blood cell contour based on the first pixel value within the first red blood cell contour and the second pixel value outside the first red blood cell contour to obtain a second red blood cell contour; and calculate the red blood cell volume parameters of the sample to be tested based on the number of pixels within the second red blood cell contour.
[0030] Specifically, the sample carrier is used to hold the sample to be tested. The detection mechanism is located on one side of the sample carrier, either on the sample carrier and at the location where the sample is held, or it is spaced apart from the sample carrier and the image acquisition device is aligned with the location where the sample is held, so that the detection mechanism can acquire an image of the sample and obtain a first red blood cell image of the sample. It is understood that the first red blood cell image may include several red blood cell target regions, each typically consisting of at least one red blood cell. After obtaining the first red blood cell image, cell detection is performed on the red blood cell target regions of the first red blood cell image to obtain the contour of the largest circumscribed circle radius corresponding to the actual red blood cell in the first red blood cell image, i.e., the first red blood cell contour.
[0031] After obtaining the first red blood cell contour, the first pixel value within the first red blood cell contour and the second pixel value outside the first red blood cell contour in the first red blood cell image are further acquired. The first red blood cell contour is then adjusted based on the first and second pixel values to obtain the second red blood cell contour, which is then determined as the current contour of the corresponding red blood cell. After obtaining the second red blood cell contour, the volume of the current red blood cell can be calculated based on the number of pixels within the second red blood cell contour, allowing subsequent calculations of the red blood cell volume parameters of the sample to be detected based on the volume of a certain number of red blood cells. The first and second red blood cell contours can be understood as cell contours defined by the processor during the processing and conversion of the first red blood cell image. The first red blood cell contour is the cell contour obtained during the initial calculation using a relevant contour detection algorithm, while the second red blood cell contour is the cell contour obtained after contour adjustment.
[0032] In one embodiment, when calculating the number of pixels within the second red blood cell contour, the area of the circumcircle of the second red blood cell contour can be directly calculated from its radius, and this area can be used as the number of pixels within the second red blood cell contour. Alternatively, the convex hull function in the OpenCV computer vision library can be used to obtain the convex hull, and then the contourArea function can be used to obtain the number of pixels within the convex hull. The contourArea function is mainly used to calculate the area of a closed contour, taking the red blood cell contour as input and returning the area of the region contained by the contour. The area of the closed contour can be calculated in pixels.
[0033] See details Figure 2 and Figure 3 It can be seen that, in Figure 2 The outline of the first red blood cell, obtained directly from the first red blood cell image, is slightly larger than the actual outline of the red blood cell; that is, the outline of the first red blood cell is located outside the cell membrane of the red blood cell. Figure 3 In the process, the outline of the second red blood cell coincides with the cell membrane of the red blood cell, which can further limit the blank pixels within the outline of the first red blood cell, so that the second red blood cell outline can better fit the actual outline of the red blood cell. The size of the second red blood cell outline is smaller than or equal to the size of the first red blood cell outline.
[0034] In this embodiment, the sample detection device performs contour detection on a first red blood cell image using a processor to obtain a first red blood cell contour in the first red blood cell image; based on a first pixel value within the first red blood cell contour and a second pixel value outside the first red blood cell contour, the first red blood cell contour is adjusted to obtain a second red blood cell contour; and the red blood cell volume parameter of the sample to be detected is calculated based on the number of pixels within the second red blood cell contour. This sample detection device, through a processor, adjusts the first red blood cell contour based on the first pixel value within the first red blood cell contour and the second pixel value outside the first red blood cell contour to obtain a second red blood cell contour, and calculates the red blood cell volume parameter of the sample to be detected based on the number of pixels within the second red blood cell contour. This allows the second red blood cell contour to better match the actual contour of the red blood cell, improving the accuracy of red blood cell recognition and thus improving the accuracy of the red blood cell volume parameter.
[0035] In one embodiment, the processor is configured to: filter out noise data in a first red blood cell image based on a first pixel value and a second pixel value to obtain a second red blood cell image; obtain a first pixel point in the second red blood cell image corresponding to a pixel value within a first preset range in the first red blood cell outline based on the correspondence between the pixel positions of the first red blood cell image and the second red blood cell image, so as to generate a third red blood cell image based on the first pixel point; and perform contour detection on the third red blood cell image to obtain the contour of the second red blood cell.
[0036] Specifically, when adjusting the first red blood cell outline, the processor filters out noise data located outside the first red blood cell outline in the first red blood cell image, outputting the filtered first red blood cell image as the second red blood cell image. Understandably, since the difference between the first and second red blood cell images lies in the pixel differences outside the first red blood cell outline, the pixel positions of the first and second red blood cell images have a one-to-one correspondence, and the position of the first red blood cell outline in the first red blood cell image can also correspond to the position in the second red blood cell image.
[0037] Therefore, the processor is further configured to acquire pixels whose pixel values within the first red blood cell contour in the first red blood cell image fall within a first preset range, and to correlate these pixels with the first pixels in the second red blood cell image, so that a third red blood cell image can be generated based on the position and pixel value of the first pixel in the first red blood cell image. The first, second, and third red blood cell images are all images of the same size, with corresponding pixel positions. The first and second red blood cell images have corresponding first red blood cell contours, and the third red blood cell image has a second red blood cell contour adjusted from the first red blood cell contour. This ensures that the second red blood cell contour obtained from the third red blood cell image more closely matches the actual contour of the red blood cell, improving the accuracy of red blood cell recognition and thus improving the accuracy of red blood cell volume parameters.
[0038] Optionally, the processor is used to generate a fourth red blood cell image based on the first pixel value and the second pixel value, wherein the pixel value within the first red blood cell outline of the fourth red blood cell image is equal to the first pixel value, and the pixel value outside the first red blood cell outline of the fourth red blood cell image is the average value of the second pixel value; the processor is also used to perform binarization processing on the fourth red blood cell image to obtain a second red blood cell image.
[0039] Specifically, when filtering out noisy data, the processor generates a new fourth red blood cell image corresponding to the size of the first red blood cell image. This fourth red blood cell image has a corresponding outline of the first red blood cell. The pixel values outside the outline of the first red blood cell in the fourth red blood cell image are set to the average of the second pixel values of the first red blood cell image, and the pixel values within the outline of the first red blood cell in the fourth red blood cell image are set to the first pixel values of the first red blood cell image. After obtaining the fourth red blood cell image, it is binarized to obtain the second red blood cell image. The binarization of the fourth red blood cell image can be performed using, but is not limited to, global thresholding, automatic thresholding, adaptive thresholding, and iterative methods.
[0040] In this embodiment, the processor of the sample detection device generates a fourth red blood cell image based on a first pixel value and a second pixel value. The pixel values within the first red blood cell outline of the fourth red blood cell image are equal to the first pixel values, and the pixel values outside the first red blood cell outline of the fourth red blood cell image are the average of the second pixel values. This binarization process is used to obtain a second red blood cell image. Therefore, the foreground and background portions of the first red blood cell image can be separated to filter out noise data and obtain the second red blood cell image.
[0041] Furthermore, the processor is used to acquire a second pixel in the second red blood cell image with a pixel value within the outline of the first red blood cell as a first threshold, and to acquire the pixel value of a third pixel in the fourth red blood cell image corresponding to the pixel position of the second pixel; the processor is also used to sort the third pixel according to the pixel value, and to select a first pixel within a first preset range from the sorted sequence of the third pixel according to a preset ratio.
[0042] Specifically, the second red blood cell image mentioned above is obtained through binarization of the fourth red blood cell image, thus the pixels in the second and fourth red blood cell images also have a corresponding relationship. When the processor acquires the second red blood cell image, it selects a second pixel with a pixel value of a first threshold from the pixels within the outline of the first red blood cell. Based on the correspondence between the second and fourth red blood cell images, the processor acquires a third pixel in the fourth red blood cell image corresponding to the position of the second pixel. The processor is also used to sort the third pixel in ascending or descending order according to its pixel value, so as to select a first pixel within a first preset range from the sorted sequence of the third pixels according to a preset ratio.
[0043] In this image, the number of pixels in the second red blood cell image is 0 or 255, and the first threshold for the second pixel can be 0. The preset ratio is the proportion of the first pixel in the sorted sequence of the third pixels; for example, the preset ratio may include a ratio range composed of a third threshold and a fourth threshold. When sorting the third pixels according to their pixel values from low to high, pixels whose pixel values are located between the third and fourth thresholds in the sorted sequence can be selected as the first pixel. For example, the third threshold can be 1%, and the fourth threshold can be 70%. The first preset range of pixel values is the range of pixel values obtained by converting the pixels in the sorted sequence of the third pixels according to the preset ratio. The first preset range corresponds to the pixel values of the pixels in the preset ratio, and is not specifically limited here.
[0044] In this embodiment, the processor of the sample detection device acquires a second pixel in the second red blood cell image with a pixel value of a first threshold within the outline of the first red blood cell, and acquires the pixel value of a third pixel in the fourth red blood cell image corresponding to the pixel position of the second pixel. The processor sorts the third pixel according to the pixel value and selects a first pixel within a first preset range from the sorted sequence of the third pixel according to a preset ratio. This allows the corresponding first pixel to be selected from the second red blood cell image to generate a third red blood cell image, thereby improving the accuracy of red blood cell recognition and thus improving the accuracy of red blood cell volume parameters.
[0045] The processor generates an image where all pixels have a first threshold value, and sets the pixel value of the pixel corresponding to the pixel position of the first pixel to a second threshold value to obtain a third red blood cell image.
[0046] Specifically, when generating the third red blood cell image based on the first pixel, the processor first generates an image in which all pixels have a pixel value of a first threshold. This image has the same size as the second red blood cell image, ensuring a correspondence between their pixel positions. The processor then sets the pixel value of the pixel corresponding to the pixel position of the first pixel to the second threshold to obtain the third red blood cell image. The first threshold can be 0, and the second threshold can be 255.
[0047] In other embodiments, to facilitate intuitive identification of the generation process of the third red blood cell image, an image in which all pixels have a value of the second threshold may be generated first, and the pixel values of the pixels corresponding to the pixel positions of the first pixel in the image may be set to the first threshold. Then, the image may be inverted in color or phase to obtain the third red blood cell image. In this case, the pixel value of the first pixel in the third red blood cell image is the second threshold, and the pixel values of the other pixels besides the first pixel are the first threshold.
[0048] In the above manner, the processor of the sample detection device in this embodiment obtains a third red blood cell image based on the position of the first pixel point of the second red blood cell image. When performing contour detection on the third red blood cell image, the contour can be located at the position of the pixel point whose pixel value is within the first preset range. That is, the red blood cell contour is located at the black edge on the cell membrane of the red blood cell, so that the second red blood cell contour can fit more closely to the actual contour of the red blood cell, improve the accuracy of red blood cell recognition, and thus improve the accuracy of red blood cell volume parameters.
[0049] In one embodiment, the detection mechanism is used to acquire images of the sample to be tested to obtain an original acquired image, and the processor is used to perform red blood cell detection on the original acquired image to obtain detection data of the sample to be tested. The processor is also used to acquire red blood cell prediction boxes in the detection data and enlarge the corner positions of the red blood cell prediction boxes to obtain a first red blood cell image.
[0050] Specifically, the detection mechanism may include an image acquisition unit connected to a processor. The image acquisition unit is used to acquire images of the sample to be detected in microscopic mode to obtain raw acquired images. The image acquisition unit transmits the raw acquired images to the processor. The processor is used to perform red blood cell detection on the raw acquired images using a prediction model to obtain detection data for the sample to be detected. The detection data typically includes red blood cell prediction bounding boxes for identifying red blood cells in the raw acquired images. After acquiring the detection data, the processor is also used to acquire the red blood cell prediction bounding boxes from the detection data and enlarge the corner positions of the red blood cell prediction bounding boxes to obtain a first red blood cell image.
[0051] Please see below. Figure 4 and Figure 5 , Figure 4 This is a schematic diagram of an embodiment of the original red blood cell prediction frame provided in this application. Figure 5 This is a schematic diagram of an embodiment of the enlarged red blood cell prediction box provided in this application. The red blood cell prediction box can be composed of four corner points, and the positions of the corner points of the red blood cell prediction box are the coordinates of the four corner points. The processor can enlarge the corner point positions of the red blood cell prediction box by expanding the coordinates of the four corner points outward by a preset pixel value. For example, as shown... Figure 4 As shown, the coordinates of the four corner points of the red blood cell prediction box can be defined as [max(0,x1),max(0,y1),min(h,x2),min(w,y2)], where h is the height of the red blood cell prediction box, w is the width of the red blood cell prediction box, x1 is the top left corner, y1 is the top left corner, x2 is the top right corner, and y2 is the bottom right corner. Figure 5 As shown, the processor can modify the coordinates of the four corner points to [max(0,x1-a),max(0,y1-b),min(h,x2+c),min(w,y2+d)], where a, b, c, and d are the preset pixel values mentioned above, and the preset pixel values can be, but are not limited to, 8.
[0052] In this way, the sample detection device of this embodiment can obtain the first red blood cell image by expanding the corner position of the red blood cell prediction box. This ensures that the pixels outside the red blood cell prediction box can be taken into account when performing contour detection, thereby improving the accuracy of red blood cell recognition and thus improving the accuracy of red blood cell volume parameters.
[0053] Optionally, the processor is used to perform contour detection on the first red blood cell image to obtain the contour radius of the cell circumcircle of the first red blood cell image. The processor is also used to take the corresponding cell circumcircle as the first red blood cell contour when the contour radius is within a second preset range.
[0054] Specifically, when the processor performs contour detection on the first red blood cell image, the specific detection process may include, but is not limited to, the following: performing contour detection on the first red blood cell image; obtaining the contour radius of the circumcircle of each detected cell; and when the contour radius is within a second preset range, using the corresponding cell circumcircle as the first red blood cell contour. Here, the aforementioned contour radius can be the number of pixels occupied by the radius of the red blood cell in the first red blood cell image; that is, the length of the contour radius can be represented by the number of pixels in the first red blood cell image. The second preset range can be set to the number of pixels in the first red blood cell image corresponding to the radius range of common red blood cells. In other embodiments, the second preset range can be adjusted to distinguish red blood cells from other types of blood cells, thereby achieving red blood cell counting and improving the accuracy of red blood cell recognition. The second preset range may be related to the focal length of the detection mechanism, the shooting accuracy, the radius range of common red blood cells, etc., and is not specifically limited here.
[0055] Furthermore, the processor performs grayscale processing on the first red blood cell image and filters the processed first red blood cell image to perform contour detection on the filtered first red blood cell image.
[0056] Specifically, when performing grayscale processing on the first red blood cell image, the processor can calculate the gradient of the first red blood cell image. For example, it can calculate the gradient of the first red blood cell image in the horizontal and vertical directions using kernel calculations, and calculate the gradient value of each pixel based on the weighted difference of grayscale values of neighboring points in the horizontal and vertical directions, thus achieving grayscale processing of the first red blood cell image. After grayscale processing, the processor performs filtering processing on the processed first red blood cell image using morphological opening operations. After filtering, the processor performs binarization processing on the filtered first red blood cell image to perform contour detection and obtain the contour of the first red blood cell. The binarization processing includes, but is not limited to, the OTU Otsu algorithm operation.
[0057] In one embodiment, the detection mechanism is used to acquire images of the sample to be detected to obtain several first red blood cell images of the sample at multiple detection sites. The processor is used to calculate the average number of pixels in the second red blood cell contour of the sample to be detected based on the number of pixels in the second red blood cell contour corresponding to the several first red blood cell images. The processor is also used to calculate the red blood cell volume parameter of the sample to be detected based on the average number of pixels in the second red blood cell contour. The number of pixels in the second red blood cell contour has a linear relationship with the red blood cell volume parameter.
[0058] Specifically, in this embodiment, the processor may pre-store a linear relationship between the number of pixels within the second red blood cell contour and the red blood cell volume parameter. The processor is used to obtain several first red blood cell images of the sample to be detected, and process these images in the manner described above to obtain a second red blood cell contour corresponding to each first red blood cell image. The processor is also used to calculate the number of pixels within the second red blood cell contour corresponding to each first red blood cell image, to calculate the average number of pixels within the second red blood cell contour of all first red blood cell images, and use this average as the average number of pixels within the second red blood cell contour of the sample to be detected. After obtaining the number of pixels within the second red blood cell contour of the sample to be detected, the processor is also used to calculate the red blood cell volume parameter of the sample to be detected based on the pre-stored linear relationship. The linear relationship between the number of pixels within the second red blood cell contour and the red blood cell volume parameter can be designed using regression analysis. For example, 20 red blood cell samples are selected for regression calculation, and 8 test samples are selected to verify the effect of the linear relationship. The target mean volume (MCV) of the red blood cell samples can be obtained by a blood cell analysis instrument based on an existing methodology. The number of pixels within the second red blood cell contour of the red blood cell samples can be obtained by the sample detection device of this application embodiment. The specific number of pixels, the power of 1.5 of the number of pixels, and the MCV data of the red blood cell samples are detailed in Table 1. Sample numbers 1-20 in Table 1 are the training set, and sample numbers 21-28 are the test set.
[0059] Table 1
[0060] Sample number Number of pixels The number of pixels raised to the power of 1.5 Target average volume MCV(fL) 1 1658.747 67556.94966 117.7 2 1665.456 67967.2875 117.7 3 1271.145 45320.30899 79.7 4 1275.43 45549.63473 79.5 5 1363.194 50331.08137 86.7 6 1365.258 50445.45727 87 7 1303.345 47053.18537 80.7 8 1311.951 47519.99292 81.1 9 1446.391 55008.3438 94 10 1438.403 54553.28922 93.8 11 1376.368 51062.49631 86.9 12 1373.699 50913.99175 87.3 13 1400.88 52432.61644 91.5 14 1401.754 52481.66736 91.3 15 1179.323 40499.47018 70.7 16 1184.349 40758.64451 70.8 17 1370.083 50713.12194 87.5 18 1358.457 50068.96952 87.7 19 1425.308 53810.0062 92.3 20 1422.687 53661.65983 92.2 21 1523.683 59476.02874 106 22 1522.605 59412.89649 105.8 23 1448.728 55141.72658 95.9 24 1448.976 55155.87746 95.6 25 1340.543 49081.88413 88.5 26 1332.908 48663.13731 88.5 27 1340.807 49096.37635 89.8 28 1347.477 49463.17955 89.8
[0061] Please see Figure 6 and Figure 7 , Figure 6 This is a schematic diagram illustrating the correlation between the number of pixels and MCV provided in this application. Figure 7 This is a schematic diagram illustrating the correlation between the number of pixels (a power of 1.5) and MCV, as provided in this application. Figure 6 As shown in Table 1, using the number of pixels within the outline of the second red blood cell as the X-axis and the MCV data as the Y-axis, the following can be generated: Figure 6 The correlation chart is used to obtain the first linear function as shown below:
[0062] y1 = 0.0974x1 - 45.57; (1)
[0063] Where y1 is the MCV data of the red blood cell sample, x1 is the number of pixels within the second red blood cell contour of the red blood cell sample, and the correlation coefficient in equation (1) is R1.
[0064] like Figure 7 As shown in Table 1, using the number of pixels within the second red blood cell outline to the power of 1.5 as the X-axis and the MCV data as the Y-axis, a [database structure] can be generated. Figure 7 The correlation chart is used to obtain the second linear function as shown below:
[0065] y2 = 0.0017x2 + 0.3076; (2)
[0066] Where y2 is the MCV data of the red blood cell sample, x2 is the number of pixels within the second red blood cell contour of the red blood cell sample raised to the power of 1.5, and the correlation coefficient in equation (2) is R2.
[0067] The correlation coefficient from equation (1) above It can be seen that the predictive power of the independent variable in equation (1) for the dependent variable is close to perfect, and there is a strong correlation between the number of pixels within the second red blood cell outline and the MCV. Similarly, the correlation coefficient in equation (2) above... It can be seen that the predictive power of the independent variable in equation (2) for the dependent variable is close to perfect, and the 1.5 power of the number of pixels within the second red blood cell outline has a strong correlation with MCV. Therefore, based on equations (1) and (2), a linear regression fitting method can be used to set the following formula:
[0068] MCV = a*x + b*x 1.5 +c;(3)
[0069] Where x is the number of pixels within the second red blood cell contour of the red blood cell sample, x 1.5 The number of pixels within the second red blood cell contour of the red blood cell sample is raised to the power of 1.5. Based on the established formula (3) and the training set data in Table 1, we obtain a = -0.1144, b = 0.003675, and c = 58.2432. The linear relationship between the number of pixels within the second red blood cell contour and the red blood cell volume parameter is shown below:
[0070] MCV = -0.1144x + 0.003675x 1.5 +58.2432; (4)
[0071] Furthermore, tests were conducted based on the data from the eight samples in the test set in Table 1 and the above formula (4), and the results are shown in Table 2. The MCV predicted by the sample detection device of this embodiment was compared with the MCV detected by blood cell analyzers using other existing methodologies. The correlation between the two reached 0.9892, indicating that the sample detection device of this embodiment has good detection performance and high accuracy. Therefore, the sample detection device of this embodiment obtained through the above method can calculate the number of pixels within the second red blood cell contour and then calculate the corresponding red blood cell volume parameters of the sample to be detected according to a preset linear relationship. The second red blood cell contour can better fit the actual contour of the red blood cell, which is beneficial to improving the accuracy of red blood cell recognition and thus improving the accuracy of red blood cell volume parameters.
[0072] Table 2
[0073] Predicted value MCV(fL) 102.47072224. 106 102.75088091 105.8 94.24645122 95.9 94.76352413 95.6 85.43421291 88.5 84.80040103 88.5 85.59059068 89.8 86.25017807 89.8
[0074] In one embodiment, the processor may be, but is not limited to, a CPU (Central Processing Unit), an integrated circuit chip, a general-purpose processor, a digital signaling processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or other devices with signaling processing capabilities.
[0075] Please see Figure 8 , Figure 8 This is a schematic flowchart of an embodiment of the red blood cell volume calculation method provided in this application. Figure 8 As shown, in this embodiment, the red blood cell volume calculation method includes the following steps:
[0076] Step S10: Acquire an image of the sample to be tested to obtain the first red blood cell image of the sample.
[0077] Specifically, the red blood cell volume calculation method of this embodiment is applied to the sample detection device of any of the above embodiments. The red blood cell volume calculation method of this embodiment also performs image acquisition on the sample after receiving it, to obtain a first red blood cell image of the sample.
[0078] Step S20: Perform contour detection on the first red blood cell image to obtain the contour of the first red blood cell in the first red blood cell image.
[0079] After obtaining the first red blood cell image, contour detection can be performed directly on the first red blood cell image to obtain the first red blood cell contour in the first red blood cell image, as shown in Figure 2.
[0080] Step S30: Based on the first pixel value within the first red blood cell contour and the second pixel value outside the first red blood cell contour, adjust the first red blood cell contour to obtain the second red blood cell contour.
[0081] After obtaining the first red blood cell contour, the first red blood cell contour is adjusted based on the first pixel value within the first red blood cell contour and the second pixel value outside the first red blood cell contour in the first red blood cell image to obtain the second red blood cell contour, as shown in the figure. Figure 3 As shown.
[0082] Step S40: Calculate the red blood cell volume parameters of the sample to be detected based on the number of pixels within the second red blood cell contour.
[0083] After adjusting the first red blood cell contour of the first red blood cell image and obtaining the second red blood cell contour, the number of pixels within the second red blood cell contour can be obtained. Based on the linear relationship between the number of pixels within the second red blood cell contour and the red blood cell volume parameter, the red blood cell volume parameter of the sample to be detected can be calculated.
[0084] In this embodiment, the red blood cell volume calculation method acquires an image of the sample to be detected to obtain a first red blood cell image of the sample to be detected, performs contour detection on the first red blood cell image to obtain a first red blood cell contour in the first red blood cell image, adjusts the first red blood cell contour based on the first pixel value within the first red blood cell contour and the second pixel value outside the first red blood cell contour to obtain a second red blood cell contour, and calculates the red blood cell volume parameter of the sample to be detected based on the number of pixels within the second red blood cell contour, so that the second red blood cell contour can better fit the actual contour of the red blood cell, improve the accuracy of red blood cell recognition, and thus improve the accuracy of the red blood cell volume parameter.
[0085] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A sample detection device, characterized by, include: Sample carrier, used to receive the sample to be tested; A detection mechanism is located on one side of the sample carrier. The detection mechanism is used to acquire images of the sample to be tested in order to obtain a first red blood cell image of the sample to be tested. A processor, connected to the detection mechanism, is used for: Contour detection is performed on the first red blood cell image to obtain the contour of the first red blood cell in the first red blood cell image; Based on the first pixel value within the first red blood cell outline and the second pixel value outside the first red blood cell outline, the first red blood cell outline is adjusted to obtain the second red blood cell outline. The red blood cell volume parameters of the sample to be detected are calculated based on the number of pixels within the second red blood cell contour.
2. The sample testing device of claim 1, wherein, The processor is used for: The noise data of the first red blood cell image is filtered out based on the first pixel value and the second pixel value to obtain the second red blood cell image; Based on the correspondence between the pixel positions of the first red blood cell image and the second red blood cell image, the first pixel point in the second red blood cell image that corresponds to the pixel value within the first red blood cell outline being within a first preset range is obtained, so as to generate a third red blood cell image based on the first pixel point; Contour detection is performed on the third red blood cell image to obtain the contour of the second red blood cell.
3. The sample testing device of claim 2, wherein, The processor is configured to generate a fourth red blood cell image based on the first pixel value and the second pixel value, wherein the pixel value within the first red blood cell outline of the fourth red blood cell image is equal to the first pixel value, and the pixel value outside the first red blood cell outline of the fourth red blood cell image is the average value of the second pixel value; the processor is further configured to perform binarization processing on the fourth red blood cell image to obtain the second red blood cell image.
4. The sample testing device of claim 3, wherein, The processor is configured to acquire a second pixel in the second red blood cell image with a pixel value within the outline of the first red blood cell as a first threshold, and acquire the pixel value of a third pixel in the fourth red blood cell image corresponding to the pixel position of the second pixel; the processor is further configured to sort the third pixel according to the pixel value, and select a first pixel located within the first preset range from the sorted sequence of the third pixel according to a preset ratio.
5. The sample testing device of claim 4, wherein, The processor is used to generate an image in which the pixel value of all pixels is a first threshold, and to set the pixel value of the pixel corresponding to the pixel position of the first pixel to a second threshold, so as to obtain the third red blood cell image.
6. The sample testing device of claim 1, wherein, The detection mechanism is used to acquire images of the sample to be detected to obtain an original acquired image. The processor is used to perform red blood cell detection on the original acquired image to obtain detection data of the sample to be detected. The processor is also used to acquire red blood cell prediction boxes in the detection data and enlarge the corner positions of the red blood cell prediction boxes to obtain the first red blood cell image.
7. The sample testing device of claim 6, wherein, The processor is used to perform contour detection on the first red blood cell image to obtain the contour radius of the cell circumcircle of the first red blood cell image. The processor is also used to take the corresponding cell circumcircle as the first red blood cell contour when the contour radius is within a second preset range.
8. The sample testing device of claim 7, wherein, The processor is used to perform grayscale processing on the first red blood cell image and filter the processed first red blood cell image to perform contour detection on the filtered first red blood cell image.
9. The sample testing device of claim 1, wherein, The detection mechanism is used to acquire images of the sample to be detected to obtain several first red blood cell images of the sample at multiple detection sites. The processor is used to calculate the average number of pixels in the second red blood cell contour of the sample to be detected based on the number of pixels in the second red blood cell contour corresponding to the several first red blood cell images. The processor is also used to calculate the red blood cell volume parameter of the sample to be detected based on the average number of pixels in the second red blood cell contour. The number of pixels in the second red blood cell contour and the red blood cell volume parameter have a linear relationship.
10. A method of calculating red blood cell volume of a sample detection device, characterized by, include: Image acquisition is performed on the sample to be tested to obtain a first red blood cell image of the sample to be tested; Contour detection is performed on the first red blood cell image to obtain the contour of the first red blood cell in the first red blood cell image; Based on the first pixel value within the first red blood cell outline and the second pixel value outside the first red blood cell outline, the first red blood cell outline is adjusted to obtain the second red blood cell outline. The red blood cell volume parameters of the sample to be detected are calculated based on the number of pixels within the second red blood cell contour.