Structural deformable models
Functions
SensorSet.cpp File Reference
#include <iostream>
#include <fstream>
#include <typeinfo>
#include "SensorSet.h"
#include "SensorColl.h"
#include "mathutil.h"
#include "Fourier.h"
#include "DMatrixUtil.h"
Include dependency graph for SensorSet.cpp:

Go to the source code of this file.

Functions

static Image< double > & create2DGaussian (Image< double > &flt, double stdev, float clampd, float cx, float cy)
 

Function Documentation

static Image< double > & create2DGaussian ( Image< double > &  flt,
double  stdev,
float  clampd,
float  cx,
float  cy 
)
static

Definition at line 418 of file SensorSet.cpp.

References gaussd2(), Image< T >::getData(), Image< T >::getSizeX(), Image< T >::getSizeY(), dmutil::sum(), and TRACE.

Referenced by SmoothIntensitySensor::updateScale().

420 {
421  clampd = clampd*clampd;
422  int i,j;
423  double sum=0;
424  double* pixel = flt.getData();
425  int xsize=flt.getSizeX(), ysize=flt.getSizeY();
426  TRACE("creating filter " << xsize << " " << ysize);
427  for(j=0; j<ysize; j++)
428  for(i=0; i<xsize; i++, pixel++) {
429  float ii = (float)i-cx;
430  float jj = (float)j-cy;
431  float d2 = ii*ii+jj*jj;
432  if(d2<clampd) {
433  double value = gaussd2(d2, stdev);
434  *pixel = value;
435  sum += value;
436  }
437  }
438  flt *= (1.f/sum);
439  return flt;
440 }
float gaussd2(float x2, double stdev)
Definition: mathutil.h:77
#define TRACE(msg)
Definition: common.h:14
int getSizeX() const
Definition: Image.h:42
DMatrix< T > sum(const DMatrix< T > &mat)
Definition: DMatrixUtil.h:59
const T * getData() const
Definition: Image.h:39
DMatrix< T > stdev(const DMatrix< T > &mat)
Definition: DMatrixUtil.h:106
int getSizeY() const
Definition: Image.h:43