19 ImagePyramid::ImagePyramid(
const GrayImage &level0,
unsigned nbLevels)
21 BuildPyramid(level0, nbLevels);
27 if (!_levels.empty()) {
28 for (vector<GrayImage *>::iterator im = _levels.begin(), imend = _levels.end(); im != imend;
35 ImagePyramid::~ImagePyramid()
37 if (!_levels.empty()) {
38 for (vector<GrayImage *>::iterator im = _levels.begin(), imend = _levels.end(); im != imend;
51 float ImagePyramid::pixel(
int x,
int y,
int level)
57 unsigned int i = 1 << level;
58 unsigned int sx =
x >> level;
59 unsigned int sy =
y >> level;
68 float A = i * (
sx + 1) -
x;
70 float C = i * (
sy + 1) -
y;
75 if (sx < img->
width() - 1) {
83 if (sy < img->
height() - 1) {
86 if (sx < img->
width() - 1) {
99 return (1.0f / (
float)(1 << (2 * level))) * (
C * P1 +
D * P2);
104 return _levels[level]->width();
109 return _levels[level]->height();
112 GaussianPyramid::GaussianPyramid(
const GrayImage &level0,
unsigned nbLevels,
float iSigma)
115 BuildPyramid(level0, nbLevels);
118 GaussianPyramid::GaussianPyramid(
GrayImage *level0,
unsigned nbLevels,
float iSigma)
121 BuildPyramid(level0, nbLevels);
141 unsigned w = pLevel->
width();
142 unsigned h = pLevel->
height();
144 for (
unsigned int i = 0; i < nbLevels; ++i) {
146 h = pLevel->
height() >> 1;
148 for (
unsigned int y = 0;
y < h; ++
y) {
149 for (
unsigned int x = 0;
x <
w; ++
x) {
159 while ((
w > 1) && (h > 1)) {
161 h = pLevel->
height() >> 1;
163 for (
unsigned int y = 0;
y < h; ++
y) {
164 for (
unsigned int x = 0;
x <
w; ++
x) {
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
Class to perform gaussian filtering operations on an image.
Class to represent a pyramid of images.
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
float getSmoothedPixel(Map *map, int x, int y)
virtual void BuildPyramid(const GrayImage &level0, unsigned nbLevels)
float pixel(unsigned x, unsigned y) const
void setPixel(unsigned x, unsigned y, float v)
std::vector< GrayImage * > _levels
ccl_gpu_kernel_postfix ccl_global float int int sy
ccl_gpu_kernel_postfix ccl_global float int sx