Denoise and filter an image
<p>I am doing a <strong>license-plate recognition</strong>. I have crop out the plate but it is very <strong>blurred</strong>. Therefore I cannot split out the digits/characters and recognize it.</p>

<p>Here is my image:</p>

<p><a href="https://i.stack.imgur.com/qQ8CF.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/qQ8CF.jpg" alt="enter image description here"></a></p>

<p>I have tried to <strong>denoise</strong> it through using <strong>scikit image</strong> function.</p>

<p>First, import the libraries:</p>

<pre><code>import cv2
from skimage import restoration
from skimage.filters import threshold_otsu, rank
from skimage.morphology import closing, square, disk
</code></pre>

<p>then, I read the image and convert it to <strong>gray scale</strong></p>

<pre><code>image = cv2.imread("plate.jpg")
image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
</code></pre>

<p>I try to <strong>remove the noise</strong>:</p>

<pre><code>denoise = restoration.denoise_tv_chambolle(image , weight=0.1)
thresh = threshold_otsu(denoise)
bw = closing(denoise  &gt; thresh, square(2))
</code></pre>

<p>What I got is :</p>

<p><a href="https://i.stack.imgur.com/udt2O.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/udt2O.jpg" alt="enter image description here"></a></p>

<p>As you can see, all the digits are <strong>mixed together</strong>. Thus, I <strong>cannot separate</strong> them and recognize the characters one by one.</p>

<p>What I expect is something like this (I draw it):</p>

<p><a href="https://i.stack.imgur.com/OHQN3.png" rel="noreferrer"><img src="https://i.stack.imgur.com/OHQN3.png" alt="enter image description here"></a></p>

<p>I am looking for help how can I better filter the image? Thank you.</p>

<p>=====================================================================
<strong>UPDATE</strong>:</p>

<p>After using <code>skimage.morphology.erosion</code>, I got:</p>

<p><a href="https://i.stack.imgur.com/Z0Pak.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/Z0Pak.jpg" alt="enter image description here"></a></p>