From efbc07185be8d90d6c0580815926ac090f47e5c2 Mon Sep 17 00:00:00 2001 From: Sebastian Dietz <151366475+ad33edub@users.noreply.github.com> Date: Tue, 14 Jan 2025 12:14:08 +0100 Subject: [PATCH] Update otsu.md --- content/otsu.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/content/otsu.md b/content/otsu.md index 1ea657c5..0222824e 100644 --- a/content/otsu.md +++ b/content/otsu.md @@ -29,7 +29,19 @@ ___ Otsu's method works by maximizing the **between class variance** σB² which is defined as: -
+
B2 (θ) = P1(θ) · P2(θ) · (μ1(θ) - μ2(θ))2

+ +with + +P~1~(θ) = $\sum_{i = 0}^{\theta} h(i)$ (≙ number of pixels below the threshold (background)) + +P~2~(θ) = 1 - P~1~(θ) = $\sum_{i = \theta +1}^{L-1} h(i)$ (≙ number of pixels above the threshold (foreground)) + +μ~1~(θ) = $\frac{1}{P1(\theta)}$ $\cdot$ $\sum_{i = 0}^{\theta} (i+1)h(i)$ (≙ mean intensity of the background) + +μ~2~(θ) = $\frac{1}{P2(\theta)}$ $\cdot$ $\sum_{i = \theta +1}^{L-1} (i+1)h(i)$ (≙ mean intensity of the foreground) +
with __h(i)__ being the normalized histogram of the image, __θ__ being the current threshold and __L__ being the length of the histogram-array. @@ -59,7 +71,9 @@ To do: ``` a. Create a `double`-array of appropriate size to store the histogram-values + b. Iterate through the input-image and update the corresponding histogram-entry for each pixel's value + c. Normalize and return the histogram.