5

I'm having a problem with binarization of image (perhaps blurry in general) I have this image:

and after I've done binarization I get

How can I do better binarization? My goal is to have just black background and white letters and nothing else. I used adaptive threshold binarization

cv2.adaptiveThreshold(image_gs,255,cv2.ADAPTIVE_THRESH_MEAN_C,cv2.THRESH_BINARY ,41,3) 

and I also have

kernel=np.ones(1,1)

Does anyone have idea how to do that?

slomil
  • 193
  • 1
  • 4
  • 12

2 Answers2

4

You should try deblurring methods, see these:

Deblurring image by deconvolution using opencv

Experiments with deblurring using OpenCV

Community
  • 1
  • 1
Nima
  • 379
  • 3
  • 15
2

Try out the following:

1.De-noise your image,first, by using either a Median,Bilateral,Gaussian or Adaptive Smooth Filter (Gaussian filter works pretty well when it comes to images with textual content).

2.De-blur the image by referring to http://www.pyimagesearch.com/2015/09/07/blur-detection-with-opencv/ or https://github.com/tvganesh/deconv

3.Check out Adaptive Gaussian thresholding,instead.In case its a scene text image,you can use Otsu's algorithm after shadow removal. The 'Image Processing in OpenCV' tutorials have a detailed documentation on Image Thresholding.

The Image Filtering — OpenCV 3.0.0-dev documentation explains the implementation of the Median Blur, applied to an image.

Sukriti
  • 66
  • 5