35 #ifndef AIMS_PRIMALSKETCH_PERONAMALIKSMOOTHER_H
36 #define AIMS_PRIMALSKETCH_PERONAMALIKSMOOTHER_H
44 :
public Smoother<carto::VolumeRef<T>, carto::VolumeRef<T> >
56 inline float conductance(
float x)
60 case 1:
return(conductance1(x));
61 case 2:
return(conductance2(x));
62 default : exit(EXIT_FAILURE);
66 inline float conductance1(
float x)
67 {
return (1.0/
float(1.0+(x*x)/(_gradK*_gradK))); }
68 inline float conductance2(
float x)
69 {
return (exp(-(x*x)/(_gradK*_gradK))); }
76 std::cerr <<
"Diffusion Smoother : dt must be <= 0.25" << std::endl;
84 : _K(K),
_sigma(sigma), _conductance(cond) {SetDt(
dt);}
87 int maxiter,
bool verbose=
false);
89 float dt() {
return _dt;}
carto::VolumeRef< T > doSmoothing(const carto::VolumeRef< T > &ima, int maxiter, bool verbose=false)
PeronaMalikSmoother(float dt, float K, float sigma, int cond)