Next Article in Journal
Retrofit of a Heat Pump Unit
Previous Article in Journal
Reliability Analysis of Hydraulic System of a Tunnel-Erecting Machine Based on Dynamic Fault Tree and Bayesian Network
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Proceeding Paper

Application of Vision Algorithms to the Problem of Recognizing the Level of Blood in an Aliquoting Tube Biosample †

International Research Laboratory Intelligent Robotic Systems and Technologies, Belgorod State Technological University named after V.G. Shukhov, 308012 Belgorod, Russia
*
Author to whom correspondence should be addressed.
Presented at the 1st International Electronic Conference on Machines and Applications, 15–30 September 2022; Available online: https://iecma2022.sciforum.net/.
Eng. Proc. 2022, 24(1), 17; https://doi.org/10.3390/IECMA2022-12912
Published: 21 September 2022

Abstract

:
This work is devoted to the analysis of the application of object detection algorithms for recognizing the level of blood in a test tube. Based on the initial data and data received from the sensory system, pattern recognition is performed and decisions are made to complete the task. It is necessary to control the level of the liquid being determined in the test tube to solve the technological problems of biomaterial aliquoting. In this case, it should be taken into account that the liquid has two fractions that differ in color: a blood clot and serum. The glare of the tube surface and lighting features should also be taken into account. These factors greatly complicate the operation of the vision system. Software in the Python language has been developed that implements the ability of a vision system to recognize the level of blood in test tubes and visualize the recognized blood level in several ways: contour selection, dot marking, and color filtering. The developed methods are supposed to be applied for biosample aliquoting using a delta robot in a multirobotic system, which will increase the productivity of ongoing biomedical research through the application of new technical solutions and principles of intelligent robotics. The visualized results of the work of the programs under consideration are presented, and an assessment of the quality of recognition implementation is given.

1. Introduction

Vision systems are applied to automate many production processes, including those for biomaterial aliquoting, where it is necessary to control the level of the liquid to be determined in the container. To solve this problem, the use of vision algorithms has been proposed to determine the fluid contour with subsequent interpretation of the information received.
Research has been ongoing for quite some time in the field of border and contour recognition in an image. Technical vision can be used in various fields; for example, a study iwa made of the possibility of using technical vision for segmenting abnormal skin layers in computer analysis of images in [1]. In this work, the process of extracting asymmetric patterns from dermoscopic images is separated using HSV segmentation to find the contour image. Automatic RGB-HSV separation is used, which segments the skin lesion. The proposed automatic segmentation can be useful for a dermatologist in identifying affected areas.
The article [2] discussed the possibility of detecting human skin using the RGB (red, green, blue), HSV (hue, saturation, value) and YCbCr (brightness, chroma) color models. This article proposes a new algorithm for detecting human skin. The objective of the proposed algorithm is to improve the recognition of skin pixels in given images. The algorithm takes into account not only individual ranges of three color parameters, but also combination ranges, which provides greater accuracy in recognizing a skin area in a given image. Two automatic methods for detecting bleeding in videos of wireless capsule endoscopy of the small intestine using different color spaces were proposed in the article [3]. The first method works pixel-wise and is based solely on the color. The second method uses a more sophisticated approach that not only relies on pixel colors but also assumes that the blood in the frame forms a continuous area (or several such areas), which gives an idea of the shape and size of the blood spot.
Additionally, article [4] proposes a detection algorithm that takes advantage of the camera and downloaded data to determine color based on RGB values. The algorithm involved calls on a function that runs loops on readjusting the distance based on a nearest match. This effortlessly helps define a color based on the RGB color space with a peaking accuracy.
Articles [5,6] proposed color estimation methods based on the HSV model. These methods will translate the RGB values of the points in video images to HSV values and use HSV values to recognize the color. The developed software for real-time video object recognition based on color features is presented, which has achieved the goal of real-time video motion detection and object color recognition. It can be said that the algorithms are accurate and similar to human motion detection when watching a video, which demonstrates the good performance of target identification and color estimation by the program.
Various color models and methods are used to detect colored objects using technical vision, and they have both advantages and disadvantages. Within the framework of this article, an algorithm is proposed based on the HSV color model for blood recognition in the process of performing the technological process of aliquoting biosamples using the proposed multirobotic system.

