**3.2 k-means algorithm**

It is based on grouping similar data points into clusters. There is no prediction involved. Its algorithm is illustrated by these steps [18].


Downsampling Downsampling

*Automatic Noise Reduction in Ultrasonic Computed Tomography Image for Adult Bone Fracture… DOI: http://dx.doi.org/10.5772/intechopen.101714*


#### **3.3 k-means algorithm combined with Otsu algorithm + morphologic algorithm**

The proposed hybrid algorithm uses the combination of k-means with the Otsu method and the morphologic algorithm. The k-means algorithm implementation is important. It works well in a large number of cases and it is a powerful tool to have in the closet point. Unfortunately, in medical image processing, it is not sufficient for region detection and edge detection. k-Means combined with the morphologic and Otsu algorithms give us sufficient results.

#### *3.3.1 Morphologic algorithm*

Morphological filters are a valuable aid in the segmentation and noise removal process. Morphological filtering is based on mathematical morphological operations, well applied to binary images as well as monochrome (grayscaled) images. To be limited to binary image morphological filtering, morphological operations aim to perfect the improper structure of an image [17]. The morphological erosion of X by B is defined by the principle of duality where X is the set of points described in the space and B is the structuring element. Its equation is written under the following form:

$$\text{Se } \mathbf{B}(\mathbf{x}) = \text{ } \mathbf{\delta}\mathbf{B} \text{ (x)}\tag{4}$$

$$
\varepsilon \, \mathsf{B}(\mathbf{x}) = \mathsf{S} \, \mathsf{B}\, \overline{(\mathbf{x})} = \overline{\overline{\mathbf{x}} \oplus \overline{\mathbf{B}}} = \mathbf{x} \ominus \overline{\mathsf{B}} \tag{5}
$$

#### *3.3.2 Otsu algorithm*

The Otsu method of the threshold is the most powerful and global threshold method. It performs image binarization based on the histogram image shape. It assumes that the image for binarization contains the only foreground and background pixels [19, 20]. Using the simple formula in the Otsu algorithm, we get:

$$
\sigma^2 = \Psi \mathbf{A} \left( \mathbf{u} \, \mathbf{A} - \mathbf{u} \right)^2 + \Psi \mathbf{B} \left( \mathbf{u} \, \mathbf{B} - \mathbf{u} \right)^2 \tag{6}
$$

where σ<sup>2</sup> is the variance between both clusters, Ψ<sup>A</sup> is the probability of class A, Ψ<sup>B</sup> is the probability of class A, uA is the average gray of class A, u <sup>B</sup> is the average gray of class B, and u is the threshold value which divides the image into two classes A and B. The best threshold u maximizes the variance between both clusters. It computes the optimal threshold by minimizing the intra-class variance that separates the foreground pixels from background pixels [21]. The main purpose of the Otsu method is to find the threshold values where the sum of the values of the foreground and background pixels has to be minimal [22].
