public void TestCreateDistanceNodeList() { ReadOnlyCollection <Point> staticPoints = new List <Point> { new Point(new Vector3(8.10e-01f, 6.30e-01f, 9.60e-01f)), new Point(new Vector3(9.10e-01f, 1.00e-01f, 9.60e-01f)), new Point(new Vector3(1.30e-01f, 2.80e-01f, 1.60e-01f)), new Point(new Vector3(9.10e-01f, 5.50e-01f, 9.70e-01f)), }.AsReadOnly(); ReadOnlyCollection <Point> modelPoints = new List <Point> { new Point(new Vector3(9.60e-01f, 8.00e-01f, 4.20e-01f)), new Point(new Vector3(4.90e-01f, 1.40e-01f, 9.20e-01f)), }.AsReadOnly(); List <DistanceNode> actual = new NearstPointCorrespondenceFinder(new AllPointsSampler(configuration)).CreateDistanceNodeList(staticPoints, modelPoints); List <DistanceNode> expected = new List <DistanceNode> { new DistanceNode(staticPoints[1], modelPoints[1], 1.7960e-01f), new DistanceNode(staticPoints[0], modelPoints[0], 3.4300e-01f), new DistanceNode(staticPoints[0], modelPoints[1], 3.4410e-01f), new DistanceNode(staticPoints[3], modelPoints[1], 3.4700e-01f), new DistanceNode(staticPoints[3], modelPoints[0], 3.6750e-01f), new DistanceNode(staticPoints[2], modelPoints[1], 7.2680e-01f), new DistanceNode(staticPoints[1], modelPoints[0], 7.8410e-01f), new DistanceNode(staticPoints[2], modelPoints[0], 1.0269e+00f), }; Assert.That(actual, Is.EquivalentTo(expected)); }
public void TestFindCorrespondencesStaticSmallerThanModel() { ReadOnlyCollection <Point> staticPoints = pyramid.AsReadOnly(); ReadOnlyCollection <Point> modelPoints = cubeRight.AsReadOnly(); List <Correspondence> expected = new List <Correspondence> { new Correspondence( pyramid[4], cubeRight[7] ), new Correspondence( pyramid[0], cubeRight[2] ), new Correspondence( pyramid[3], cubeRight[6] ), new Correspondence( pyramid[1], cubeRight[3] ), new Correspondence( pyramid[2], cubeRight[5] ) }; CorrespondenceCollection actual = new NearstPointCorrespondenceFinder(new AllPointsSampler(configuration)).Find(staticPoints, modelPoints); Assert.That(actual, Is.EquivalentTo(expected)); }
public void TestFindCorrespondencesStaticEqualsModel() { ReadOnlyCollection <Point> staticPoints = cubeLeft.AsReadOnly(); ReadOnlyCollection <Point> modelPoints = cubeLeft.AsReadOnly(); CorrespondenceCollection expected = new CorrespondenceCollection( new List <Correspondence> { new Correspondence( cubeLeft[0], cubeLeft[0] ), new Correspondence( cubeLeft[1], cubeLeft[1] ), new Correspondence( cubeLeft[2], cubeLeft[2] ), new Correspondence( cubeLeft[3], cubeLeft[3] ), new Correspondence( cubeLeft[4], cubeLeft[4] ), new Correspondence( cubeLeft[5], cubeLeft[5] ), new Correspondence( cubeLeft[6], cubeLeft[6] ), new Correspondence( cubeLeft[7], cubeLeft[7] ) } ); CorrespondenceCollection actual = new NearstPointCorrespondenceFinder(new AllPointsSampler(configuration)).Find(staticPoints, modelPoints); Assert.That(actual, Is.EquivalentTo(expected)); }