2. Synthesis of the Algorithm

Robotic biomaterial aliquoting [7] involves a Uni robot manipulator based on a serial robot with six rotational joints and a gripper that moves test tubes to an area where a parallel DeLi robot based on a 4-DOF delta robot with a picking head performs the aliquoting process (Figure 1).
The blood in the tubes is divided into two fractions, and DeLi has to collect only one of the fractions. The level of each of the fractions may be different for each of the test tubes. The use of technical vision in a multirobotic system for biomaterial aliquoting will eliminate the routine and labor-intensive operation of separating a blood clot from serum by an operator at the sample preparation stage, which will reduce the use of consumables, the risk of errors, and contamination of the surfaces of laboratory equipment. In this regard, the problem arises of recognizing the contour and level of the required blood fraction. To solve this problem, an algorithm based on the HSV color model is proposed.
The color model is cylindrical but can be represented as intervals of H, S and V values ranging from 0 to 1,0. The synthesized algorithm is based on using I recognition training data to form an A array describing the distribution of HSV values on the training data. The first part of the algorithm consists of forming the array A. The set of all possible combinations of HSV values are grouped into N 3 blocks. During cycles over the height and width of the image, the values H , S and V are determined for each of the pixels. Next, the value of the cell i , j , k of the A array, corresponding to the block containing the value of H , S and V for this pixel, is incremented. Pixels with values H B , S B and V B corresponding to the background of the training image are not taken into account. In the second part of the algorithm, cycles are performed over the image D, on which it is required to determine the fluid boundary. If the value H , S and V of a pixel corresponds to a cell i , j , k of the array A, which has a sufficient value r of repeatability, then the counter c is incremented, showing the number of suitable pixels in a horizontal line. If the counter value reaches the value of p, then this horizontal line is the boundary of the fluid.
The synthesized Algorithm 1 works as follows:
Algorithm 1: Liquid Level Detection Using Training Dataset.
Input: I , D , N , r , p , H B , S B , V B
1:
A i , j , k = 0 , i [ 0 ; N 1 ] , j [ 0 ; N 1 ] , k [ 0 ; N 1 ]
2:
for x = 0 , , Height I do
3:
    for  y = 0 , , Width I  do
4:
         H = I x , y ( 0 ) , S = I x , y ( 1 ) , V = I x , y ( 2 )
5:
        if  H H B and S S B and V V B  then
6:
            i = H · N , j = S · N , k = V · N
7:
            A i , j , k = A i , j , k + 1
8:
        end if
9:
    end for
10:
end for
11:
y = 0
12:
while y Width D and Finish = false do
13:
     c = 0 , x = 0
14:
    while  x Height D and Finish = false do
15:
         H = D x , y ( 0 ) , S = D x , y ( 1 ) , V = D x , y ( 2 )
16:
         i = H · N , j = S · N , k = V · N
17:
        if  A i , j , k > r  then
18:
            c = c + 1
19:
           if  c > p  then
20:
                y l = y , Finish = true
21:
           end if
22:
        end if
23:
         x = x + 1
24:
    end while
25:
     y = y + 1
26:
end while
Depending on the amount of training data and the proximity of the HSV values of the environment to the HSV values of the recognized object, the value of the required r repeatability level of the A array block in the I training data is selected. The number of pixels p in the recognizable image D corresponding to the upper border of the blood in the tube should be selected based on the number of horizontal pixels corresponding to the width of the tube in the image.

3. Simulation Results

The synthesized algorithm was implemented in the Python programming language. Determination of HSV values for image pixels and rendering was performed using the OpenCV library. The algorithm was implemented for two scenarios. As part of the first scenario, photographs of test tubes with blood were used for training and recognition. In the second scenario, training and recognition were performed on the data received from the webcam. Another feature of the second scenario is the use of a liquid imitating blood.

3.1. First Scenario

