summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick White <git@njw.name>2019-12-17 18:03:26 +0000
committerNick White <git@njw.name>2019-12-17 18:03:26 +0000
commit890f74a7f491d1f7b1d50155469f26a17be8eb1d (patch)
treea465280ee1f54b44517603772bac2599e9af15b7
parentc78a865ba44053427c5253014c03f525da0e6404 (diff)
WIP adaptive binarisation
-rw-r--r--content/posts/adaptive-binarisation/index.md27
-rw-r--r--content/posts/binarisation-introduction/index.md4
-rw-r--r--images/adaptive-binarisation/example-01.xcfbin0 -> 32880 bytes
3 files changed, 28 insertions, 3 deletions
diff --git a/content/posts/adaptive-binarisation/index.md b/content/posts/adaptive-binarisation/index.md
index 0060f44..4266343 100644
--- a/content/posts/adaptive-binarisation/index.md
+++ b/content/posts/adaptive-binarisation/index.md
@@ -1,6 +1,31 @@
---
title: "Adaptive Binarisation"
-date: 2019-10-02
+date: 2019-12-17
draft: true
categories: [binarisation, preprocessing, image manipulation]
---
+The [previous post](/posts/binarisation-introduction) covered the
+basics of binarisation, and introduced the Otsu algorithm, a good
+method for finding a global threshold number for a page. But there
+are inevitable limitations with using a global threshold for
+binarisation. Better would be to use a threshold that is adapted
+over different regions of the page, so that as the conditions of the
+page change so can the threshold. This technique is called adaptive
+binarisation.
+
+For each pixel of an image, adaptive binarisation considers the
+pixels around it to determine a good threshold. This means that even
+in an area which is heavily shaded, for example near the spine of a
+book, the text will be correctly differentiated from the background,
+as even though they may both be darker than the text in the rest of
+the page, it is the darkness relative to its surroundings that
+matters.
+
+<!--
+(diagram showing 2 different areas of a page, one light and one dark,
+comparing global and local thresholding [can be fake, as the global
+threshold diagram was])
+(actually can probably just have a dark area of a page, comparing global
+and local thresholding, setting the global one such that the image is
+screwed up)
+-->
diff --git a/content/posts/binarisation-introduction/index.md b/content/posts/binarisation-introduction/index.md
index 13b27dc..288637c 100644
--- a/content/posts/binarisation-introduction/index.md
+++ b/content/posts/binarisation-introduction/index.md
@@ -73,5 +73,5 @@ than the global threshold.
Both of these criticisms could be addressed by using an algorithm that
could alter the threshold according to the conditions of the region on
-the page. That will be covered in the next blog post<!--,
-[Adaptive Binarisation](/posts/adaptive-binarisation)-->.
+the page. That will be covered in the next blog post,
+[Adaptive Binarisation](/posts/adaptive-binarisation).
diff --git a/images/adaptive-binarisation/example-01.xcf b/images/adaptive-binarisation/example-01.xcf
new file mode 100644
index 0000000..3eb7c2e
--- /dev/null
+++ b/images/adaptive-binarisation/example-01.xcf
Binary files differ