Letters are not recognized way better

This commit is contained in:
2023-04-10 09:37:19 +02:00
parent ea3ca8cd28
commit 6c46347dad
2 changed files with 4 additions and 25 deletions
+3 -3
View File
@@ -90,7 +90,7 @@ namespace OCR_Decode
Color limitColor = Color.FromArgb(0x50,0x50,0x50); Color limitColor = Color.FromArgb(0x50,0x50,0x50);
Color currentColor = Color.FromArgb(0,0,0); Color currentColor = Color.FromArgb(0,0,0);
Size newWindowSize = new Size(bmp.Height -Convert.ToInt32((float)bmp.Height / 100f * 40f),bmp.Height - Convert.ToInt32((float)bmp.Height / 100f * 50f)); Size newWindowSize = new Size(bmp.Height -Convert.ToInt32((float)bmp.Height / 100f * 25f),bmp.Height - Convert.ToInt32((float)bmp.Height / 100f * 35f));
while(currentColor.R <= limitColor.R && currentColor.G <= limitColor.G && currentColor.B <= limitColor.B && currentPosition > 0) while(currentColor.R <= limitColor.R && currentColor.G <= limitColor.G && currentColor.B <= limitColor.B && currentPosition > 0)
{ {
@@ -99,8 +99,8 @@ namespace OCR_Decode
} }
//Its here to let the new window include a little bit of the right //Its here to let the new window include a little bit of the right
int CorrectedX = currentPosition - (newWindowSize.Width) - Convert.ToInt32((float)newWindowSize.Width/100f*10f); int CorrectedX = currentPosition - (newWindowSize.Width) + Convert.ToInt32((float)newWindowSize.Width/100f*10f);
int CorrectedY = Convert.ToInt32((float)newWindowSize.Height / 100f * 50f); int CorrectedY = Convert.ToInt32((float)newWindowSize.Height / 100f * 35f);
if (CorrectedX <= 0) if (CorrectedX <= 0)
return new Rectangle(0,0,newWindowSize.Width,newWindowSize.Height); return new Rectangle(0,0,newWindowSize.Width,newWindowSize.Height);
+1 -22
View File
@@ -48,32 +48,12 @@ namespace OCR_Decode
result = Dilatation(result, 1); result = Dilatation(result, 1);
break; break;
case WindowType.Tyre: case WindowType.Tyre:
//result = RemoveBG(result);
result = RemoveUseless(result); result = RemoveUseless(result);
result = Resize(result); result = Resize(result);
result = Resize(result); result = Resize(result);
result = Resize(result); result = Resize(result);
result = Dilatation(result, 1); result = Dilatation(result, 1);
//result = Grayscale(result);
//result = Tresholding(result,80);
//result = InvertColors(result);
//result = Resize(result);
//result = Dilatation(result, 1);
//result = Resize(result);
//result = Dilatation(result,1);
//result = Erode(result,1);
//result = Resize(result);
//result = Dilatation(result, 1);
//result = Dilatation(result, 1);
//result = InvertColors(result);
//result = Resize(result);
//result = Resize(result);
//result = Dilatation(result,1);
break; break;
default: default:
result = Tresholding(result, 165); result = Tresholding(result, 165);
@@ -82,7 +62,6 @@ namespace OCR_Decode
result = Erode(result, 1); result = Erode(result, 1);
break; break;
} }
//result = Dilatation(result, 1); //result = Dilatation(result, 1);
return result; return result;
} }