Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
gheyret authored Mar 16, 2021
1 parent 5af6d39 commit e9d3eab
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 1 deletion.
40 changes: 40 additions & 0 deletions ocr/OCRForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 28 additions & 1 deletion ocr/OCRForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,24 @@ void OCRFormPaint(object sender, PaintEventArgs e)
else{
butAch.Enabled = !gRunning;
butTonu.Enabled = !gRunning;
chkUyghur.Enabled = !gRunning;
chkEng.Enabled = !gRunning;
chkRus.Enabled = !gRunning;
chkChi.Enabled = !gRunning;
radAuto.Enabled = !gRunning;
radSingle.Enabled = !gRunning;
}
}

async void ButtonRight(object sender, EventArgs e)
{
gRunning = true;
if(radAuto.Checked){
gOcr.DefaultPageSegMode = PageSegMode.Auto;
}
else{
gOcr.DefaultPageSegMode = PageSegMode.SingleBlock;
}
Invalidate();
Bitmap roibmp;
Pix roipix;
Expand Down Expand Up @@ -105,8 +117,13 @@ void OCRFormShown(object sender, EventArgs e)
chkEng.Text = MainForm.gLang.GetText("In’glizche");
chkChi.Text = MainForm.gLang.GetText("Xenzuche");
chkRus.Text = MainForm.gLang.GetText("Slawyanche");
radAuto.Text = MainForm.gLang.GetText("Özüng Tap");
radSingle.Text = MainForm.gLang.GetText("Birla Bölek");

chkUyghur.Checked = true;
radAuto.Checked = true;



if(gImgFile!=null){
Bitmap bimg = new Bitmap(gImgFile);
Expand Down Expand Up @@ -180,12 +197,22 @@ void CheckedChanged(object sender, EventArgs e)

if(lang.Length >=3){
gOcr= new TesseractEngine(@".\tessdata",lang,EngineMode.LstmOnly);
gOcr.DefaultPageSegMode = PageSegMode.SingleBlock;
Text = MainForm.gLang.GetText("Uyghurche OCR(Resimdiki Yéziqni Tonush) Programmisi")+ "Tessract[v " + gOcr.Version + "]" + " neshrini ishletken";
}
this.Cursor = Cursors.Default;
Invalidate();
}
void OCRFormFormClosing(object sender, FormClosingEventArgs e)
{
if(gRunning){
e.Cancel = true;
}
else{
if(gOcr!=null){
gOcr.Dispose();
}
}
}

}
}

0 comments on commit e9d3eab

Please sign in to comment.