You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.0 KiB

8 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef BLOB_PROPERTIES_H_INCLUDED
  2. #define BLOB_PROPERTIES_H_INCLUDED
  3. //! Max order of calculated moments
  4. #define MAX_MOMENTS_ORDER 3
  5. #include "BlobContour.h"
  6. //namespace CBlob;
  7. typedef std::list<CBlobContour> t_contourList;
  8. class CBlobProperties {
  9. private:
  10. //! Computed area from blob
  11. float m_area;
  12. //! Computed perimeter from blob
  13. float m_perimeter;
  14. // Computed moment from the blob
  15. float m_moment[MAX_MOMENTS_ORDER*MAX_MOMENTS_ORDER];
  16. protected:
  17. //! External contour of the blob (crack codes)
  18. CBlobContour m_externalContour;
  19. //! Internal contours (crack codes)
  20. t_contourList m_internalContours;
  21. public:
  22. CBlobProperties(){};
  23. virtual ~CBlobProperties(){};
  24. //! Get blob area
  25. float GetArea();
  26. //! Get blob perimeter
  27. float GetPerimeter();
  28. //! Get contour moment (p,q up to MAX_CALCULATED_MOMENTS)
  29. float GetMoment(int p, int q);
  30. };
  31. #endif //!BLOB_PROPERTIES_H_INCLUDED