With the assumption of clear text on a solid background, I found Otsu's binarization very good.
Here's some C++ Code.
cvtColor(src, src, COLOR_RGB2GRAY); //Make grayscale
threshold(src, src, 0, 255, THRESH_BINARY+THRESH_OTSU);
Question
I have used adaptive thresholding on an image to turn it from
to this
with adaptiveThreshold(src, src, 255, ADAPTIVE_THRESH_GAUSSIAN_C, THRESH_BINARY, 11, 2);
Is there a way I could smooth out the characters, specifically with OCR in mind? Or am I better to adjust my adaptive threshold params?
Solution 3
With the assumption of clear text on a solid background, I found Otsu's binarization very good.
Here's some C++ Code.
cvtColor(src, src, COLOR_RGB2GRAY); //Make grayscale
threshold(src, src, 0, 255, THRESH_BINARY+THRESH_OTSU);
OTHER TIPS
If the letter is always with specific colour you can use colour based segmentation,
Convert source to hsv colour space.
Perform inRange() between lower and upper threshold for the particular colour.
For the above image you culd use some thing like
Mat src=imread("l.jpg",1);
Mat hsv,thr;
cvtColor(src,hsv,CV_BGR2HSV);
inRange(hsv,Scalar(76,84,86),Scalar(135,255,255),thr);
imshow("thr",thr);
See the result,
Check out the morphological operations. Especially dilation followed by erosion.