# Applying Onicescu information energy for gray level image segmentation

Vasile Patrascu

<figure><img src="image_1.png" /></figure>

## To cite this version:

Vasile Patrascu. Applying Onicescu information energy for gray level image segmentation. [Technical Report] MDPI, preprints 202005.0167. 2020. hal-03190006

HAL Id: hal-03190006

https://hal.science/hal-03190006

Submitted on 5 Apr 2021

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Applying Onicescu information energy for gray level image segmentation

Vasile Patrascu

Research Center in Electrical Engineering,
Electronics and Information Technology

Valahia University

Targoviste, Romania,

E-mail: patrascu.v@gmail.com

## Abstract

This article presents a method of segmenting images with gray levels that uses Onicescu's information energy calculated in the context of the neutrosophic theory. Starting from the information energy calculation for complete neutrosophic information, it is shown how to extend its calculation for incomplete and inconsistent neutrosophic information. The segmentation method is based on calculation of thresholds for separating the gray levels using the local maximum points of the Onicescu information energy.

**Keywords:** neutrosophic information, Onicescu information energy, image segmentation, gray level image threshold.

**ACM/AMS Classification:** 68U10, 62H35

## 1 Introduction.

This article falls into the category of those who apply neutrosophic theory in image processing and is a continuation of research presented in previous papers [5], [6]. After the neutrosophic representation of the information regarding the gray levels contained in the image, we will use for segmentation, the Onicescu information energy associated with the neutrosophic information. Image segmentation will be done by determining thresholds to separate
the gray levels. These thresholds will be defined by the local maximum points of the Onicescu information energy. The segmentation of a gray level image actually means the determination of some clusters and we start from the premise that within each cluster, the Onicescu information energy is maximum. Next, the article has the following structure: section 2 does a brief presentation of the neutrosophic representation of the information; section 3 presents Onicescu's information energy and its extension to neutrosophic information [7]; section 4 presents the method of constructing neutrosophic information associated with gray levels and at the same time correlated with a certain separation threshold; section 5 presents the segmentation method; section 6 presents the experimental results; section 7 presents some conclusions while the last section is that of references.

## 2 The Neutrosophic Representation of Information.

Neutrosophic information is described by a triplet $q = (\mu, \omega, \nu) \in [0, 1]^3$, where $\mu$ represents the degree of truth, $\omega$ degree of neutrality and $\nu$ degree of falsity [8], [9], [10], [11]. The neutrosophic representation is a generalization of the fuzzy representation [12] and at the same time a generalization of the intuitionistic fuzzy representation [1]. For neutrosophic information the operations of union, intersection and negation can be defined. For two neutrosophic information $a = (\mu_a, \omega_a, \nu_a)$ and $b = (\mu_b, \omega_b, \nu_b)$ we define in this article the union $\cup$ and the intersection $\cap$ with the following formulas:

* The union $a \cup b$

$$ \mu_{a \cup b} = \mu_a \lor \mu_b \quad (1) $$

$$ \omega_{a \cup b} = (\mu_a - \nu_a) \lor (\mu_b - \nu_b) - (\mu_a - \omega_a - \nu_a) \lor (\mu_b - \omega_b - \nu_b) \quad (2) $$

$$ \nu_{a \cup b} = \mu_a \lor \mu_b - (\mu_a - \nu_a) \lor (\mu_b - \nu_b) \quad (3) $$

* The intersection $a \cap b$

$$ \mu_{a \cap b} = \mu_a \land \mu_b \quad (4) $$

$$ \omega_{a \cap b} = (\mu_a - \nu_a) \land (\mu_b - \nu_b) - (\mu_a - \omega_a - \nu_a) \land (\mu_b - \omega_b - \nu_b) \quad (5) $$

$$ \nu_{a \cap b} = \mu_a \land \mu_b - (\mu_a - \nu_a) \land (\mu_b - \nu_b) \quad (6) $$

where the symbol $\lor$ represents the maximum while the symbol $\land$ represents the minimum, namely:
$$ \forall x, y \in \infty, \infty), $$

