分辨图片内的文字(提供一些资料或有偿支持)

识别图片内的文字(提供一些资料或有偿支持)


图片上如,图片是A4单据的扫描件,扫描的时候有的会倾斜一点,识别图片的发货单号


请各位大牛提供一点学习资料或开发(可以提供点费用)

------解决方案--------------------
这种的很好处理。没有粘连、变形、干扰,简单二值化、滤波即可,调整一下倾斜,可以做到100%识别
------解决方案--------------------
图片不算太清楚,可能对算法要求比较高。1楼的见到图还能说“没有粘连、变形、干扰,”太佩服了。
------解决方案--------------------
图像处理算法。。。有得楼主学了

而且楼主的图片不是很清楚,100%识别困难
------解决方案--------------------
找的例子 你看看


Delphi(Pascal) code



unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, ExtDlgs, ComCtrls, ShellAPI, GIFImage, JPEG;

type //字符特征码
  RChar = record
    MyChar: char;
    MyCharInfo: array[0..49, 0..49] of byte;
  end;

type //字符特征文件
  RCharInfo = record
    Sng: integer; //文件类型标识
    Ver: real; //版本号
    charwidth: byte; //字符宽度
    charheight: byte; //字符高度
    X0: byte; //第一个字符开始x偏移
    TotalChars: byte; //图象字符总数
    allcharinfo: array[0..9] of RChar;
  end;
type
  TForm1 = class(TForm)
    Image1: TImage;
    Button1: TButton;
    Edit1: TEdit;
    Edit2: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Button2: TButton;
    Image2: TImage;
    Edit3: TEdit;
    Edit4: TEdit;
    Image3: TImage;
    Edit5: TEdit;
    Edit6: TEdit;
    Image4: TImage;
    Edit7: TEdit;
    Edit8: TEdit;
    Image5: TImage;
    Edit9: TEdit;
    Edit10: TEdit;
    Image6: TImage;
    Edit11: TEdit;
    Edit12: TEdit;
    Image7: TImage;
    Edit13: TEdit;
    Edit14: TEdit;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Image8: TImage;
    Edit15: TEdit;
    Edit16: TEdit;
    Image9: TImage;
    Edit17: TEdit;
    Edit18: TEdit;
    Image10: TImage;
    Edit19: TEdit;
    Edit20: TEdit;
    Image11: TImage;
    Edit21: TEdit;
    Edit22: TEdit;
    Image12: TImage;
    Edit23: TEdit;
    Edit24: TEdit;
    Image13: TImage;
    Edit25: TEdit;
    Edit26: TEdit;
    Label7: TLabel;
    Label8: TLabel;
    Label9: TLabel;
    Image14: TImage;
    Edit27: TEdit;
    Edit28: TEdit;
    Image15: TImage;
    Edit29: TEdit;
    Edit30: TEdit;
    Image16: TImage;
    Edit31: TEdit;
    Edit32: TEdit;
    Image17: TImage;
    Edit33: TEdit;
    Edit34: TEdit;
    Image18: TImage;
    Edit35: TEdit;
    Edit36: TEdit;
    Button3: TButton;
    Button4: TButton;
    Edit37: TEdit;
    Image19: TImage;
    Label10: TLabel;
    Label11: TLabel;
    Button5: TButton;
    Image20: TImage;
    SaveDialog1: TSaveDialog;
    OpenDialog1: TOpenDialog;
    Button6: TButton;
    ProgressBar1: TProgressBar;
    GroupBox1: TGroupBox;
    RadioButton1: TRadioButton;
    RadioButton2: TRadioButton;
    Label12: TLabel;
    Label13: TLabel;
    Edit38: TEdit;
    Edit39: TEdit;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button6Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
  private
    { Private declarations }
    MyCharInfo: RCharInfo;
    pic: array[0..17] of Timage;
    exepath: string;
    procedure ModiFyInfo(MyCanvas: TCanvas; MyChar: char; X0,
      CharWidth, CharHeight: integer);
    procedure ShowAllCharInfo;
    procedure GetCharInfoFromImage(MyCanvas: TCanvas; CharInfo: string);
    function GetStringFromImage(SBMP: TBITMAP): string;
    function CMPBMP(SBMP: TBITMAP; x0, m: integer): integer;
    procedure InteCharInfo(Charwidth, X0: integer);
    function Makehtm(CharWidth, X0: string): string;
    procedure GetCharInfoFromALLImage;
    function PIC2BMP(filename: string): TBITMAP;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
//根据不同情况初始化特征码信息

procedure TForm1.InteCharInfo(Charwidth, X0: integer);
begin
  Fillchar(MycharInfo, sizeof(RcharInfo), 1);
  MycharInfo.Sng := 751115327;
  MycharInfo.Ver := 1.1;
  MycharInfo.TotalChars := length(edit1.text);
  MycharInfo.charwidth := charwidth;
  MycharInfo.charheight := image1.Picture.Bitmap.Height;
  MycharInfo.X0 := X0;
end;
//

procedure TForm1.FormCreate(Sender: TObject);
begin
  exepath := ExtractFilePath(Application.ExeName);
  InteCharInfo(9, 1);
  Pic[0] := image1;
  Pic[1] := image2;
  Pic[2] := image3;
  Pic[3] := image4;
  Pic[4] := image5;
  Pic[5] := image6;
  Pic[6] := image7;
  Pic[7] := image8;
  Pic[8] := image9;
  Pic[9] := image10;
  Pic[10] := image11;
  Pic[11] := image12;
  Pic[12] := image13;
  Pic[13] := image14;
  Pic[14] := image15;
  Pic[15] := image16;
  Pic[16] := image17;
  Pic[17] := image18;
end;
//修正指定字符特征码

procedure TForm1.ModiFyInfo(MyCanvas: TCanvas; MyChar: char; X0, CharWidth, CharHeight: integer);
var
  i, j: integer;
begin
  for i := 0 to CharWidth do
    for j := 0 to CharHeight do
      if MyCanvas.Pixels[X0 + i, j] > 0 then
      begin
        MyCharInfo.allcharinfo[strtoint(Mychar)].MyChar := Mychar;
        MyCharInfo.allcharinfo[strtoint(Mychar)].MyCharInfo[i, j] := 0;
      end;
end;
//根据学习后的字符特征码显示所有字符

procedure TForm1.ShowAllCharInfo;
var
  BMP: TBITMAP;
  i, j, k: integer;
begin
  BMP := TBITMAP.Create;
  BMP.Width := (MyCharInfo.charwidth + 5) * 10 - 5;
  BMP.Height := MyCharInfo.charheight;
  BMP.Canvas.Brush.Color := clMoneygreen;
  BMP.Canvas.FloodFill(1, 1, clblack, fsBorder);
  for k := 0 to 9 do
    for i := 0 to MyCharInfo.charwidth do
      for j := 0 to MyCharInfo.charheight do
        if MyCharInfo.allcharinfo[K].MyCharInfo[i, j] > 0 then
          BMP.Canvas.Pixels[i + k * (MyCharInfo.charwidth + 5), j] := clblack;
  Image20.Picture.Bitmap.Assign(BMP);
  BMP.Free;
end;