Improved the old way of manually selecting windows, Added all the windows types and implemented them, You can now export to a bad json file

This commit is contained in:
2023-04-03 12:38:47 +02:00
parent 5ec9656b03
commit 5ca6d61a69
16 changed files with 369 additions and 13 deletions
+4 -3
View File
@@ -16,6 +16,7 @@ namespace OCR_tester
public MainZone(Image fullImage, Rectangle bounds) : base(fullImage, bounds)
{
AutoCalibrate();
Name = "Main";
}
public void AutoCalibrate()
{
@@ -69,7 +70,7 @@ namespace OCR_tester
Point windowLocation = new Point(0, (Rectangle.Y + Rectangle.Height / 2) - windowSize.Height / 2);
windowRectangle = new Rectangle(windowLocation, windowSize);
Zones.Add(new Zone(ZoneImage, windowRectangle));
Zones.Add(new DriverZone(ZoneImage, windowRectangle));
}
}
public override Bitmap Draw()
@@ -92,8 +93,8 @@ namespace OCR_tester
int count2 = 0;
foreach (Window w in z.Windows)
{
g.DrawRectangle(Pens.Blue,w.Bounds);
w.WindowImage.Save(dir+"data"+count2+".png");
g.DrawRectangle(Pens.Blue,new Rectangle(w.Bounds.X,w.Bounds.Y + count * z.Bounds.Height,w.Bounds.Width,w.Bounds.Height));
w.WindowImage.Save(dir+w.Name+".png");
count2++;
}
count++;