The mainZone can now calibrate itself and create its own 20 windows without any user input
This commit is contained in:
+7
-7
@@ -9,11 +9,11 @@ namespace OCR_tester
|
||||
{
|
||||
public class Zone
|
||||
{
|
||||
private Bitmap FullImage;
|
||||
private List<Zone> Zones;
|
||||
private List<Window> Windows;
|
||||
protected Bitmap FullImage;
|
||||
protected List<Zone> Zones;
|
||||
protected List<Window> Windows;
|
||||
|
||||
private Rectangle _bounds;
|
||||
protected Rectangle _bounds;
|
||||
public Rectangle Bounds { get => _bounds; private set => _bounds = value; }
|
||||
|
||||
public Bitmap ZoneImage
|
||||
@@ -43,12 +43,12 @@ namespace OCR_tester
|
||||
Zones = new List<Zone>();
|
||||
Windows = new List<Window>();
|
||||
}
|
||||
public void AddZone(Rectangle bounds)
|
||||
private void AddZone(Rectangle bounds)
|
||||
{
|
||||
if(Fits(bounds))
|
||||
Zones.Add(new Zone(ZoneImage,bounds));
|
||||
}
|
||||
public void AddWindow(Rectangle bounds)
|
||||
private void AddWindow(Rectangle bounds)
|
||||
{
|
||||
if (Fits(bounds))
|
||||
Windows.Add(new Window(ZoneImage,bounds));
|
||||
@@ -58,7 +58,7 @@ namespace OCR_tester
|
||||
/// </summary>
|
||||
/// <param name="InputRectangle">The Rectangle you want to check the fittment</param>
|
||||
/// <returns></returns>
|
||||
private bool Fits(Rectangle inputRectangle)
|
||||
protected bool Fits(Rectangle inputRectangle)
|
||||
{
|
||||
if (inputRectangle.X + inputRectangle.Width > Bounds.Width || inputRectangle.Y + inputRectangle.Height > Bounds.Height || inputRectangle.X < 0 || inputRectangle.Y < 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user