$$ x \lor y = \max(x, y) \qquad (7) $$

$$ x \land y = \min(x, y) \qquad (8) $$

The negation operator for the neutrosophic information $a = (\mu, \omega, \nu)$ is obtained by the negation of each component, i.e. it is defined with the following formula:

• The negation $\bar{a}$

$$ \bar{a} = (1 - \mu, 1 - \omega, 1 - \nu) \qquad (9) $$

We must mention that the three operators defined above, construct a De Morgan algebra for neutrosophic information. At the end of the short presentation of neutrosophic information representation, we must note the following classification:

Neutrosophic information is complete if

$$ \mu + \omega + \nu = 1 \qquad (10) $$

is incomplete if

$$ \mu + \omega + \nu < 1 \qquad (11) $$

and is inconsistent if

$$ \mu + \omega + \nu > 1 \qquad (12) $$

## 3 Onicescu Information Energy.

Onicescu information energy was defined for probability distributions [2], [3], [4]. For a discrete probability distribution $P = (p_1, p_2, \dots, p_n)$, which obviously verifies the partition condition of unity,

$$ p_1 + p_2 + \dots + p_n = 1 \qquad (13) $$

Onicescu's information energy was defined with the following formula:

$$ E_o(P) = \sum_{i=1}^{n} p_i^2 \qquad (14) $$

The Onicescu information energy formula was extended to an $n$-dimensional fuzzy representations but which verifies the partition condition of unity. Thus, for an $n$-dimensional fuzzy information $M = (\mu_1, \mu_2, \dots, \mu_n \in [0, 1]^n)$ and which verifies the partition condition of unity,

$$ \mu_1 + \mu_2 + \dots + \mu_n = 1 \qquad (15) $$
using formula (14) we obtain:

$$E_o(M) = \sum_{i=1}^{n} \mu_i^2 \qquad (16)$$

But there are cases when the fuzzy information $M = (\mu_1, \mu_2, \dots, \mu_n)$ does not check the partition condition of unity (15) such as intuitionistic fuzzy information [1], paraconsistent fuzzy information and neutrosophic fuzzy information [8], [9], [10], [11]. This may be incomplete if:

$$\mu_1 + \mu_2 + \dots + \mu_n < 1 \qquad (17)$$

or it may be inconsistent, if:

$$\mu_1 + \mu_2 + \dots + \mu_n > 1 \qquad (18)$$

This happens in the case of neutrosophic fuzzy information because it is possible that the sum $\mu + \omega + \nu$ is different from 1. If the fuzzy information $M = (\mu_1, \mu_2, \dots, \mu_n)$ is incomplete or inconsistent, a complete information $\widehat{M}$ is constructed associated with the primary information [7]. Thus, we define the following parameters:

$$\delta = \mu_1 + \mu_2 + \dots + \mu_n - 1 \qquad (19)$$

$$\pi = \max(-\delta, 0) \qquad (20)$$

We define the components of information $\widehat{M}$ with the following formula [7]:

$$\hat{\mu}_i = \frac{\mu_i + \frac{2\pi}{n}}{1 + |\delta|} \qquad (21)$$

In the next, we will prove that the information $\widehat{M}$ whose components are defined by formula (21) is a complete information and that it verifies the partition condition of unity:

$$\sum_{i=1}^{n} \hat{\mu}_i = 1 \qquad (22)$$

From (21) it results:

$$\sum_{i=1}^{n} \hat{\mu}_i = \sum_{i=1}^{n} \frac{\mu_i + \frac{2\pi}{n}}{1 + |\delta|} = \frac{1}{1 + |\delta|} \left( \sum_{i=1}^{n} \mu_i + 2\pi \right) \qquad (23)$$
The following two formulas result from (19) and (20):

$$ \sum_{i=1}^{n} \mu_i = 1 + \delta \qquad (24) $$

$$ \pi = \frac{-\delta + |\delta|}{2} \qquad (25) $$

Replacing (24) and (25) in (23), it results the following two equalities:

