ImFusion SDK 4.3
LaplacianPyramid Class Reference

#include <ImFusion/Base/LaplacianPyramid.h>

Represents a pyramid of image details with decreasing resolution. More...

+ Inheritance diagram for LaplacianPyramid:

Detailed Description

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.
 
SharedImagebackgroundImage ()
 Returns the background image (residual image with the coarsest resolution).
 
SharedImagedetailLevel (int i) const
 Returns the details at level i or nullptr if the level does not exist.
 
SharedImageimageLevel (int i) const
 Returns the image at level i or nullptr if the level does not exist.
 
SharedImageSetextractLevels ()
 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.
 
SharedImagereconstructImage ()
 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

SharedImagem_inputImage
 
std::vector< std::unique_ptr< SharedImage > > m_levels
 
std::vector< std::unique_ptr< SharedImage > > m_imageLevels
 
std::vector< ImageDownsamplerm_samplers
 
std::unique_ptr< SharedImagem_backgroundImage
 
bool m_subsampleImages
 

Member Function Documentation

◆ createLevels()

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.

Returns
the actual number of levels.

◆ reconstructImage()

SharedImage * reconstructImage ( )

Reconstructs the image at full resolution using all levels of the Laplacian pyramid.

Returns
the created reconstructed image (ownership is transferred).

The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close