16 maxval(), minval(), mean(),
stdev(),
17 toupdate(), updateMask(_updateMask),
18 m_ID(
""), m_Skip(0), m_AddSkip(0)
38 for(set<sensor_ptr>::iterator ss = superSensors.begin();
39 ss != superSensors.end();
41 (*ss)->invalidateSource();
45 for(set<sensor_ptr>::iterator ss = superSensors.begin();
46 ss != superSensors.end();)
48 set<sensor_ptr>::iterator last = ss;
50 (*last)->changeSource(target);
70 if(
typeid(*
this) !=
typeid(*rhs))
return false;
80 for(i=0, val=0; i<4 && sid[i]!=0; i++) {
82 val |= ((
dword)(sid[i]))<<(8*i);
91 for(i=0;i<4 && id!=0;i++,id=id>>8)
124 bool modified =
false;
138 for(set<sensor_ptr>::iterator ss = superSensors.begin();
139 ss != superSensors.end(); ss++)
143 for(set<sensor_ptr>::iterator ss = superSensors.begin();
144 ss != superSensors.end(); ss++)
146 (*ss)->performUpdate();
159 minval=numeric_limits<float>::max();
160 maxval=numeric_limits<float>::min();
161 double avg=0, avg2=0;
162 double size = double(
source->getDim1Size()*
source->getDim2Size());
164 for(j=0; j<
source->getDim2Size(); j++) {
165 for(i=0; i<
source->getDim1Size(); i++) {
170 avg2+=double(val*val);
184 superSensors.insert(super);
188 superSensors.erase(super);
215 os <<
"s " <<
m_ID <<
" ";
217 os <<
"source " <<
source->getID() <<
" ";
228 return (
print(os) << endl);
236 static sensor_ptr zeros = std::make_shared<ZeroSensor>();
268 for(j=0; j<
source->getDim2Size(); j++) {
269 for(i=0; i<
source->getDim1Size(); i++, v++)
284 for(j=0; j<
source->getDim2Size()-1; j++, g++) {
285 for(i=0; i<
source->getDim1Size()-1; i++, g++) {
292 bool PPSensor::performFullUpdate()
328 if(
typeid(&rhs) ==
typeid(
PPSensor*)) {
bool assignRef(sensor_cptr rhs)
bool isModified(dword mask=UPD_ALL) const
virtual std::ostream & hprint(std::ostream &os, SensorCollection *sc) const
float minval
overall minimum and maximum
Image< float > values
caching sheet for sensed values
virtual void changeSource(sensor_cptr _source)
void replaceBy(sensor_ptr target)
std::vector< T >::iterator iterator
virtual float calcValue(int x, int y) const =0
bool isValid(int x, int y) const
std::vector< float > cweights
multi-channel weights ('color')
virtual Point calcGradient(int x, int y) const
virtual void calcAllValues()
std::shared_ptr< Sensor > sensor_ptr
virtual bool performUpdate()
sensor_ptr getZeroSensor()
void setScale(float _scale)
Point dir
direction parameter
float getWeightedValue(int x, int y) const
get max normalized value at discrete position range [0,1]
void unrefSuperSensor(sensor_ptr super)
void setPrinted(const std::string &id)
virtual int getDim1Size() const
virtual void calcMinMax()
virtual void calcAllGradients()
dword toupdate
bitflag for updates
Sensor & assign(const Sensor &rhs)
virtual bool performUpdate()
bool isPrinted(const std::string &id) const
Image< Point > gradients
caching sheet for gradients
void refSuperSensor(sensor_ptr super)
virtual float getValue(int x, int y) const
get value at discrete position
void setSize(int nx, int ny)
DMatrix< T > avg(const DMatrix< T > &mat)
std::shared_ptr< const Sensor > sensor_cptr
DMatrix< T > stdev(const DMatrix< T > &mat)
static dword getStringNumber(const char *sid)
void setCWeights(const std::vector< float > &weights)
void setPixel(int x, int y, const T &value)
dword updateMask
bitflag to mask unimportant updates
virtual Sensor & assign(const Sensor &rhs)
void setDirection(const Point &dir)
dword doPP
do preprocessing?
float stdev
overall mean and stdev
virtual Image< float > createSensorImage() const
virtual int getDim2Size() const
void setModified(dword mask=UPD_ALL)
void unsetModified(dword mask=UPD_ALL)
static void getNumberString(char sid[5], dword id)
virtual std::ostream & print(std::ostream &os) const
DMatrix< T > & sqrt(DMatrix< T > &mat)