$$ \sum_{i=1}^{n} \hat{\mu}_i = \frac{1}{1 + |\delta|} \left( 1 + \delta + 2 \frac{-\delta + |\delta|}{2} \right) = 1 \qquad (26) $$

Thus, we proved that the information $\widehat{M} = (\hat{\mu}_1, \hat{\mu}_2, \dots, \hat{\mu}_n)$ defined by (21) is a complete one and we can calculate the Onicescu information energy with the formula (16):

$$ E_o(\hat{M}) = \sum_{i=1}^{n} \hat{\mu}_i^2 \qquad (27) $$

The Onicescu energy of the complete information $\widehat{M}$ will also define the Onicescu energy for the information $M$ [7], namely:

$$ E_o(M) = E_o(\widehat{M}) \qquad (28) $$

The following equivalent formula results from formulas (27), (28) and (21):

$$ E_o(M) = \sum_{i=1}^{n} \left( \frac{\mu_i + \frac{2\pi}{n}}{1 + |\delta|} \right)^2 \qquad (29) $$

In the particular case of the neutrosophic information $q = (\mu, \omega, \nu)$, the formulas (19) and (20) become:

$$ \delta = \mu + \omega + \nu - 1 \qquad (30) $$

$$ \pi = \max(-\delta, 0) \qquad (31) $$

From (21), it results the complete neutrosophic information $\hat{q} = (\hat{\mu}, \hat{\omega}, \hat{\nu})$:

$$ \hat{\mu} = \frac{\mu + \frac{2\pi}{3}}{1 + |\delta|} \qquad (32) $$
$$ \hat{\omega} = \frac{\omega + \frac{2\pi}{3}}{1 + |\delta|} \qquad (33) $$

$$ \hat{\nu} = \frac{\nu + \frac{2\pi}{3}}{1 + |\delta|} \qquad (34) $$

From (27) and (29), we obtain for the neutrosophic information, the following formulas for the Onicescu information energy:

$$ E_o(\hat{q}) = \hat{\mu}^2 + \hat{\omega}^2 + \hat{\nu}^2 \qquad (35) $$

and

$$ E_o(q) = \left( \frac{\mu + \frac{2\pi}{3}}{1 + |\delta|} \right)^2 + \left( \frac{\omega + \frac{2\pi}{3}}{1 + |\delta|} \right)^2 + \left( \frac{\nu + \frac{2\pi}{3}}{1 + |\delta|} \right)^2 \qquad (36) $$

# 4 The Neutrosophic Information Construction.

Any image with gray levels is defined by the triplet $(D, V, f)$, where $D = \{1, 2, \dots, k-1, k\} \times \{1, 2, \dots, l-1, l\}$ is the domain image, $V = [0, 1]$ is the range of values of the gray levels, while $f: D \to V$ is the function that defines the image. The two parameters $k$ and $l$ are natural numbers. We will denote by $C_f$ the codomain of the function $f$, that is $C_f = f(D)$ and then we define the range of values that includes the codomain $C_f$, that is:

$$ c_m = \min(C_f) \qquad (37) $$

$$ c_M = \max(C_f) \qquad (38) $$

Now, we consider a certain threshold defined by the point $t \in (c_m, c_M)$. The point $t$ defines two subdomains $C_l$ and $C_h$, namely:

$$ C_l = \{c \in C_f | c \le t\} \qquad (39) $$

$$ C_h = \{c \in C_f | c \ge t\} \qquad (40) $$

Next, we will present the necessary steps to construct the neutrosophic information associated with the separation threshold $t$. We will calculate the averages $m_l$ and $m_h$ for $C_l$ and $C_h$ with the following two formulas:

$$ m_l(t) = \frac{1}{card(C_l)} \sum_{c \in C_l} c \qquad (41) $$
$$m_h(t) = \frac{1}{card(C_h)} \sum_{c \in C_h} c \qquad (42)$$

To calculate the components of neutrosophic information, we will use the similarity function for the gray levels from [5], [6]. This similarity function is defined by the following formula:

$$s : [0, 1] \times [0, 1] \rightarrow [0, 1],$$

