APPLICATION OF DIGITAL IMAGE PROCESSING METHODS FOR OBTAINING CONTOURS OF OBJECTS ON ULTRASOUND IMAGES OF THE HIP JOINT

In this work, the problems of research of ultrasonic images of joints are formulated. It is that for early diagnosis of developmental disorders of the hip joints needs to take frequent pictures, and the least harmful to health is ultrasound. But the quality of such images is not sufficient for highquality automated measurement of geometric parameters and diagnosis of deviations. The ultrasound image of the hip joint is evaluated by quantifying the exact values of the acetabular angle, the angle of inclination of the cartilaginous lip, and the location of the center of the femoral head. To get these geometric parameters, you need to have clear images of objects. And for the operation of automated computer measurement systems, it is necessary to use such methods of pre-digital image processing, which would give clear contours of objects. Known and available image processing algorithms, in particular contour selection, face problems in processing specific medical images. It is proposed to use the developed method of sharpening to further obtain high-quality contour lines of objects. A mathematical model of the method is presented, which is a formula for converting the intensity values of each pixel of a digital image. As a result of this method, the noise component of the image is reduced, and the intensity differences between the background and the objects are increased, and the width of these differences is one pixel. The algorithm of a sequence of processing of ultrasonic images and features of its application have resulted. The results of the developed set of methods are given. The paper presents the results of processing the real image of the hip joint, which visually confirms the quality of the selection of objects on view.


Introduction
For early diagnosis of dysplasia and study of the development of the hip joints of children, two main areas of examination are used -X-ray and ultrasound. A state of joint development and possible disorders are assessed by measuring the values of the acetabular angle, the angle of inclination of the cartilaginous lip, and the location of femoral head centre. Various computer applications for automated detection and measurement are used to study these values.
X-ray images are obviously clearer, more detailed and do not have such noise in the image as ultrasound images. But their disadvantage is that the process of obtaining X-ray images is harmful to the body and therefore they cannot be done often. If a child shows signs of impaired development of the hip joints, then, in order to monitor dynamics of the joint, an image should be obtained quite often. Therefore, in such cases the ultrasonic technique of reception of joint images is generally applied. It practically does not harm the child's body.
The disadvantages of such images obtained by ultrasound technique are much worse quality, low definition of objects in the image and the presence of noise in the image. Therefore, for higher measurement accuracy and the possibility of using automated computer measurement systems, pre-processing of digital images is quite relevantit is noise filtering, sharpening and highlighting clear contours of image objects.

Formulation of the problem
The main problem is the poor quality of the contours of ultrasound objects after the contours are selected by traditional methods. Specific processing methods should also be used to process specific medical images.
When processing ultrasound images, it is difficult to obtain the contour by the usual gradient method, because the boundaries of the image objects are quite wide, and the values of the gradient increment at the boundary are commensurate to the amplitude of noise in the image. Therefore, the contour line obtained by this method will look continuous, but will be wide and blurred, which makes it almost impossible to automatically select objects of the image and calculate their geometric parameters. When selecting contours by gradient methods, the contour line, although it will be thin and clear, but will have gaps and false fragments of the contour. This, in turn, will distort the shape of the image objects, which will create ambiguity for their automated parameterization. Methods based on differential approaches give for such images a contour consisting of a large number of fragments across the width of the intensity difference. It also makes it almost impossible to automatically determine objects' geometric parameters of ultrasound images [1,5,7].

Mathematical models
Optoelectronic systems designed to extract geometric features and measure the geometric parameters of objects have a large number of optical transmission links and optical transmission functions.
The central limit theorem states that the law of distribution of the sum of random variables is indefinitely close to the normal law and has an analogue in the theory of linear filtering: the product of several spatial-frequency characteristics of individual parts of the optical system approaches the Gaussian form when their number becomes large. This circumstance attaches special importance to the Gaussian, which makes it possible to accurately describe the spatial-frequency properties of real optoelectronic devices.
The mathematical notation of a normalized Gaussian has the form of general formula (1) shown below: (1) where σis RMS distribution of the intensity difference at the boundary (Gaussian law constant), x, yborder coordinates.
If σ > 0, then a sharp contrast intensity distribution H(x, y) turns into a blurred image. The degree of blur is greater the greater the value σ.
Let the object H(x, y) have a two-dimensional distribution of the intensity of the sharp edge ( Fig. 1).

Fig. 1. View of the boundary curve before and after passing through the linear optical system with scattering function G(x)
To restore the shape of the intensity difference at the boundaries of the background and objects to one that is closer to the input, it is proposed to use the developed method of sharpening.
Traditional filters use static masks of weights to pass through the entire image. A feature of the proposed method is the use of a dynamic mask of weights. That is, for each pixel of the image is convoluted with a mask of individual coefficients. The input data for calculating the coefficients is the value of the intensity of the near pixels.
The processing time of the image will obviously increase but having received the image with such form of differences further it is possible to receive accurate continuous contour lines in width in one pixel.
To form a mask of weight coefficients, the following indicators are introduced [5]: Using the calculated coefficients, we form a mass of weights. Thus, the general mathematical model of the method [2, 3, 5] described by the system of equations: where n is the size of the mask, Iij the input brightness value of the current pixel, I′ij the output brightness value of the current pixel. Figure 2 shows the result of using the proposed method. Here is the shape of the boundary curve of the real ultrasound image, before and after the application of this method.

