I have played with your image a bit in C++ with my DIP lib and here is the result:
picture pic0,pic1;
pic0.load("ocr_green.png");
pic0.pixel_format(_pf_u); // RGB -> Grayscale <0-765>
pic0.enhance_range(); // remove DC offset and use full dynamic range <0-765>
pic0.normalize(8,false); // try to normalize ilumination conditions of image (equalize light) based on 8x8 sqares analysis, do not recolor saturated square with avg color
pic0.enhance_range(); // remove DC offset and use full dynamic range <0-765>
pic1=pic0; // copy result to pic1
pic0.pixel_format(_pf_rgba); // Grayscale -> RGBA
int x,y,c,c0,c1;
for (y=0;y<pic1.ys;y++) // process all H lines
{
c0=pic1.p[y][0].dd; c1=c0; // find min and max intensity in H line
for (x=0;x<pic1.xs;x++)
{
c=pic1.p[y][x].dd;
if (c0>c) c0=c;
if (c1<c) c1=c;
}
if (c1-c0<700) // if difference not big enough blacken H line...
for (x=0;x<pic1.xs;x++) pic1.p[y][x].dd=0;
else // else binarize H line
for (x=0;x<pic1.xs;x++)
if (pic1.p[y][x].dd>=155) pic1.p[y][x].dd=765; else pic1.p[y][x].dd=0;
}
pic1.pixel_format(_pf_rgba); // Grayscale -> RGBA

The left image (pic0
) is just yours converted to grayscale, enhanced dynamic range to max and equalized illumination.
The right image (pic1
) is binarized but only for horizontal lines with high enough change on pixel intensities (as mentioned in my comment)... the rest is set to black...