<p>Besides the suggestions in comments, I would suggest a high pass filtering to get rid of the low frequency noise, before running your local thresholding. Here an example with GIMP, that you can probably easily reproduce with opencv as well.</p>

<p><a href="https://i.sstatic.net/YPJ4s.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/YPJ4s.png" alt="enter image description here"></a></p>

CC BY-SA 4.0
2020-02-06T09:56:00.587Z
2020-02-06T09:56:00.587Z
87VN0
<p>I am experimenting with local (adaptive) grey threshold for the binarization of B&amp;W photographs of yellowed manuscripts:</p>

<p><a href="https://i.sstatic.net/tAS67.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/tAS67.png" alt="Raw image"></a></p>

<p>I got adaptive thresholding working in both scikit-image and cv2. In both cases (<code>grey &lt; threshold_niblack()</code> in scikit-image and <code>cv.adaptiveThreshold()</code> in cv2 -- all Python) the result I get is successfully binarized, with the background pretty much uniform -- and completely full of noise:</p>

<p><a href="https://i.sstatic.net/8yuGR.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/8yuGR.png" alt="Binarized image"></a></p>

<p>What kind of step do I now need to separate the text from this background noise?</p>

CC BY-SA 4.0
2019-11-08T17:10:20.360Z
looks like you should be able to extract features by area. So remove any continious area smaller than x pixels
joojaa
CC BY-SA 4.0
2019-11-09T06:18:38.493Z
@Rahul I see, thank you. Adjusting the "Constant subtracted from the mean" does help.
Aaron Brick
CC BY-SA 4.0
2019-11-09T06:19:19.830Z
@joojaa Thank you! I found out how to find, filter, and draw contours. This is promising.
Aaron Brick
<image-processing><denoise>
What kind of denoising must follow locally adaptive binarization?
Aaron Brick
# What kind of denoising must follow locally adaptive binarization?

(Asked by: username_0 on 2019-11-08)

I am experimenting with local (adaptive) grey threshold for the binarization of B&W photographs of yellowed manuscripts:

[![Raw image](https://i.sstatic.net/tAS67.png)](https://i.sstatic.net/tAS67.png)

I got adaptive thresholding working in both scikit-image and cv2. In both cases (`grey < threshold_niblack()` in scikit-image and `cv.adaptiveThreshold()` in cv2 -- all Python) the result I get is successfully binarized, with the background pretty much uniform -- and completely full of noise:

[![Binarized image](https://i.sstatic.net/8yuGR.png)](https://i.sstatic.net/8yuGR.png)

What kind of step do I now need to separate the text from this background noise?

**Tags:** image-processing, denoise

> **Comments:**
> **username_1**: looks like you should be able to extract features by area. So remove any continious area smaller than x pixels  
> **username_0**: @Rahul I see, thank you. Adjusting the "Constant subtracted from the mean" does help.  
> **username_0**: @username_1 Thank you! I found out how to find, filter, and draw contours. This is promising.  

---

## 1 answers

### Answer by username_2 on 2020-02-06. Score: 2

Besides the suggestions in comments, I would suggest a high pass filtering to get rid of the low frequency noise, before running your local thresholding. Here an example with GIMP, that you can probably easily reproduce with opencv as well.

[![enter image description here](https://i.sstatic.net/YPJ4s.png)](https://i.sstatic.net/YPJ4s.png)


---

