19 template <
bool FASTLOAD>
22 const bool smooth_halves,
const bool convert_grayscale)
27 obj.
images.resize(nOctaves);
30 if (convert_grayscale && img.
isColor())
41 obj.
images[0] = std::move(img);
47 bool all_used_sse2 =
true;
48 for (
size_t o = 1; o < nOctaves; o++)
50 bool ret = obj.
images[o - 1].scaleHalf(
52 all_used_sse2 = all_used_sse2 && ret;
59 const bool smooth_halves,
const bool convert_grayscale)
61 return buildPyramid_templ<false>(
68 const bool convert_grayscale)
70 return buildPyramid_templ<true>(
71 *
this, img, nOctaves, smooth_halves, convert_grayscale);
Holds and builds a pyramid of images: starting with an image at full resolution (octave=1), it builds a number of half-resolution images: octave=2 at 1/2 , octave=3 at 1/2^2, octave=N at 1/2^(N-1).
std::vector< mrpt::img::CImage > images
The individual images:
bool buildPyramid_templ(CImagePyramid &obj, mrpt::img::CImage &img, const size_t nOctaves, const bool smooth_halves, const bool convert_grayscale)
Classes for computer vision, detectors, features, etc.
CImage grayscale() const
Returns a grayscale version of the image, or a shallow copy of itself if it is already a grayscale im...
bool buildPyramidFast(mrpt::img::CImage &img, const size_t nOctaves, const bool smooth_halves=true, const bool convert_grayscale=false)
Exactly like buildPyramid(), but if the input image has not to be converted from RGB to grayscale...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
bool isColor() const
Returns true if the image is RGB, false if it is grayscale.
#define ASSERT_ABOVE_(__A, __B)
A class for storing images as grayscale or RGB bitmaps.
bool buildPyramid(const mrpt::img::CImage &img, const size_t nOctaves, const bool smooth_halves=true, const bool convert_grayscale=false)
Fills the vector images with the different octaves built from the input image.