$$s(x, y) = 1 - \frac{2|x - y|}{1 + |x - 0.5| + |y - 0.5|} \qquad (43)$$

First, we calculate the similarity between each gray level $c \in C_f$ and the averages $m_l, m_h$ and the threshold $t$. The following three similarity values result: $s(c, m_l), s(c, m_h)$ and $s(c, t)$.

$$s(c, m_l) = 1 - \frac{2|c - m_l(t)|}{1 + |c - 0.5| + |m_l(t) - 0.5|} \qquad (44)$$

$$s(c, m_h) = 1 - \frac{2|c - m_h(t)|}{1 + |c - 0.5| + |m_h(t) - 0.5|} \qquad (45)$$

$$s(c, t) = 1 - \frac{2|c - t|}{1 + |c - 0.5| + |t - 0.5|} \qquad (46)$$

We also define the similarity between a gray level $c \in C_f$ and the pair $(m_l, m_h)$ with the following aggregation formula:

$$s_a(c, m_l, m_h) = \max(s(c, m_l), s(c, m_h)) \qquad (47)$$

With the similarities defined by (44), (45), (46), (47), we will construct the neutrosophic information for each gray level $c$ and for each threshold $t$ with the formulas used in [6], [7]. This results in the following calculation formulas:

* The degree of truth:

$$\mu(c, t) = \frac{s(c, m_l) \cdot (1 - s(c, m_h))}{1 - s(c, m_l) \cdot s(c, m_h)} \qquad (48)$$

* The degree of neutrality:

$$\omega(c, t) = \frac{s(c, t) \cdot (1 - s_a(c, m_l, m_f))}{1 - s(c, t) \cdot s_a(c, m_l, m_f)} \qquad (49)$$

* The degree of falsity:

$$\nu(c, t) = \frac{s(c, m_h) \cdot (1 - s(c, m_l))}{1 - s(c, m_l) \cdot s(c, m_h)} \qquad (50)$$

With formulas (48), (49) and (50) we constructed the neutrosophic information $(\mu, \omega, \nu)$ for the gray level $c$ and the threshold $t$.
# 5 The Segmentation Method.

To begin with, we construct the possible set for the threshold values according to the values of the gray levels contained in image f. For this, we will use as a parameter, a natural number $Q \ge 100$. Thus the possible set for the threshold values will be defined by the formula:

$$V_{Qf} = (c_m, c_M) \cap \left\{ \frac{1}{Q}, \frac{2}{Q}, \dots, \frac{Q-1}{Q} \right\} \quad (51)$$

where the pair $(c_m, c_M)$ is defined by (37) and (38). For each threshold $t \in V_{Qf}$, we will calculate the average energy for fuzzy sets associated with the neutrosophic components $\mu, \omega$ and $\nu$ defined by formulas (48), (49) and (50). Thus, we obtain the partial energies $E_\mu(t), E_\omega(t)$ and $E_\nu(t)$.

$$E_\mu(t) = \frac{\sum_{c \in C_f} \mu(c, t) E_o(c, t)}{\sum_{c \in C_f} \mu(c, t)} \quad (52)$$

$$E_\omega(t) = \frac{\sum_{c \in C_f} \omega(c, t) E_o(c, t)}{\sum_{c \in C_f} \omega(c, t)} \quad (53)$$

$$E_\nu(t) = \frac{\sum_{c \in C_f} \nu(c, t) E_o(c, t)}{\sum_{c \in C_f} \nu(c, t)} \quad (54)$$

where $E_o(c, t)$ is calculated by the formula (36) for the triplet $(\mu(c, t), \omega(c, t), \nu(c, t))$. The total energy $E(t)$ is calculated with the average of the three partial energies, i.e.:

$$E(t) = \frac{E_\mu(t) + E_\omega(t) + E_\nu(t)}{3} \quad (55)$$

