Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
nenoNaninu committed May 20, 2021
1 parent e902a6b commit 0065fa5
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions HomographySharpTest/UnitTest1.cs
Expand Up @@ -256,5 +256,30 @@ public void Copy2()
Assert.IsTrue(Math.Abs(homo.Elements[i] - homo2.Elements[i]) < 0.001);
}
}

[Test]
public void Copy3()
{
var srcList = new List<Point2<double>>(4);
var dstList = new List<Point2<double>>(4);

srcList.Add(new Point2<double>(-152, 394));
srcList.Add(new Point2<double>(218, 521));
srcList.Add(new Point2<double>(223, -331));
srcList.Add(new Point2<double>(-163, -219));
dstList.Add(new Point2<double>(-666, 431));
dstList.Add(new Point2<double>(500, 300));
dstList.Add(new Point2<double>(480, -308));
dstList.Add(new Point2<double>(-580, -280));

var homo = Homography.Find(srcList, dstList);

var homo2 = Homography.Create(homo.Elements);

for (int i = 0; i < homo.Elements.Count; i++)
{
Assert.IsTrue(Math.Abs(homo.Elements[i] - homo2.Elements[i]) < 0.001);
}
}
}
}

0 comments on commit 0065fa5

Please sign in to comment.