设为首页 加入收藏

TOP

再看 AspriseOCR - OCR应用开发 -20151124(二)
2017-10-10 12:06:53 】 浏览:8973
Tags:再看 AspriseOCR OCR 应用开发 -20151124
bsp; begin
    for by := 0 to bm.Height-1 do
    begin
      //clBlue = TColor($FF0000); clBlack = TColor($000000);
      //clRed = TColor($0000FF);clWhite = TColor($FFFFFF);
      //clLime = TColor($00FF00);
      aColor:=bm.Canvas.Pixels[bx,by];
      aChageColorEn:=False;
      aClb:=Abs( Byte(aColor shr 16)- Byte(aMainColor shr 16));
      if aClb<=aMainTorl then
      begin
        // Blue ok
        aClg:=Abs( Byte(aColor shr 8)-Byte(aMainColor shr 8));
        if aClg <= aMainTorl then
        begin
          //Green OK
          aClr:=Abs( Byte(aColor)-Byte(aMainColor));
          if aClr <= aMainTorl then
          begin
            //Red ok
            aChageColorEn:=True;
          end;
        end;
      end;


      if aChageColorEn then
        bm.Canvas.Pixels[bx,by]:=TColor($FFFFFF);   //White
      else
        bm.Canvas.Pixels[bx,by]:=TColor($000000);  //Black
    end;
  end;

  Result:=bm;
  
end;

 

//图片反色

procedure TFrmMain.Negative(var Bmp:TBitmap);
var
 i, j: Integer;
 PRGB: pRGBTriple;
begin
 Bmp.PixelFormat:=pf24Bit;
 for i := 0 to Bmp.Height - 1 do
 begin
  PRGB := Bmp.ScanLine[i];
  for j := 0 to Bmp.Width - 1 do
  begin
   PRGB^.rgbtRed :=not PRGB^.rgbtRed ;
   PRGB^.rgbtGreen :=not PRGB^.rgbtGreen;
   PRGB^.rgbtBlue :=not PRGB^.rgbtBlue;
   Inc(PRGB);
  end;
 end;
end;

以上只做大家的参考   

写的不好  别喷我啊

首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Delphi 取得 iOS 辅助使用里的字.. 下一篇进货单条码打印

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目