public void FindTest()
{
List<IntPoint> contour = new List<IntPoint>();
int max = 100;
for (int i = 0; i < max; i++)
add(contour, i, max);
for (int i = 0; i < max; i++)
add(contour, max, i);
for (int i = 0; i < max; i++)
add(contour, 0, i);
for (int i = 0; i < max / 2; i++)
add(contour, i, i);
for (int i = 0; i < max / 2; i++)
add(contour, i + max / 2, max / 2 - i);
PointsMarker marker = new PointsMarker(contour);
var bitmap = AForge.Imaging.Image.CreateGrayscaleImage(max + 1, max + 1);
bitmap = marker.Apply(bitmap);
// Accord.Controls.ImageBox.Show(bitmap);
GrahamConvexHull graham = new GrahamConvexHull();
List<IntPoint> hull = graham.FindHull(contour);
ConvexHullDefects hullDefects = new ConvexHullDefects(10);
List<ConvexityDefect> defects = hullDefects.FindDefects(contour, hull);
Assert.AreEqual(1, defects.Count);
Assert.AreEqual(99, defects[0].Depth);
}