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 whas not been computed yet" << endl;
241 string base(
"SteerableViewMap");
242 stringstream filepath;
248 int rowbytes = ow * 4;
251 for (
int y = 0;
y < oh; ++
y) {
252 for (
int x = 0;
x < ow; ++
x) {
261 pix[0] = pix[1] = pix[2] =
c;
267 filepath <<
i <<
"-" << j <<
".png";
269 IMB_save_image(ibuf,
const_cast<char *
>(filepath.str().c_str()), 0);
272 QString base(
"SteerableViewMap");
275 int ow = img->
width();
278 QImage qtmp(ow, oh, 32);
279 for (
uint y = 0;
y < oh; ++
y) {
280 for (
uint x = 0;
x < ow; ++
x) {
281 int c = int(coeff * img->
pixel(
x,
y));
286 qtmp.setPixel(
x,
y, qRgb(
c,
c,
c));
289 qtmp.save(base + QString::number(
i) +
"-" + QString::number(j) +
".png",
"PNG");
Vectors and Matrices (useful type definitions).
ImBuf * IMB_allocImBuf(unsigned int x, unsigned int y, unsigned char planes, unsigned int flags)
bool IMB_save_image(ImBuf *ibuf, const char *filepath, const int flags)
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.
ATTR_WARN_UNUSED_RESULT const BMVert * v
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
float pixel(uint x, uint y) const
virtual float pixel(int x, int y, int level=0)
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 float2 fabs(const float2 a)
VecMat::Vec2< double > Vec2d
VecMat::Vec2< real > Vec2r
VecMat::Vec2< float > Vec2f
VecMat::Vec3< real > Vec3r
static void copy(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node)
ImBufByteBuffer byte_buffer