I am trying to create an application that can read text from an image. But I have problems clearing the background. I need results, for example:
Input Image 1: 
Output Image 1: 
This is the code I tried:
cvtColor(org, tmp, CV_BGR2GRAY);
normalize(tmp, tmp, 0, 255, NORM_MINMAX);
threshold(tmp, dst, 0, 255, CV_THRESH_OTSU);
source
share