![]() |
ImFusion SDK 4.3
|
#include <ImFusion/Base/LaplacianPyramid.h>
Represents a pyramid of image details with decreasing resolution. More...
Represents a pyramid of image details with decreasing resolution.
The first level will always be the same size of the original image. All levels and the background image (smoothest residual image) are generated and owned by the object.
Public Member Functions | |
LaplacianPyramid (SharedImage *input, bool subsampleImages=true) | |
Creates a pyramid with one level. | |
std::vector< SharedImage * > | levels () const |
Returns a list of all levels sorted from highest to lowest resolution. | |
SharedImage * | backgroundImage () |
Returns the background image (residual image with the coarsest resolution). | |
SharedImage * | detailLevel (int i) const |
Returns the details at level i or nullptr if the level does not exist. | |
SharedImage * | imageLevel (int i) const |
Returns the image at level i or nullptr if the level does not exist. | |
SharedImageSet * | extractLevels () |
Returns and gives up ownership of pyramid details levels (createLevels() must be called again afterwards). | |
int | createLevels (int numLevels) |
Creates and initializes the levels of the pyramid. | |
SharedImage * | reconstructImage () |
Reconstructs the image at full resolution using all levels of the Laplacian pyramid. | |
int | size () const |
Returns the current number of levels. | |
Protected Member Functions | |
void | clear () |
Clears the pyramid levels. | |
Protected Attributes | |
SharedImage * | m_inputImage |
std::vector< std::unique_ptr< SharedImage > > | m_levels |
std::vector< std::unique_ptr< SharedImage > > | m_imageLevels |
std::vector< ImageDownsampler > | m_samplers |
std::unique_ptr< SharedImage > | m_backgroundImage |
bool | m_subsampleImages |
int createLevels | ( | int | numLevels | ) |
Creates and initializes the levels of the pyramid.
Existing levels are deleted. The minimum number of levels will always be one. Each level is computed by downsampling the previous level by factor 2. Once a dimension reach a size of 2 pixels, it will not be downsampled any further. When all dimension reach this minimum before the desired number of levels is reached, no more levels will be added. Masks are not used.
SharedImage * reconstructImage | ( | ) |
Reconstructs the image at full resolution using all levels of the Laplacian pyramid.