Jafar
|
00001 /* $Id$ */ 00002 00003 #ifndef _SUBSTRACTER_HPP 00004 #define _SUBSTRACTER_HPP 00005 00006 #include "kernel/jafarException.hpp" 00007 #include "jmath/jblas.hpp" 00008 #include "image/Image.hpp" 00009 #include "datareader/DataReader.hpp" 00010 00011 namespace jafar { 00012 00013 namespace cutter { 00014 00023 class Substracter { 00024 private : 00025 jafar::image::Image emptyImg, filledImg, maskImg, objectImg; 00026 00027 protected : 00028 jafar::image::Image computeDifferenceImg(); 00029 void computeMaskImgOnGray(const jafar::image::Image& img, 00030 const float &threshold); 00031 void computeMaskImgOnColor(const jafar::image::Image& img, 00032 const float &threshold); 00033 void computeObjectImg(); 00034 00035 public : 00037 Substracter(); 00041 Substracter(const jafar::image::Image& _emptyImg, 00042 const jafar::image::Image& _filledImg); 00043 ~Substracter(); 00045 void setEmptyImg(const jafar::image::Image& img); 00047 void setFilledImg(const jafar::image::Image& img); 00049 jafar::image::Image getMaskImg(); 00051 jafar::image::Image getObjectImg(); 00055 bool loadEmptyImg(const char* fileName); 00059 bool loadFilledImg(const char* fileName); 00063 void extractObjectOnImage(const float &threshold=250); 00068 void extractObjectOnImage(const JfrImage_TypeColorSpace& cs, 00069 const float& threshold=250); 00071 void saveObjectImg(const char *fileName, 00072 const char *imgName); 00074 void convertObjectImg(const JfrImage_TypeColorSpace& cs = JfrImage_CS_GRAY); 00075 };//class Substracter 00076 00077 }//namespace cutter 00078 00079 }//namespace jafar 00080 00081 #endif
Generated on Wed Oct 15 2014 00:37:17 for Jafar by doxygen 1.7.6.1 |