Skip to content

songyuncen/EdgesSubPix

Repository files navigation

Sub-Pixel Edge Detection using OpenCV

Description

  • Edge detection operator return subpixel level edge position.
  • Using Canny filter as differential operator.
  • Implementing according to Carsten Steger's method.
  • Interpolation of second partial derivatives with Facet Model method.

API

struct Contour
{
    std::vector<cv::Point2f> points;  // edge location
    std::vector<float> direction;     // direction of the gradient in edge point, 
                                      // starting from y axis, counter-clockwise
    std::vector<float> response;      // amptitude of the gradient in edge point
};
// gray             - only support 8-bit grayscale
// hierarchy, mode  - have the same meanings as in cv::findContours
CV_EXPORTS void EdgesSubPix(cv::Mat &gray, double alpha, int low, int high,
                            std::vector<Contour> &contours, cv::OutputArray hierarchy,
                            int mode);

// mode = RETR_LIST
CV_EXPORTS void EdgesSubPix(cv::Mat &gray, double alpha, int low, int high, 
                           std::vector<Contour> &contours);

Test

Edge --data=edge.yml avatar.jpg edge.jpg

License

3-clause BSD License

About

Sub-Pixel Edge Detection Using OpenCV

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published