We assume that at the end of the Onicescu energy calculation stage, we obtain the following $n$ points of local maximums $(t_1, t_2, \dots, t_n)$. These local maximum points define the following $n + 1$ subsets: $w_1 = (c_m, t_1) \cap C_f$, ..., $w_i = (t_{i-1}, t_i) \cap C_f$, ..., $w_{n+1} = (t_n, c_M) \cap C_f$. Then for each subset $w_i$, we calculate its mean $\vartheta_i$, using the following formulas: $\forall i = 1, 2, \dots, n + 1$,

$$\vartheta_i = \frac{1}{card(w_i)} \sum_{c \in w_i} c \quad (56)$$

The segmented image is obtained by replacing each gray level that belongs to the subset $w_i$ with the mean $\vartheta_i$. In formulas (52), (53) and (54) for a greater refinement of the segmentation, we can replace the set $C_f$ with a
local neighborhood of the threshold $t$ of the form $C_{\Delta f} = C_f \cap [t - \Delta, t + \Delta]$ where $\Delta \in (0, 1)$. In this case the formulas (52), (53) and (54) become:

$$E_{\mu}(t) = \frac{\sum_{c \in C_{\Delta f}} \mu(c, t) E_{o}(c, t)}{\sum_{c \in C_{\Delta f}} \mu(c, t)} \qquad (57)$$

$$E_{\omega}(t) = \frac{\sum_{c \in C_{\Delta f}} \omega(c, t) E_{o}(c, t)}{\sum_{c \in C_{\Delta f}} \omega(c, t)} \qquad (58)$$

$$E_{\nu}(t) = \frac{\sum_{c \in C_{\Delta f}} \nu(c, t) E_{o}(c, t)}{\sum_{c \in C_{\Delta f}} \nu(c, t)} \qquad (59)$$

# 6 Experimental Results.

To test the properties of the method proposed in this article, we used it to segment the following images with gray levels: "baboon", "Mary", "peppers", "spider", "parrots" and "Bobby". These images can be seen in Figures 1(a), 2(a), 3(a), 4(a), 5(a), 6(a). The graphic of the functions obtained for the Onicescu information energy can be seen in Figures 1(b), 2(b), 3(b), 4(b), 5(b), 6(b). The segmented images can be seen in Figures 1(c), 2(c), 3(c), 4(c), 5(c), 6(c). Here are the results:

The Onicescu energy for image "baboon" has two local maximums for $t_1 = 0.40$ and $t_2 = 0.53$ while the averages obtained are $\vartheta_1 = 0.28$, $\vartheta_2 = 0.46$ and $\vartheta_3 = 0.62$.

The Onicescu energy for image "Mary" has two local maximums for $t_1 = 0.14$ and $t_2 = 0.44$ while the averages obtained are $\vartheta_1 = 0.05$, $\vartheta_2 = 0.28$, and $\vartheta_3 = 0.62$.

The Onicescu energy for image "peppers" has three local maximums for $t_1 = 0.20$, $t_2 = 0.48$ and $t_3 = 0.88$ while the averages obtained are $\vartheta_1 = 0.11$, $\vartheta_2 = 0.33$, $\vartheta_3 = 0.64$ and $\vartheta_4 = 0.89$.

The Onicescu energy for image "spider" has two local maximums for $t_1 = 0.19$ and $t_2 = 0.49$ while the averages obtained are $\vartheta_1 = 0.12$, $\vartheta_2 = 0.35$ and $\vartheta_3 = 0.53$.

The Onicescu energy for image "parrots" has four local maximums for $t_1 = 0.20$, $t_2 = 0.48$, $t_3 = 0.48$ and $t_4 = 0.88$ while the averages obtained are $\vartheta_1 = 0.11$, $\vartheta_2 = 0.33$, $\vartheta_3 = 0.64$, $\vartheta_4 = 0.64$ and $\vartheta_5 = 0.89$.

The Onicescu energy for image "Bobby" has three local maximums for $t_1 = 0.16$, $t_2 = 0.36$ and $t_3 = 0.69$ while the averages obtained are $\vartheta_1 = 0.07$, $\vartheta_2 = 0.23$, $\vartheta_3 = 0.52$ and $\vartheta_4 = 0.81$.
<figure><img src="image_3.png" /><figcaption>Figure 1: The image "baboon" (a). The graphic of the Onicescu energy and its local maximums (b). The segmented image with three gray levels (c).</figcaption></figure>