Fig. 2. View of the boundary curve before and after use the proposed method of increasing sharpness
Step of the grid on image is one pixel so as we can see we have one pixel width slope after image processing.
The process of sharpening to a maximum slope at boundary curve involves the following steps [5]: 1) specifying the n×n mask depending on the width of the intensity drops; 2) calculating the average intensity value of pixels in a moving window; 3) comparing the intensity of the central pixel with the average value of the window; 4) comparing intensity values of each pixel in the window with the intensity value of the central pixel in the window; 5) forming the mask of weight coefficients; 6) forming a new mask for the next pixel with weights on the above algorithm. An edge detection method is proposed basing on finding intersection points [4,6] of boundary curves of the input image and the image after proposed sharpening.
This will allow you to get contour lines with differentiated intensities depending on the magnitude of the difference, while having a clean background. Therefore, you can easily highlight significant elements of the image and weed out minor ones.

Results and discussion
Based on the above, we can conclude that to highlight the contour of the object on the ultrasound image, you must first perform a sharpening. But it is necessary to choose a method of sharpening that would not increase the noise level.
It is proposed to apply the method of sharpening to the maximum slope of the boundary curve [2,3,5]. Figure 3 shows part of the ultrasound image of the hip joint (a) and the same image after linear filtration (b). a b Fig. 3

. Part of the ultrasound image of the hip joint: a) the original image, b) after linear filtering
As can be seen from the figures, the original image has a fairly high noise level, so the first stage of processing is linear noise filtering. But after filtering, the already blurred contours become even more blurred.
However, the use of the proposed method [2,3] of sharpening to the maximum slope of the boundary curve gives good results. Figure 4 (a) shows the result of applying the proposed method of sharpening.
As you sharpen, the inner parts of the image become smoother with less noise, and the background becomes smoother with less noise. Instead, the transition between the background and the object became clear, given the transition of 1 pixel width and the height of the transition, which corresponds to the average difference between the background and the object. Now the contours of objects obtained from such image will look much better visually and will be much more suitable for automated measurement of objects' geometric parameters. Figure 4b shows the image of the contours obtained by finding intersection points of boundary curves of the images [4,6].
In this case, filtered and sharpened images ( Fig. 3b and Fig. 4a, respectively). Moreover, the pixel intensity at the point of intersection is calculated as the difference between the pixel intensity at the edge of the image difference from high sharpness. This approach makes it possible to obtain thin contour lines and differentiate their intensities. Figure 4b shows that intensity of the contour lines of studied objects is higher than intensity of side elements contours of the image. This in turn makes it possible to remove unnecessary contour lines if necessary, for the use of automated systems for measuring objects' geometric parameters. When performing the step of sharpening with the proposed method, a very important aspect is the selection of the mask size for image processing. In the input image, the width of the intensity differences between the background and the objects can be dozens of pixels, depending on the image resolution. The size of the mask should be chosen as the average value of the intensity differences width [8]. Then the processing results will be the best. If you select a mask smaller than required, the original image will be more granular, and if you select a mask larger than requiredon the contrary, the curves of the contours will have larger radiuses.
This was confirmed experimentally. For this purpose, the synthesized sample image with clear and sharp differences in intensity was subjected to noise and blur. As a result, the average width of the differences was about 16-20 pixels. It was then reproduced using the proposed sharpening method. The initial and reproduced images were compared using the standard deviation criterion.
A graph of the dependence of the standard deviation on the size of the mask is obtained (Fig. 5). The graph shows that the best results are obtained when using a mask with a size close to the average width of the differences [8]. Figure 6 shows the sequence of stages of processing the input image.

Linear image filtering
Estimate the average width of brightness differences between background and studied objects to select optimal dimension of the mask Sharpen to the maximum slope of the boundary curve Obtain a contour by finding intersection points of the filtered and the image after sharpening Remove unnecessary contour lines (if necessary)

Summary
Therefore, the paper proposes a way to solve the problem of isolating high-quality contours of objects of the hip joint ultrasound images. The use of a sequence of image processing methods is proposed. A mathematical model of sharpening digital images is presented. The choice of the mask dimension is substantiated. The results of the proposed methods on real ultrasound images are presented. Consistent use of the proposed methods of ultrasound image processing allows you to clearly identify image objects, get their qualitative contours, clear, narrow and continuous. This, in turn, significantly increases the efficiency of automated computer tools for measuring objects geometric parameters, that speeds up the diagnostic process and allows to more accurately track changes dynamics in the of objects' geometry, in this casethe geometry of the hip joint.