实例介绍
【实例截图】
【核心代码】
#region 转换按钮事件
// 转换按钮事件
private void button2_Click(object sender, EventArgs e)
{
int startX = 0;
int startY = 0;
int width = -1;
int height = -1;
string img_path = txt_imgpath.Text; // 图片路径
if (String.IsNullOrEmpty(img_path)) // 图片非空验证
{
MessageBox.Show("请先选择图片!");
return;
}
try
{
Image img = Image.FromFile(img_path);
width = img.Width;
height = img.Height;
}
catch (Exception ex)
{
MessageBox.Show(ex.StackTrace);
}
txt_result.Text = Marshal.PtrToStringAnsi(OCRpart(img_path, -1, startX, startY, width, height));
}
#endregion
#region 浏览事件
// 浏览事件
private void btn_imgpath_Click(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
txt_imgpath.Text = openFileDialog1.FileName;
}
// 浏览图片
private void txt_imgpath_Click(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
txt_imgpath.Text = openFileDialog1.FileName;
}
#endregion
【源码目录】
FaceRecognition
├── FaceRecognition
│ ├── FaceRecognition.csproj
│ ├── FrmMain.Designer.cs
│ ├── FrmMain.cs
│ ├── FrmMain.resx
│ ├── Program.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ ├── bin
│ │ ├── Debug
│ │ │ ├── FaceRecognition.exe
│ │ │ ├── FaceRecognition.pdb
│ │ │ ├── FaceRecognition.vshost.exe
│ │ │ ├── FaceRecognition.vshost.exe.manifest
│ │ │ ├── SunLightData.dll
│ │ │ ├── SunLightFace.dll
│ │ │ └── zData
│ │ │ ├── NULL_TempLate.dat
│ │ │ ├── Stand_template_big_face.DAT
│ │ │ ├── Stand_template_face.DAT
│ │ │ ├── TempLate.dat
│ │ │ ├── bptr_1.dat
│ │ │ ├── bptr_10.dat
│ │ │ ├── bptr_11.dat
│ │ │ ├── bptr_12.dat
│ │ │ ├── bptr_13.dat
│ │ │ ├── bptr_14.dat
│ │ │ ├── bptr_15.dat
│ │ │ ├── bptr_16.dat
│ │ │ ├── bptr_17.dat
│ │ │ ├── bptr_18.dat
│ │ │ ├── bptr_19.dat
│ │ │ ├── bptr_2.dat
│ │ │ ├── bptr_20.dat
│ │ │ ├── bptr_21.dat
│ │ │ ├── bptr_22.dat
│ │ │ ├── bptr_23.dat
│ │ │ ├── bptr_24.dat
│ │ │ ├── bptr_25.dat
│ │ │ ├── bptr_26.dat
│ │ │ ├── bptr_27.dat
│ │ │ ├── bptr_28.dat
│ │ │ ├── bptr_29.dat
│ │ │ ├── bptr_3.dat
│ │ │ ├── bptr_30.dat
│ │ │ ├── bptr_31.dat
│ │ │ ├── bptr_32.dat
│ │ │ ├── bptr_33.dat
│ │ │ ├── bptr_34.dat
│ │ │ ├── bptr_35.dat
│ │ │ ├── bptr_36.dat
│ │ │ ├── bptr_37.dat
│ │ │ ├── bptr_38.dat
│ │ │ ├── bptr_39.dat
│ │ │ ├── bptr_4.dat
│ │ │ ├── bptr_40.dat
│ │ │ ├── bptr_41.dat
│ │ │ ├── bptr_42.dat
│ │ │ ├── bptr_43.dat
│ │ │ ├── bptr_44.dat
│ │ │ ├── bptr_45.dat
│ │ │ ├── bptr_46.dat
│ │ │ ├── bptr_47.dat
│ │ │ ├── bptr_48.dat
│ │ │ ├── bptr_49.dat
│ │ │ ├── bptr_5.dat
│ │ │ ├── bptr_50.dat
│ │ │ ├── bptr_51.dat
│ │ │ ├── bptr_52.dat
│ │ │ ├── bptr_53.dat
│ │ │ ├── bptr_54.dat
│ │ │ ├── bptr_55.dat
│ │ │ ├── bptr_56.dat
│ │ │ ├── bptr_57.dat
│ │ │ ├── bptr_58.dat
│ │ │ ├── bptr_59.dat
│ │ │ ├── bptr_6.dat
│ │ │ ├── bptr_60.dat
│ │ │ ├── bptr_61.dat
│ │ │ ├── bptr_62.dat
│ │ │ ├── bptr_63.dat
│ │ │ ├── bptr_64.dat
│ │ │ ├── bptr_65.dat
│ │ │ ├── bptr_66.dat
│ │ │ ├── bptr_67.dat
│ │ │ ├── bptr_68.dat
│ │ │ ├── bptr_69.dat
│ │ │ ├── bptr_7.dat
│ │ │ ├── bptr_70.dat
│ │ │ ├── bptr_71.dat
│ │ │ ├── bptr_72.dat
│ │ │ ├── bptr_73.dat
│ │ │ ├── bptr_74.dat
│ │ │ ├── bptr_75.dat
│ │ │ ├── bptr_76.dat
│ │ │ ├── bptr_77.dat
│ │ │ ├── bptr_78.dat
│ │ │ ├── bptr_79.dat
│ │ │ ├── bptr_8.dat
│ │ │ ├── bptr_80.dat
│ │ │ ├── bptr_81.dat
│ │ │ ├── bptr_82.dat
│ │ │ ├── bptr_83.dat
│ │ │ ├── bptr_84.dat
│ │ │ ├── bptr_85.dat
│ │ │ ├── bptr_86.dat
│ │ │ ├── bptr_87.dat
│ │ │ └── bptr_9.dat
│ │ └── Release
│ └── obj
│ └── Debug
│ ├── DesignTimeResolveAssemblyReferences.cache
│ ├── DesignTimeResolveAssemblyReferencesInput.cache
│ ├── FaceRecognition.FrmMain.resources
│ ├── FaceRecognition.Properties.Resources.resources
│ ├── FaceRecognition.csproj.FileListAbsolute.txt
│ ├── FaceRecognition.csproj.GenerateResource.Cache
│ ├── FaceRecognition.csprojAssemblyReference.cache
│ ├── FaceRecognition.csprojResolveAssemblyReference.cache
│ ├── FaceRecognition.exe
│ ├── FaceRecognition.pdb
│ └── TempPE
├── FaceRecognition.sln
├── FaceRecognition.suo
└── FaceRecognition.v12.suo
9 directories, 120 files
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论