This section focuses on the image processing to enable the implementation of automatic medical diagnosis.
Automated image processing is the organization of a computer vision system aimed at registering structures of the interest for medical diagnostics. There are several main stages to develop the computer vision of an automatic diagnostic system. The algorithm of the image processing automatic diagnostic system is presented in Fig. 5.
This algorithm includes image acquisition, its processing, and identification of metrics, on the basis of which it is possible to predict pathologies. Image acquisition is carried out using a digital camera connected to an optical microscope. The camera is controlled by a computer. Thus, the image immediately goes to the PC hard drive, after which it is processed in a program written in Python using image processing libraries, such as Open-CV, MatPlotLib, and Pillow.
The first stage includes obtaining the primary information from the photodetector, digitalizing the image, sending the information to the memory of the computing device and scaling it. It is possible to obtain two- and three- dimensional arrays depending on the type of camera, corresponding to the images and containing a digital signal in each cell of the array, and corresponding to the brightness of the exposure at a point. It is possible to get a two-dimensional array for the monochrome case and three sets of two-dimensional arrays for the color image. There are several options for representing color images, for example, the RGB or I palette, which are used depending on the desired result. However, in order to save computing resources, all color images are converted to monochrome images.
In this work, filtering will be considered only in the spatial domain, which is divided into linear and nonlinear parts. Linear filtering is based on the operation of two-dimensional discrete image convolution A(x, y) and the convolution kernel h(i, j).
The convolution kernels h(i, j) are the windows that are either pre-calculated, or the elements of the window array calculated in the process of work. For the purpose of noise reduction, the Gaussian filter is applied, defined as
where σ is the standard deviation of the pixel values of the filter window.
Non-linear filters are based on the rank and order statistics, i.e., a median filter. Median filtering is defined as follows:
where M is a neighborhood; x and y are coordinates of pixels.
The essence of median filter work is that each element of the output image is equal to the median of the original image data located in a two-dimensional window (aperture).
The description of structures means the construction of broken curves by the vectorization of the image. This approach is carried out by constructing quadtrees, highlighting points describing the contour and further approximation by broken curves,.
As a result of the description of the structure, it is possible to carry out an analysis, namely, to determine their number, to calculate the area, length, center of mass of the figure, and other geometrical parameters for each structure, which allows us to form a feature vector necessary for the classification procedure. In addition to the geometric characteristics, the selection of the contours of the areas allows one to combine the colorimetric characteristics as a feature with the original image: Color, brightness gradient in points, etc.,.
It also seems possible to calculate certain mathematical parameters of structures in films of biological fluids. This is the general perimeter of contours, area of structures, aspect ratio (it is the ratio of width to height of bounding rectangle of the object), extent (extent is the ratio of the contour area to the bounding rectangle area), solidity (this is the ratio of contour area to its convex hull area), and equivalent diameter (equivalent diameter is the diameter of the circle whose area is the same as the contour area). Such analysis of films of biological fluids will allow us to move from the qualitative description to a more accurate, mathematical one.
Having a vector of signs, it is possible to determine the class of structure, which is the ultimate goal of medical diagnosis. Due to a well-constructed classifier, it is possible to establish a set of characteristic parameters, to determine possible pathologies by the images of the dehydration of biological liquids films.
We consider the procedures of image filtering as a part of this work, since the information that comes to the segmentation stage should have a minimum level of the noise component. Noise filtering involves two basic steps. When filtering images from noise components, it is also important to understand that all artifacts, when considering the frequency domain, have high frequency, often close to the frequency of object boundaries. Therefore, the first step is to eliminate the influence of artifacts on the general background situation. As a rule, this is done by blurring the image in the spatial domain or by processing the low-pass filter. After this, the contours and borders of the objects in the image are enhanced. Gradient methods and high-pass filters are used to implement this step. Consider the indicated steps for filtering the image separately.
Image processing took place according to the algorithm presented in Fig. 6.
The program code uses functions, such as erosion, thresholding, Gaussian blur. The determination of the contours and the calculation of their parameters directly depends on the specification of the window sizes and thresholds. Here, three test images of blood serum are shown in Fig. 7.
Figure 7. Test images: (a) spiral structures, (b) “plait” structures, and (c) “dendrite” structures.
As a result of processing, the contours of the main structures were highlighted on the images, as well as individual contour strokes were depicted. Fig. 8 shows the experimental results.
Figure 8. Computational results of blood serum films processing: (a) original images, (b) various contours of structures in the films, and (c) closed contours of main structures.
It was found that for all types of structures, the calculation of specified parameters can only be made with thresholds from 90 to 20. For each type of structure, depending on the size of the Gaussian blur window, the structure parameters were calculated. Data are presented in Tables 1, 2, and 3, respectively.
Gaussian window Area Perimeter Aspect ratio Extent Solidity Equivalent diameter 3 0 0 0 0 0 0 5 0.5 3.4142 1.0 0.1250 1.0000 0.7978 7 2.0 6.8284 1.0 0.2222 1.0000 1.5957 9 3.0 11.6568 0.8 0.1500 0.6000 1.9544 11 2.0 6.8284 1.0 0.2222 1.0000 1.5957 13 6.5 12.2426 0.8 0.3250 0.9285 2.8768
Table 1. Computational data of spiral structures
Gaussian window Area Perimeter Aspect ratio Extent Solidity Equivalent diameter 3 0 0 0 0 0 0 5 0 0 0 0 0 0 7 0 0 0 0 0 0 9 0 0 0 0 0 0 11 0 0 0 0 0 0 13 0.5 3.4142 1.0 0.125 1.0 0.7978
Table 2. Computational data of plaits structures
Gaussian window Area Perimeter Aspect ratio Extent Solidity Equivalent diameter 3 37.5 28.7279 1.375 0.4261 0.8823 6.9098 5 37.5 28.7279 1.375 0.4261 0.8823 6.9098 7 39.0 30.1421 1.500 0.4062 0.8764 7.0467 9 40.0 30.1421 1.500 0.4166 0.8791 7.1364 11 39.0 30.1421 1.500 0.4062 0.8764 7.0467 13 40.0 30.1421 1.500 0.4166 0.8791 7.1364
Table 3. Computational data of dendrites structures
It can be seen from the calculated parameters that basically the parameters do not change much depending on the Gaussian window, and are sometimes repeated. It has also been experimentally shown that a 5×5 erosion window size is optimal for edge detection.