Implements a multiscale scheme for approximating convolution with large filters. This is the basis of the technique described in Convolution Pyramids, Farbman et al., 2011. A set of filter parameters can be estimated through an offline optimization for each desired task: gradient field integration, seamless image cloning, background filling, or scattered data interpolation.
More...
#include <ConvolutionPyramid.hpp>
|
Program * | _downscale |
| Pyramid descending pass shader.
|
|
Program * | _upscale |
| Pyramid ascending pass shader.
|
|
Program * | _filter |
| Filtering shader for the last pyramid level.
|
|
Program * | _padder |
| Padding helper shader.
|
|
Texture | _shifted |
| Contains the input data padded to the right size.
|
|
std::vector< Texture > | _levelsIn |
| The initial levels of the pyramid.
|
|
std::vector< Texture > | _levelsOut |
| The filtered levels of the pyramid.
|
|
float | _h1 [5] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f} |
| h1 filter coefficients.
|
|
float | _h2 = 0.0f |
| h2 filter multiplier.
|
|
float | _g [3] = {0.0f, 0.0f, 0.0f} |
| g filter coefficients.
|
|
glm::ivec2 | _resolution = glm::ivec2(0) |
| Resolution expected for the input texture.
|
|
const int | _size = 5 |
| Size of the filter.
|
|
int | _padding = 0 |
| Additional padding.
|
|
Implements a multiscale scheme for approximating convolution with large filters. This is the basis of the technique described in Convolution Pyramids, Farbman et al., 2011. A set of filter parameters can be estimated through an offline optimization for each desired task: gradient field integration, seamless image cloning, background filling, or scattered data interpolation.
◆ ConvolutionPyramid()
ConvolutionPyramid::ConvolutionPyramid |
( |
uint |
width, |
|
|
uint |
height, |
|
|
uint |
inoutPadding |
|
) |
| |
Constructor.
- Parameters
-
width | internal processing width |
height | internal processing height |
inoutPadding | additional padding applied everywhere except on the final result texture |
- Note
- This is mainly used for the gradient integration task.
◆ height()
unsigned int ConvolutionPyramid::height |
( |
| ) |
|
|
inline |
Returns the height expected for the input texture.
- Returns
- the height expected
◆ process()
void ConvolutionPyramid::process |
( |
const Texture & |
texture | ) |
|
Filter a given input texture.
- Parameters
-
texture | the GPU ID of the texture |
- Note
- Those filters are separable, and could be applied in two passes (vertical and horizontal) to reduce the texture fetches count.
◆ resize()
void ConvolutionPyramid::resize |
( |
uint |
width, |
|
|
uint |
height |
|
) |
| |
Resize the internal buffers.
- Parameters
-
width | the new width |
height | the new height |
◆ setFilters()
void ConvolutionPyramid::setFilters |
( |
const float |
h1[5], |
|
|
float |
h2, |
|
|
const float |
g[3] |
|
) |
| |
Setup the filters parameters for a given task.
- Parameters
-
h1 | the 5 coefficients of h1 |
h2 | the multiplier coefficient h2 |
g | the 3 coefficients of g |
- Note
- See Convolution Pyramids, Farbman et al., 2011 for the notation details.
◆ texture()
const Texture * ConvolutionPyramid::texture |
( |
| ) |
const |
|
inline |
The GPU ID of the filter result.
- Returns
- the ID of the result texture
◆ width()
unsigned int ConvolutionPyramid::width |
( |
| ) |
|
|
inline |
Returns the width expected for the input texture.
- Returns
- the width expected
The documentation for this class was generated from the following files: