EDPF.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #pragma once
  2. #pragma once
  3. /**************************************************************************************************************
  4. * Edge Drawing (ED) and Edge Drawing Parameter Free (EDPF) source codes.
  5. * Copyright (C) Cuneyt Akinlar & Cihan Topal
  6. * E-mails of the authors: cuneytakinlar@gmail.com, cihantopal@gmail.com
  7. *
  8. * Please cite the following papers if you use EDPF library:
  9. *
  10. * [1] C. Topal and C. Akinlar, ¡°Edge Drawing: A Combined Real-Time Edge and Segment Detector,¡±
  11. * Journal of Visual Communication and Image Representation, 23(6), 862-872, DOI: 10.1016/j.jvcir.2012.05.004 (2012).
  12. *
  13. * [2] C. Akinlar and C. Topal, ¡°EDPF: A Real-time Parameter-free Edge Segment Detector with a False Detection Control,¡±
  14. * International Journal of Pattern Recognition and Artificial Intelligence, 26(1), DOI: 10.1142/S0218001412550026 (2012).
  15. **************************************************************************************************************/
  16. #ifndef _EDPF_
  17. #define _EDPF_
  18. #include "ED.h"
  19. #define MAX_GRAD_VALUE 128*256
  20. #define EPSILON 1.0
  21. class EDPF : public ED {
  22. public:
  23. EDPF(cv::Mat srcImage);
  24. EDPF(ED obj);
  25. private:
  26. double divForTestSegment;
  27. double* H;
  28. int np;
  29. short* gradImg;
  30. void validateEdgeSegments();
  31. short* ComputePrewitt3x3(); // differs from base class's prewit function (calculates H)
  32. void TestSegment(int i, int index1, int index2);
  33. void ExtractNewSegments();
  34. double NFA(double prob, int len);
  35. };
  36. #endif // ! _EDPF_