Face Distance Area Permille Tolerance
This commit is contained in:
@ -203,6 +203,41 @@ public class UnitTestCalculations
|
||||
_ = new Location(bottom, confidence, height, left, Shared.Models.Stateless.ILocation.Digits, Shared.Models.Stateless.ILocation.Factor, right, top, width, 1);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestAreaPermille()
|
||||
{
|
||||
Location location;
|
||||
double confidence = 0.1D;
|
||||
int areaPermille, left, top, right, bottom, width, height;
|
||||
left = 0;
|
||||
right = 100;
|
||||
top = 0;
|
||||
bottom = 100;
|
||||
width = 100;
|
||||
height = 100;
|
||||
areaPermille = IMapping.GetAreaPermille(bottom, height, left, right, top, width);
|
||||
Assert.IsTrue(areaPermille == 1000);
|
||||
left = 0;
|
||||
right = 50;
|
||||
top = 0;
|
||||
bottom = 50;
|
||||
width = 100;
|
||||
height = 100;
|
||||
location = new(bottom, confidence, height, left, Shared.Models.Stateless.ILocation.Digits, Shared.Models.Stateless.ILocation.Factor, right, top, width, 1);
|
||||
areaPermille = IMapping.GetAreaPermille(height, location, width);
|
||||
Assert.IsTrue(areaPermille == 250);
|
||||
left = 0;
|
||||
right = 25;
|
||||
top = 0;
|
||||
bottom = 25;
|
||||
width = 100;
|
||||
height = 100;
|
||||
location = new(bottom, confidence, height, left, Shared.Models.Stateless.ILocation.Digits, Shared.Models.Stateless.ILocation.Factor, right, top, width, 1);
|
||||
OutputResolution outputResolution = new(height, 0, width);
|
||||
areaPermille = IMapping.GetAreaPermille(location, outputResolution);
|
||||
Assert.IsTrue(areaPermille == 62);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestGetPixelPercentageA()
|
||||
{
|
||||
|
Reference in New Issue
Block a user