RSMeanShift.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /**
  2. * @file RSMeanShift.h
  3. * @brief implementation of the MeanShift algorithm (uses EDISON)
  4. * @author Björn Fröhlich
  5. * @date 05/05/2009
  6. */
  7. #ifndef RSMEANSHIFT
  8. #define RSMEANSHIFT
  9. #include "core/basics/Config.h"
  10. #include "RegionSegmentationMethod.h"
  11. #include <segmentation/edisonSegm/tdef.h>
  12. #include <segmentation/edisonSegm/msImageProcessor.h>
  13. namespace OBJREC {
  14. class RSMeanShift: public RegionSegmentationMethod
  15. {
  16. protected:
  17. //! Specifies the minimum allowable region area (in pixels) contained in the segmented image
  18. int minimumRegionArea;
  19. //! Specifies the bandwidth of the search window in the range subspace during the computation of mean shift
  20. double rangeBandwidth;
  21. //! Specifies a spatial search window of size (2r+1)x (2r+1) during the mean shift computation, where r is the spatial bandwidth
  22. int spatialBandwidth;
  23. //! Specifies the SpeedUpLevel. See EDISON Manual for details.
  24. std::string speedUpLvlStr;
  25. SpeedUpLevel speedUpLevel;
  26. //! EDISON - ImageProcessor
  27. msImageProcessor *imageProc;
  28. public:
  29. /** simple constructor */
  30. RSMeanShift();
  31. /**
  32. * standard constructor
  33. * @param conf config file
  34. */
  35. RSMeanShift(const NICE::Config *conf );
  36. /** simple destructor */
  37. ~RSMeanShift();
  38. /**
  39. * returns the regions of a given image
  40. * @param img input image
  41. * @param mask output regions, each region has it own number
  42. * @return count of region
  43. */
  44. int segRegions ( const NICE::Image & img, NICE::Matrix & mask ) const;
  45. /**
  46. * returns the regions of a given image
  47. * @param img input image
  48. * @param mask output regions, each region has it own number
  49. * @return count of region
  50. */
  51. int segRegions ( const NICE::ColorImage & img, NICE::Matrix & mask ) const;
  52. };
  53. } //namespace
  54. #endif