84 for (map<uint, double *>::iterator m =
_mapping.begin(), mend =
_mapping.end(); m != mend; ++m)
115 map<uint, double *>::iterator o =
_mapping.find(
id);
124 Vec2r o2d2(o2d3.
x(), o2d3.
y());
160 map<uint, double *>::iterator o =
_mapping.find(
id);
162 double *wvalues = (*o).second;
166 double w = wvalues[i];
200 cout <<
"Warning: this steerable ViewMap level doesn't exist" << endl;
204 if ((
x < 0) || (
x >= pyramid->
width()) || (
y < 0) || (
y >= pyramid->
height())) {
212 float v = pyramid->
pixel(
x, pyramid->
height() - 1 -
y, iLevel) / 32.0f;
233 cerr <<
"SteerableViewMap warning: orientation " << i
234 <<
" of steerable View Map has not been computed yet" << endl;
241 string base(
"SteerableViewMap");
242 stringstream filepath;
248 int rowbytes = ow * 4;
252 for (
int y = 0;
y < oh; ++
y) {
253 for (
int x = 0;
x < ow; ++
x) {
261 pix = byte_data +
y * rowbytes +
x * 4;
262 pix[0] = pix[1] = pix[2] = c;
268 filepath << i <<
"-" << j <<
".png";
273 QString base(
"SteerableViewMap");
276 int ow = img->
width();
279 QImage qtmp(ow, oh, 32);
280 for (uint
y = 0;
y < oh; ++
y) {
281 for (uint
x = 0;
x < ow; ++
x) {
282 int c = int(coeff * img->
pixel(
x,
y));
287 qtmp.setPixel(
x,
y, qRgb(c, c, c));
290 qtmp.save(base + QString::number(i) +
"-" + QString::number(j) +
".png",
"PNG");
Vectors and Matrices (useful type definitions).
Class to represent a pyramid of images.
Class to encapsulate an array of RGB or Gray level values.
Classes to define a silhouette structure.
Convenient access to the steerable ViewMap to which any element of the ViewMap belongs to.
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
SIMD_FORCE_INLINE btScalar norm() const
Return the norm (length) of the vector.
Vec3r orientation2d() const
GaussianPyramid(float iSigma=1.0f)
float pixel(uint x, uint y) const
virtual float pixel(int x, int y, int level=0)
virtual GrayImage * getLevel(int l)
int getNumberOfLevels() const
virtual int height(int level=0)
virtual int width(int level=0)
double * AddFEdge(FEdge *iFEdge)
uint getSVMNumber(Vec2f dir)
float readCompleteViewMapPixel(int iLevel, int x, int y)
uint getNumberOfPyramidLevels() const
SteerableViewMap(uint nbOrientations=4)
map< uint, double * > _mapping
vector< Vec2d > _directions
virtual ~SteerableViewMap()
double ComputeWeight(const Vec2d &dir, uint iNOrientation)
void saveSteerableViewMap() const
float readSteerableViewMapPixel(uint iOrientation, int iLevel, int x, int y)
ImagePyramid ** _imagesPyramids
void buildImagesPyramids(GrayImage **steerableBases, bool copy=false, uint iNbLevels=4, float iSigma=1.0f)
ccl_device_inline dual3 fabs(const ccl_private dual3 &a)
VecMat::Vec2< double > Vec2d
VecMat::Vec2< real > Vec2r
VecMat::Vec2< float > Vec2f
VecMat::Vec3< real > Vec3r
uint8_t * byte_data_for_write()