I have a processed captcha image(Enlarged) look like :
As you can see, the font-size of the \"TEXT\
To quickly get rid of most of the lines, you can turn all black pixels with two or less adjacent black pixels white. That should fix the stray lines. Then, when you have a lot of "blocks" you can remove the smaller ones.
This is assuming the sample image has been enlarged, and the lines are only one pixel wide.