Tested first run

This commit is contained in:
2022-08-29 19:30:36 -07:00
parent 659e0e39bf
commit 753eeaba2a
26 changed files with 711 additions and 458 deletions

View File

@ -39,6 +39,24 @@ public class Location : Properties.ILocation, IEquatable<Location>
this(bottom, confidence, left, GetNormalizedPixelPercentage(bottom, height, left, right, top, width, zCount), right, top) =>
Check(_Bottom, height, _Left, _NormalizedPixelPercentage, _Right, _Top, width, zCount);
public Location(double confidence, int factor, int height, Location location, int width, int zCount)
{
int x = (location.Right - location.Left) / factor;
int y = (location.Bottom - location.Top) / factor;
int bottom = Math.Min(location.Bottom + y, height);
int left = Math.Max(location.Left - x, 0);
int right = Math.Min(location.Right + x, width);
int top = Math.Max(location.Top - y, 0);
int normalizedPixelPercentage = GetNormalizedPixelPercentage(location.Bottom, height, location.Left, location.Right, location.Top, width, zCount);
Check(bottom, left, _NormalizedPixelPercentage, right, top, zCount);
_Confidence = confidence;
_Bottom = bottom;
_Left = left;
_NormalizedPixelPercentage = normalizedPixelPercentage;
_Right = right;
_Top = top;
}
public override bool Equals(object? obj) => Equals(obj as Location);
public override string ToString()