RSGraphBased.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /**
  2. * @file RSGraphBased.h
  3. * @brief fast Segmentation Method based on Felzenszwalb2004
  4. * @author Björn Fröhlich, Alexander Freytag
  5. * @date 02/22/2010
  6. */
  7. #ifndef RSGraphBasedINCLUDE
  8. #define RSGraphBasedINCLUDE
  9. #include "core/basics/Config.h"
  10. #include "RegionSegmentationMethod.h"
  11. namespace OBJREC {
  12. class RSGraphBased: public RegionSegmentationMethod
  13. {
  14. protected:
  15. /////////////////////////
  16. /////////////////////////
  17. // PROTECTED VARIABLES //
  18. /////////////////////////
  19. /////////////////////////
  20. double parameter_k;
  21. int parameter_min_size;
  22. double parameter_sigma;
  23. public:
  24. ///////////////////// ///////////////////// /////////////////////
  25. // CONSTRUCTORS / DESTRUCTORS
  26. ///////////////////// ///////////////////// /////////////////////
  27. /** default constructor */
  28. RSGraphBased();
  29. /**
  30. * standard constructor
  31. * @param conf config file
  32. */
  33. RSGraphBased( const NICE::Config * _conf );
  34. /** simple destructor */
  35. virtual ~RSGraphBased();
  36. /**
  37. * @brief Setup internal variables and objects used
  38. * @author Alexander Freytag
  39. * @param conf Config file to specify variable settings
  40. * @param s_confSection
  41. * @date 08-02-2014 ( dd-mm-yyyy )
  42. */
  43. virtual void initFromConfig ( const NICE::Config * _conf, const std::string & _confSection = "RSGraphBased" );
  44. ///////////////////// ///////////////////// /////////////////////
  45. // SEGMENTATION STUFF
  46. ///////////////////// ///////////////////// //////////////////
  47. /**
  48. * returns the regions of a given image
  49. * @param img input image
  50. * @param mask output regions, each region has it own number
  51. * @return count of region
  52. */
  53. virtual int segRegions ( const NICE::Image & img, NICE::Matrix & mask ) const;
  54. /**
  55. * returns the regions of a given image
  56. * @param img input color image
  57. * @param mask output regions, each region has it own number
  58. * @return count of region
  59. */
  60. virtual int segRegions ( const NICE::ColorImage & img, NICE::Matrix & mask) const;
  61. ///////////////////// INTERFACE PERSISTENT /////////////////////
  62. // interface specific methods for store and restore
  63. ///////////////////// INTERFACE PERSISTENT /////////////////////
  64. /**
  65. * @brief Load object from external file (stream)
  66. * @author Alexander Freytag
  67. * @date 08-02-2014 ( dd-mm-yyyy )
  68. */
  69. void restore ( std::istream & is, int format = 0 );
  70. /**
  71. * @brief Save object to external file (stream)
  72. * @author Alexander Freytag
  73. * @date 08-02-2014 ( dd-mm-yyyy )
  74. */
  75. void store ( std::ostream & os, int format = 0 ) const;
  76. /**
  77. * @brief Clear object
  78. * @author Alexander Freytag
  79. * @date 08-02-2014 ( dd-mm-yyyy )
  80. */
  81. void clear ();
  82. };
  83. } //namespace
  84. #endif