In the first scenario, an image with fragments of photographs of real blood in test tubes was used as training data, as shown in Figure 2a. The fragments were placed on a black background. In this case, H B = S B = V B = 0 .
The following initial data were used for blood recognition: N = 32 , r = 40 , p = 35 . The recognition results are shown in Figure 3. As can be seen from the figure, the algorithm made it possible to identify both the blood level in the test tube and its contour.

3.2. Second Scenario

To obtain fragments used as training data, as shown in Figure 2b, as well as images for recognition, a webcam with a resolution of 1920 × 1080 pixels was used.
A test tube with a liquid simulating blood was located at a distance of about 185 mm from the webcam during recognition; the test tube diameter was 15 mm. In this case, the width of the test tube in the image received from the webcam was 119 pixels. The following initial data were used for blood recognition: N = 32 , r = 500 , p = 35 . The recognition results are shown in Figure 4.
As can be seen from the figure, in this case, the algorithm similarly made it possible to identify both the liquid level in the test tube and its contour, despite the presence of glare in the image. A quantitative analysis of the quality of recognition was performed for six real images of blood tubes (Figure 5). Figure 6a shows the dependence of the proportion of the recognized area of blood on the value r of repeatability for six images. Figure 6b shows the ratio of the number of pixels that were erroneously recognized (pixels of other objects) to the total number of recognized pixels as a function of the value of repeatability. As can be seen from the figures, with an increase in the value of repeatability, the proportion of erroneously recognized pixels decreases. However, the proportion of the recognized blood area reaches 87% with 20% of erroneously recognized pixels of other objects to the total number of recognized pixels (Figure 5c).

4. Conclusions

The proposed algorithm for determining the level and contour of blood in images based on the HSV color model and its software implementation showed good results both for images of real blood and in a real environment using a fluid that simulates blood. As part of future studies, we will analyze the effectiveness of the proposed algorithm for recognizing real blood samples in a real environment under conditions of different distribution of blood phases in test tubes after centrifugation.

Author Contributions

Conceptualization, D.G. and A.V.; methodology, D.G. and D.M.; software, D.M.; validation, L.R., D.M. and A.V.; formal analysis, D.G.; investigation, D.G. and D.M.; resources, D.M. and A.V.; data curation, D.G. and A.V.; writing—original draft preparation, D.G.; writing—review and editing, D.G., L.R., D.M. and A.V.; visualization, D.G. and D.M.; supervision, L.R.; project administration, L.R.; funding acquisition, L.R. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the state assignment of Ministry of Science and Higher Education of the Russian Federation under Grant FZWN-2020-0017.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.

Abbreviations

The following abbreviations are used in this manuscript:
RGBColor model (red, green, blue)
HSVColor model (hue, saturation, value)

References

  1. Prabhu, C.A.; Chandrasekar, A. An Automatic Threshold Segmentation and Mining Optimum Credential Features by Using HSV Model. 3D Res. 2019, 10, 1–17. [Google Scholar]
  2. Kolkur, S.; Kalbande, D.; Shimpi, P.; Bapat, C.; Jatakia, J. Human Skin Detection Using RGB, HSV and YCbCr Color Models. In Proceedings of the International Conference on Communication and Signal Processing, ICCASP, Lonere, India, 26–27 December 2016. [Google Scholar]
  3. Novozamsky, A.; Flusser, J.; Tacheci, I.; Sulik, L.; Krejcar, O. Automatic blood detection in capsule endoscopy video. J. Biomed. Opt. 2016, 21, 126007. [Google Scholar] [CrossRef]
  4. Joy, D.T.; Kaur, G.; Chugh, A.; Bajaj, S.B. Computer Vision for Color Detection. Int. J. Innov. Res. Comput. Sci. Technol. 2021, 9, 53–59. [Google Scholar] [CrossRef]
  5. Noreen, U.; Jamil, M.; Ahmad, N. Hand Detection Using HSV Model. Int. J. Sci. Technol. Res. 2016, 5, 195–197. [Google Scholar]
  6. Cai, Z.; Luo, W.; Ren, Z.; Huang, H. Color Recognition of Video Object Based on HSV Model. Appl. Mech. Mater. 2011, 143–144, 721–725. [Google Scholar] [CrossRef]
  7. Malyshev, D.; Rybak, L.; Carbone, G.; Semenenko, T.; Nozdracheva, A. Optimal Design of a Parallel Manipulator for Aliquoting of Biomaterials Considering Workspace and Singularity Zones. Appl. Sci. 2022, 12, 2070. [Google Scholar] [CrossRef]
