Below example images;







Sometimes it works correctly but sometimes my filter image not clear. That's why my program can not read characters.I'm using threshold filter and values are "threshold(hamImg, filtreli, 150, 255, THRESH_BINARY);" I think this parameters are not usefull for me .
Which image filter should I use ?