当前位置:网站首页>[OCR] aspriseocr C # English, number recognition (not Chinese)
[OCR] aspriseocr C # English, number recognition (not Chinese)
2022-06-12 14:21:00 【Ten year dream Lab】

Original picture
One 、AspriseOCR 4.0 Cracked versions

Recognition effect

x86
C# Source code
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace ToText
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
#region DllImport
[DllImport("AspriseOCR.dll", EntryPoint = "OCR", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr OCR(string file, int type);
[DllImport("AspriseOCR.dll", EntryPoint = "OCRpart", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr OCRpart(string file, int type, int startX, int startY, int width, int height);
[DllImport("AspriseOCR.dll", EntryPoint = "OCRBarCodes", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr OCRBarCodes(string file, int type);
[DllImport("AspriseOCR.dll", EntryPoint = "OCRpartBarCodes", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr OCRpartBarCodes(string file, int type, int startX, int startY, int width, int height);
#endregion
#region Transition button event
// Transition button event
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; // Picture path
if (String.IsNullOrEmpty(img_path)) // Image non empty verification
{
MessageBox.Show(" Please select the picture first !");
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 Browse Events
// Browse Events
private void btn_imgpath_Click(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
txt_imgpath.Text = openFileDialog1.FileName;
}
// Browse the pictures
private void txt_imgpath_Click(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
txt_imgpath.Text = openFileDialog1.FileName;
}
#endregion
}
}
Two 、AspriseOCR 15.3



Recognition effect (x64)
Source code :
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using asprise_ocr_api;
namespace ToText
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
#region DllImport
[DllImport("AspriseOCR.dll", EntryPoint = "OCR", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr OCR(string file, int type);
[DllImport("AspriseOCR.dll", EntryPoint = "OCRpart", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr OCRpart(string file, int type, int startX, int startY, int width, int height);
[DllImport("AspriseOCR.dll", EntryPoint = "OCRBarCodes", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr OCRBarCodes(string file, int type);
[DllImport("AspriseOCR.dll", EntryPoint = "OCRpartBarCodes", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr OCRpartBarCodes(string file, int type, int startX, int startY, int width, int height);
#endregion
#region Transition button event
// Transition button event
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; // Picture path
if (String.IsNullOrEmpty(img_path)) // Image non empty verification
{
MessageBox.Show(" Please select the picture first !");
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));
AspriseOCR.SetUp();
AspriseOCR ocr = new AspriseOCR();
ocr.StartEngine("eng", AspriseOCR.SPEED_FASTEST);
string s = ocr.Recognize(img_path, -1, -1, -1, -1, -1, AspriseOCR.RECOGNIZE_TYPE_ALL, AspriseOCR.OUTPUT_FORMAT_PLAINTEXT);
ocr.StopEngine();
txt_result.Text = s;
}
#endregion
#region Browse Events
// Browse Events
private void btn_imgpath_Click(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
txt_imgpath.Text = openFileDialog1.FileName;
}
// Browse the pictures
private void txt_imgpath_Click(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
txt_imgpath.Text = openFileDialog1.FileName;
}
#endregion
}
}
Reference resources :
LanTenggit/orc: orc Image recognition (MODI) (github.com)
https://github.com/LanTenggit/orc
边栏推荐
- SystemC learning materials
- Introduction to QT reflection mechanism and signal slot mechanism
- Des File Encryptor based on MFC framework
- SystemC:SC_ Thread and SC_ METHOD
- Brush one question every day /537 Complex multiplication
- 浅谈中国程序员为什么要跳槽?
- Tlm/systemc: TLM socket binding problem
- chrome://tracing Performance analysis artifact
- The difference between parameter and argument in C language
- G++ error in compiling Win32 program: undefined reference to '__ imp_ GetStockObject‘
猜你喜欢

Printing colored messages on the console with printf

Leetcode 2185. 统计包含给定前缀的字符串

En langage C, la fonction principale appelle une autre fonction et assemble le Code pour comprendre

Conversion of player's actual 10 pixel format and size

动态搜索广告智能查找匹配关键字

QT realize picture dragging

TestEngine with ID ‘junit-vintage‘ failed to discover tests

Player actual combat 22 to solve the problems of flower screen and Caton

Copy word content to excel and automatically divide it into multiple columns

注重点击,追求更多用户进入网站,可以选择什么出价策略?
随机推荐
Codeforces Round #798 (Div. 2)(A~D)
280 weeks /2171 Take out the least number of magic beans
QT realize picture dragging
华为设备配置BGP AS号替换
How to package QT program learning records with inno setup
Dynamic search advertising intelligent search for matching keywords
Player actual combat 25 unpacking module add close
Player practice 20 audio thread and video thread
Axi4 increase burst / wrap burst/ fix burst and narrow transfer
Redis data deletion policy in 2022
Chapter IV expression
Analysis of two-dimensional array passing as function parameter (C language)
Mold and remainder
Introduction to functions (inline functions and function overloading)
Des File Encryptor based on MFC framework
Reverse the encryption parameters of a hot water software
Communication flow analysis
Analysis of lua source code
To SystemC Beginners: the first program
Sizeof calculation space size summary