How to prepare image to recognize by tesseract OCR

放肆的年华 提交于 2019-12-06 15:49:35

You can treat this image as follows:

  for jy:= 0 to bm.Height do
   for ix := 0 to bm.Width do
    begin
      cor:=bm.Canvas.Pixels[ix,jy];

      R:=GetRValue(Cor);
      G:=GetGValue(Cor);
      B:=GetBValue(Cor);

      if g>38 then
        bm.Canvas.Pixels[ix,jy]:=clWhite
      else
        bm.Canvas.Pixels[ix,jy]:=clBlack;
    end;
As an output I got the following image:

Hope this helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!