<figure><img src="image_4.png" /><figcaption>Figure 2: The image "Mary" (a). The graphic of the Onicescu energy and its local maximums (b). The segmented image with three gray levels (c).</figcaption></figure>

# 7 Conclusions.

This article presents a method of segmenting images with gray levels using elements of neutrosophic theory. In fact, each pixel is associated with neutrosophic information to which the Onicescu information energy is calculated. The segmentation method uses the determination of optimal thresholds, for separating the gray levels in intervals, after which, the averages of these intervals describe the basis for the representation of the segmented image. The separation thresholds are defined by the local maximum points of the Onicescu information energy. The experimental results show us that the local maximums of the Onicescu information energy can be used as thresholds for separating the gray levels in the segmentation process. It is also observed that the presented method can provide multiple separation thresholds. On the other hand, this article is an example of using the neutrosophic representation of information in the field of image processing with gray levels and at the same time the use of Onicescu information energy.
<figure><img src="image_5.png" /><figcaption>Figure 3: The image "peppers" (a). The graphic of the Onicescu energy and its local maximums (b). The segmented image with four gray levels (c).</figcaption></figure>

<figure><img src="image_6.png" /><figcaption>Figure 4: The image "spider" (a). The graphic of the Onicescu energy and its local maximums (b). The segmented image with three gray levels (c).</figcaption></figure>

## References.

1. K. Atanassov. Intuitionistic Fuzzy Sets, Fuzzy Sets and Systems, 20, pp. 87-96, 1986

2. O. Onicescu, Energie informationelle, Comptes Rendues l'Academie des Sciences, Paris, Seria A, vol 263, 1966.

3. O. Onicescu, V. Stefanescu, Elemente de statistica informationala cu aplicatii (Elements of information statistics with applications), Editura Tehnica, Bucuresti, 1979.

4. O. Onicescu, G. Mihoc, Energia informationa (Information energy), Studii si Cercetari Matematice, vol. 18, 1966.

5. V. Patrascu, Gray Level Image Threshold Using Neutrosophic Certainty, The Conference on Applied Mathematics and Informatics, CA-MAI 2019, Bucharest, Romania, November 15-18, 2019.
<figure><img src="image_7.png" /><figcaption>Figure 5: The image "parrots" (a). The graphic of the Onicescu energy and its local maximums (b). The segmented image with five gray levels (c).</figcaption></figure>

<figure><img src="image_8.png" /><figcaption>Figure 6: The image "Bobby" (a). The graphic of the Onicescu energy and its local maximums (b). The segmented image with four gray levels (c).</figcaption></figure>

6. V. Patrascu, Gray Level Image Threshold Using Neutrosophic Shannon Entropy, The 3rd Conference on Recent Advances in Artificial Intelligence, RAAI 2019, Bucharest, Romania, June 28-30, 2019.

7. V. Patrascu, Shannon entropy for imprecise and under-defined or over-defined information, The 25th Conference on Applied and Industrial Mathematics, CAIM 2017, Iasi, Romania, September 14-17, 2017, RO-MAI Journal, vol. 14, no. 1, pp. 169-185, 2018.

8. F. Smarandache, A Unifying Field in Logics: Neutrosophic Logic. Neutrosophy, Neutrosophic Set, Neutrosophic Probability, American Research Press, Rehoboth, NM, 1999.

9. F. Smarandache, Neutrosophy, arXiv:math/0010099, 11 Oct. 2000.
10. F. Smarandache, An Introduction to the Neutrosophic Probability Applied in Quantum Physics, arXiv:math/0010088, 10 oct 2000.

11. F. Smarandache, Neutrosophic Set - A Generalization of the Intuitionistic Fuzzy Set, International Journal of Pure and Applied Mathematics, 24, no. 3, pp. 287-297, 2005.

12. A. L. Zadeh, Fuzzy sets, Information and Control, 8 pp. 338-353, 1965.