MPSImageGuidedFilter(3) | MetalPerformanceShaders.framework | MPSImageGuidedFilter(3) |
MPSImageGuidedFilter
#import <MPSImageGuidedFilter.h>
Inherits MPSKernel.
(nonnull instancetype) - initWithDevice:kernelDiameter:
(nonnull instancetype) - initWithDevice:
(nullable instancetype) - initWithCoder:device:
(void) -
encodeRegressionToCommandBuffer:sourceTexture:guidanceTexture:weightsTexture:destinationCoefficientsTexture:
(void) -
encodeReconstructionToCommandBuffer:guidanceTexture:coefficientsTexture:destinationTexture:
NSUInteger kernelDiameter
float epsilon
float reconstructScale
float reconstructOffset
MPSImageGuidedFilter.h MetalPerformanceShaders
Copyright:
Perform Guided Filter to produce a coefficients image The filter is broken into two stages:
The regression stage learns a 4-channel 'coefficient' texture (typically at a very low resolution), and represents the per-pixel linear regression of the source texture to the guidance texture.
The reconstruction stage upsamples the coefficeints to the same size as the final output and then at each pixel computes the inner product to produce the output.
The filter is broken into two stages to allow coefficients to be filtered (such as for example - temporally filtering for video to prevent flicker).
There is also support for an optional weight texture that can be used to discard values in the source data.
Guided Filter is described at https://arxiv.org/pdf/1505.00996.pdf.
Perform Guided Filter Reconstruction (inference) to produce the filtered output The filter will not begin to execute until after the command buffer has been enqueued and committed.
sourceGuidanceTexture Input guidance pixel buffer. This should be a color (RGB) image. coefficientsTexture Input coefficients texture generated generated by a previous encodeRegressionToCommandBuffer
Parameters:
Note: The coefficients are upsampled at the reconstruction of the filtered data. Reconstruct(guidance RGB) = a.r * R + a.g * G + a.b * B + b, where a and b are the coefficients learnt using encodeRegressionToCommandBuffer.
Final reconstructed value = value * reconstructScale + reconstructOffset
Perform Guided Filter Regression (correlation) to produce a coefficients texture The filter will not begin to execute until after the command buffer has been enqueued and committed.
Parameters:
Set the MPSKernelOptionsAllowReducedPrecision in the 'options' property for this kernel to peform the computations using half-precision arithmetic. This can potentially improve performance and/or power usage.
NSSecureCoding compatability While the standard NSSecureCoding/NSCoding method -initWithCoder: should work, since the file can't know which device your data is allocated on, we have to guess and may guess incorrectly. To avoid that problem, use initWithCoder:device instead.
Parameters:
Returns:
Reimplemented from MPSKernel.
Standard init with default properties per filter type
Parameters:
Returns:
Reimplemented from MPSKernel.
Specifies information to apply the guided filter regression.
Parameters:
Returns:
The regularization parameter The parameter used when computing the linear coefficients a and b.
The local window size The local window size.
The offset parameter The offset parameter added to the result of the scaled reconstructed value. The default value is 0.0f.
The scale parameter The parameter used to scale the result of the reconstruction operation. The default value is 1.0f.
Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code.
Mon Jul 9 2018 | Version MetalPerformanceShaders-119.3 |