MRPT
2.0.1
|
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).
Color (RGB) or grayscale pyramids can be built from color input images; only grayscale pyramids can be built from grayscale images.
The algorithm to halve the images can be either a 1:2 decimation or a smooth filter (arithmetic mean of every 4 pixels).
Pyramids are built by invoking the method buildPyramid() or buildPyramidFast()
Example of usage:
Definition at line 54 of file CImagePyramid.h.
#include <mrpt/vision/CImagePyramid.h>
Public Member Functions | |
CImagePyramid ()=default | |
~CImagePyramid ()=default | |
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. More... | |
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, the image data buffer is reutilized for the 1st octave in images[0], emptying the input image. More... | |
Public Attributes | |
std::vector< mrpt::img::CImage > | images |
The individual images: More... | |
|
default |
|
default |
bool CImagePyramid::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.
[in] | img | The input image. Can be either color or grayscale. |
[in] | nOctaves | Number of octaves to build. 1 means just the original image, 2 means the original plus the 1/2 image, etc. |
[in] | smooth_halves | If true, use an arithmetic mean of every 2x2 pixel block when downsampling. |
[in] | convert_grayscale | If true, the pyramid is built in grayscale even for color input images. |
Definition at line 57 of file CImagePyramid.cpp.
bool CImagePyramid::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, the image data buffer is reutilized for the 1st octave in images[0], emptying the input image.
Definition at line 66 of file CImagePyramid.cpp.
std::vector<mrpt::img::CImage> mrpt::vision::CImagePyramid::images |
The individual images:
Definition at line 93 of file CImagePyramid.h.
Referenced by buildPyramid_templ().
Page generated by Doxygen 1.8.14 for MRPT 2.0.1 Git: 0fef1a6d7 Fri Apr 3 23:00:21 2020 +0200 at vie abr 3 23:20:28 CEST 2020 |