Added diagnostic tools
This commit is contained in:
+22
-2
@@ -7,6 +7,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace OCR_Decode
|
namespace OCR_Decode
|
||||||
{
|
{
|
||||||
@@ -17,6 +18,8 @@ namespace OCR_Decode
|
|||||||
const string TEMPORARY_IMAGE_FOLDER = @"C:\Users\Moi\Pictures\SeleniumScreens\DataSetHighRes\";
|
const string TEMPORARY_IMAGE_FOLDER = @"C:\Users\Moi\Pictures\SeleniumScreens\DataSetHighRes\";
|
||||||
int pageNmbr = 82;
|
int pageNmbr = 82;
|
||||||
Reader Reader;
|
Reader Reader;
|
||||||
|
Stopwatch stopWatch = new Stopwatch();
|
||||||
|
int LoadMS = 0;
|
||||||
public Form1()
|
public Form1()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@@ -24,17 +27,34 @@ namespace OCR_Decode
|
|||||||
|
|
||||||
private void Form1_Load(object sender, EventArgs e)
|
private void Form1_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
stopWatch.Start();
|
||||||
Reader = new Reader(CONFIG_FILE,TEMPORARY_IMAGE_FOLDER);
|
Reader = new Reader(CONFIG_FILE,TEMPORARY_IMAGE_FOLDER);
|
||||||
|
stopWatch.Stop();
|
||||||
|
LoadMS = (int)stopWatch.ElapsedMilliseconds;
|
||||||
|
|
||||||
RefreshUi();
|
RefreshUi();
|
||||||
}
|
}
|
||||||
private void RefreshUi()
|
private void RefreshUi()
|
||||||
{
|
{
|
||||||
|
|
||||||
tbxResult.Text = "";
|
tbxResult.Text = "";
|
||||||
|
stopWatch.Restart();
|
||||||
pbxImage.Image = Reader.Draw(pageNmbr);
|
pbxImage.Image = Reader.Draw(pageNmbr);
|
||||||
|
stopWatch.Stop();
|
||||||
|
|
||||||
|
int DrawMS = (int)stopWatch.ElapsedMilliseconds;
|
||||||
|
|
||||||
|
stopWatch.Restart();
|
||||||
tbxResult.Text = Reader.Decode(pageNmbr);
|
tbxResult.Text = Reader.Decode(pageNmbr);
|
||||||
|
stopWatch.Stop();
|
||||||
|
|
||||||
|
int OcrMS = (int)stopWatch.ElapsedMilliseconds;
|
||||||
|
MessageBox.Show(
|
||||||
|
"Loading took : " + Reader.ConvertMsToTime(LoadMS) +
|
||||||
|
" Image splitting took : " + Reader.ConvertMsToTime(DrawMS) + Environment.NewLine +
|
||||||
|
" Reading the infos from the image took : " + Reader.ConvertMsToTime(OcrMS) + Environment.NewLine
|
||||||
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnNext_Click(object sender, EventArgs e)
|
private void btnNext_Click(object sender, EventArgs e)
|
||||||
|
|||||||
Reference in New Issue
Block a user