Harris Corner Detector

Functional Guide | Reference: GetPointCount, GetPoint

//////////////////////////////////////////////////////////////////
// This code snippet shows how to retrieve corners' coordinates //
// by means of the Harris corner detector algorithm.            //
//////////////////////////////////////////////////////////////////

// Image constructor
EImageBW8 srcImage;

// ...

// Harris corner detector
EHarrisCornerDetector harris;
EHarrisInterestPoints interestPoints;
harris.SetIntegrationScale(2.f);

// Perform the corner detection
harris.Apply(srcImage, interestPoints);

// Retrieve the number of corners
unsigned int index = interestPoints.GetPointCount();

// Retrieve the first corner coordinates
EPoint point = interestPoints.GetPoint(0);
float x = point.GetX();
float y = point.GetY();
//////////////////////////////////////////////////////////////////
// This code snippet shows how to retrieve corners' coordinates //
// by means of the Harris corner detector algorithm.            //
//////////////////////////////////////////////////////////////////

// Image constructor
EImageBW8 srcImage= new EImageBW8();

// ...

// Harris corner detector
EHarrisCornerDetector harris= new EHarrisCornerDetector();
EHarrisInterestPoints interestPoints= new EHarrisInterestPoints();
harris.IntegrationScale= 2.0f;

// Perform the corner detection
harris.Apply(srcImage, interestPoints);

// Retrieve the number of corners
uint index = interestPoints.PointCount;

// Retrieve the first corner coordinates
EPoint point = interestPoints.GetPoint(0);
float x = point.X;
float y = point.Y;