Figure 1. (a) A 3D model of the robotic system: 1—body, 2—DeLi manipulator, 3—dispensing head, 4—dispenser tip, 5—robot manipulator, 6—base of the robot manipulator, 7—workspace, 8—rack with test tubes, 9—tray for consumables, 10—trolley; (b) execution process of aliquoting robot DeLi.
Figure 1. (a) A 3D model of the robotic system: 1—body, 2—DeLi manipulator, 3—dispensing head, 4—dispenser tip, 5—robot manipulator, 6—base of the robot manipulator, 7—workspace, 8—rack with test tubes, 9—tray for consumables, 10—trolley; (b) execution process of aliquoting robot DeLi.
Engproc 24 00017 g001
Figure 2. Training data: (a) first scenario; (b) second scenario.
Figure 2. Training data: (a) first scenario; (b) second scenario.
Engproc 24 00017 g002
Figure 3. Recognition results: (a) selection of the upper border of the blood by a line; (b) binary image of blood; (c) bleeding by the circuit; (d) marking of blood volume with a dot.
Figure 3. Recognition results: (a) selection of the upper border of the blood by a line; (b) binary image of blood; (c) bleeding by the circuit; (d) marking of blood volume with a dot.
Engproc 24 00017 g003
Figure 4. Results of the recognition of a sample of tinted water: (a) highlighting the upper border of the sample with a line; (b) binary image of the sample; (c) highlighting the sample with a contour; (d) marking the volume of tinted water with a dot.
Figure 4. Results of the recognition of a sample of tinted water: (a) highlighting the upper border of the sample with a line; (b) binary image of the sample; (c) highlighting the sample with a contour; (d) marking the volume of tinted water with a dot.
Engproc 24 00017 g004
Figure 5. Real images of blood tubes for recognition.
Figure 5. Real images of blood tubes for recognition.
Engproc 24 00017 g005
Figure 6. Results of the recognition of a sample of tinted water: (a) dependence of the proportion of the recognized area; (b) ratio of the number of pixels that were erroneously recognized.
Figure 6. Results of the recognition of a sample of tinted water: (a) dependence of the proportion of the recognized area; (b) ratio of the number of pixels that were erroneously recognized.
Engproc 24 00017 g006
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Gavrilov, D.; Voloshkin, A.; Rybak, L.; Malyshev, D. Application of Vision Algorithms to the Problem of Recognizing the Level of Blood in an Aliquoting Tube Biosample. Eng. Proc. 2022, 24, 17. https://doi.org/10.3390/IECMA2022-12912

AMA Style

Gavrilov D, Voloshkin A, Rybak L, Malyshev D. Application of Vision Algorithms to the Problem of Recognizing the Level of Blood in an Aliquoting Tube Biosample. Engineering Proceedings. 2022; 24(1):17. https://doi.org/10.3390/IECMA2022-12912

Chicago/Turabian Style

Gavrilov, Dmitry, Artem Voloshkin, Larisa Rybak, and Dmitry Malyshev. 2022. "Application of Vision Algorithms to the Problem of Recognizing the Level of Blood in an Aliquoting Tube Biosample" Engineering Proceedings 24, no. 1: 17. https://doi.org/10.3390/IECMA2022-12912

APA Style

Gavrilov, D., Voloshkin, A., Rybak, L., & Malyshev, D. (2022). Application of Vision Algorithms to the Problem of Recognizing the Level of Blood in an Aliquoting Tube Biosample. Engineering Proceedings, 24(1), 17. https://doi.org/10.3390/IECMA2022-12912

Article Metrics

Back to TopTop