public class MPSImageGuidedFilter extends MPSKernel
Perform Guided Filter to produce a coefficients image The filter is broken into two stages: - Regression - Reconstruction
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.
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret| Modifier | Constructor and Description |
|---|---|
protected |
MPSImageGuidedFilter(org.moe.natj.general.Pointer peer) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
_supportsSecureCoding()
This property must return YES on all classes that allow secure coding.
|
static boolean |
accessInstanceVariablesDirectly() |
static MPSImageGuidedFilter |
alloc() |
static MPSImageGuidedFilter |
allocWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
static boolean |
automaticallyNotifiesObserversForKey(java.lang.String key) |
static void |
cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget) |
static void |
cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument) |
static NSArray<java.lang.String> |
classFallbacksForKeyedArchiver() |
static org.moe.natj.objc.Class |
classForKeyedUnarchiver() |
static java.lang.String |
debugDescription_static() |
static java.lang.String |
description_static() |
void |
encodeReconstructionToCommandBufferGuidanceTextureCoefficientsTextureACoefficientsTextureBDestinationTexture(MTLCommandBuffer commandBuffer,
MTLTexture guidanceTexture,
MTLTexture coefficientsTextureA,
MTLTexture coefficientsTextureB,
MTLTexture destinationTexture)
Perform Guided Filter Reconstruction (inference) to produce the filtered output
|
void |
encodeReconstructionToCommandBufferGuidanceTextureCoefficientsTextureDestinationTexture(MTLCommandBuffer commandBuffer,
MTLTexture guidanceTexture,
MTLTexture coefficientsTexture,
MTLTexture destinationTexture)
Perform Guided Filter Reconstruction (inference) to produce the filtered output
|
void |
encodeRegressionToCommandBufferSourceTextureGuidanceTextureWeightsTextureDestinationCoefficientsTexture(MTLCommandBuffer commandBuffer,
MTLTexture sourceTexture,
MTLTexture guidanceTexture,
MTLTexture weightsTexture,
MTLTexture destinationCoefficientsTexture)
Perform Guided Filter Regression (correlation) to produce a coefficients texture
|
void |
encodeRegressionToCommandBufferSourceTextureGuidanceTextureWeightsTextureDestinationCoefficientsTextureADestinationCoefficientsTextureB(MTLCommandBuffer commandBuffer,
MTLTexture sourceTexture,
MTLTexture guidanceTexture,
MTLTexture weightsTexture,
MTLTexture destinationCoefficientsTextureA,
MTLTexture destinationCoefficientsTextureB)
Perform per-channel (non-color correlated) Guided Filter Regression (correlation) to produce a coefficients texture
|
float |
epsilon()
[@property] epsilon
|
static long |
hash_static() |
MPSImageGuidedFilter |
init() |
MPSImageGuidedFilter |
initWithCoder(NSCoder aDecoder)
NS_DESIGNATED_INITIALIZER
|
MPSImageGuidedFilter |
initWithCoderDevice(NSCoder aDecoder,
java.lang.Object device)
NSSecureCoding compatability
|
MPSImageGuidedFilter |
initWithDevice(java.lang.Object device)
Standard init with default properties per filter type
|
MPSImageGuidedFilter |
initWithDeviceKernelDiameter(MTLDevice device,
long kernelDiameter)
Specifies information to apply the guided filter regression.
|
static NSObject.Function_instanceMethodForSelector_ret |
instanceMethodForSelector(org.moe.natj.objc.SEL aSelector) |
static NSMethodSignature |
instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
instancesRespondToSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
isSubclassOfClass(org.moe.natj.objc.Class aClass) |
long |
kernelDiameter()
[@property] kernelDiameter
|
static NSSet<java.lang.String> |
keyPathsForValuesAffectingValueForKey(java.lang.String key) |
static MPSImageGuidedFilter |
new_objc() |
float |
reconstructOffset()
[@property] reconstructOffset
|
float |
reconstructScale()
[@property] reconstructScale
|
static boolean |
resolveClassMethod(org.moe.natj.objc.SEL sel) |
static boolean |
resolveInstanceMethod(org.moe.natj.objc.SEL sel) |
void |
setEpsilon(float value)
[@property] epsilon
|
void |
setReconstructOffset(float value)
[@property] reconstructOffset
|
void |
setReconstructScale(float value)
[@property] reconstructScale
|
static void |
setVersion_static(long aVersion) |
static org.moe.natj.objc.Class |
superclass_static() |
static boolean |
supportsSecureCoding() |
static long |
version_static() |
copyWithZone, copyWithZoneDevice, device, encodeWithCoder, label, options, setLabel, setOptionsaccessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKeyprotected MPSImageGuidedFilter(org.moe.natj.general.Pointer peer)
public static boolean accessInstanceVariablesDirectly()
public static MPSImageGuidedFilter alloc()
public static MPSImageGuidedFilter allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument)
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
public static java.lang.String debugDescription_static()
public static java.lang.String description_static()
public void encodeReconstructionToCommandBufferGuidanceTextureCoefficientsTextureDestinationTexture(MTLCommandBuffer commandBuffer, MTLTexture guidanceTexture, MTLTexture coefficientsTexture, MTLTexture destinationTexture)
The filter will not begin to execute until after the command buffer has been enqueued and committed.
[@pparam] sourceGuidanceTexture Input guidance pixel buffer. This should be a color (RGB) image. [@pparam] coefficientsTexture Input coefficients texture generated generated by a previous encodeRegressionToCommandBuffer
destinationTexture - Output texture
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
public void encodeRegressionToCommandBufferSourceTextureGuidanceTextureWeightsTextureDestinationCoefficientsTexture(MTLCommandBuffer commandBuffer, MTLTexture sourceTexture, MTLTexture guidanceTexture, MTLTexture weightsTexture, MTLTexture destinationCoefficientsTexture)
The filter will not begin to execute until after the command buffer has been enqueued and committed.
commandBuffer - A valid MTLCommandBuffer.sourceTexture - Input source texture to be filtered (typically a mask). This should be a single channel image.guidanceTexture - Input guidance texture. This should be a color (RGB) image.weightsTexture - Optional input confidence texture. This should also a single channel image.destinationCoefficientsTexture - Output texture with four coefficients that minimize the mean squared error between
the source and an affine function of guidance R, G, B.
Note: The destinationCoefficientsTexture computes the linear cofficients "a" and "b". The "a" coefficient is
stored in the RGB channels of destinationCoefficientsTexture and the "b" coefficient in the alpha chnanel.
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.
public float epsilon()
The regularization parameter
The parameter used when computing the linear coefficients a and b.
public static long hash_static()
public MPSImageGuidedFilter init()
public MPSImageGuidedFilter initWithCoder(NSCoder aDecoder)
NSCodinginitWithCoder in interface NSCodinginitWithCoder in class MPSKernelpublic MPSImageGuidedFilter initWithCoderDevice(NSCoder aDecoder, java.lang.Object device)
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.
initWithCoderDevice in class MPSKernelaDecoder - The NSCoder subclass with your serialized MPSKerneldevice - The MTLDevice on which to make the MPSKernelpublic MPSImageGuidedFilter initWithDevice(java.lang.Object device)
MPSKernelinitWithDevice in class MPSKerneldevice - The device that the filter will be used on. May not be NULL.public MPSImageGuidedFilter initWithDeviceKernelDiameter(MTLDevice device, long kernelDiameter)
device - The device the filter will run onkernelDiameter - The local window sizepublic static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
public long kernelDiameter()
The local window size
The local window size.
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
public static MPSImageGuidedFilter new_objc()
public float reconstructOffset()
The offset parameter
The offset parameter added to the result of the scaled reconstructed value. The default value is 0.0f.
public float reconstructScale()
The scale parameter
The parameter used to scale the result of the reconstruction operation. The default value is 1.0f.
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
public void setEpsilon(float value)
The regularization parameter
The parameter used when computing the linear coefficients a and b.
public void setReconstructOffset(float value)
The offset parameter
The offset parameter added to the result of the scaled reconstructed value. The default value is 0.0f.
public void setReconstructScale(float value)
The scale parameter
The parameter used to scale the result of the reconstruction operation. The default value is 1.0f.
public static void setVersion_static(long aVersion)
public static org.moe.natj.objc.Class superclass_static()
public static boolean supportsSecureCoding()
public boolean _supportsSecureCoding()
NSSecureCoding_supportsSecureCoding in interface NSSecureCoding_supportsSecureCoding in class MPSKernelpublic static long version_static()
public void encodeReconstructionToCommandBufferGuidanceTextureCoefficientsTextureACoefficientsTextureBDestinationTexture(MTLCommandBuffer commandBuffer, MTLTexture guidanceTexture, MTLTexture coefficientsTextureA, MTLTexture coefficientsTextureB, MTLTexture destinationTexture)
The filter will not begin to execute until after the command buffer has been enqueued and committed.
commandBuffer - A valid MTLCommandBuffer.guidanceTexture - Input guidance pixel buffer.coefficientsTextureA - Input coefficients A texture generated generated by a previous encodeRegressionToCommandBuffer.coefficientsTextureB - Input coefficients B texture generated generated by a previous encodeRegressionToCommandBuffer.destinationTexture - Output texturepublic void encodeRegressionToCommandBufferSourceTextureGuidanceTextureWeightsTextureDestinationCoefficientsTextureADestinationCoefficientsTextureB(MTLCommandBuffer commandBuffer, MTLTexture sourceTexture, MTLTexture guidanceTexture, MTLTexture weightsTexture, MTLTexture destinationCoefficientsTextureA, MTLTexture destinationCoefficientsTextureB)
The filter will not begin to execute until after the command buffer has been enqueued and committed. This encode call differs from the one above in that the correlations are not computed across channels and therefore this filter computes two coefficient textures: ai and bi.
commandBuffer - A valid MTLCommandBuffer.sourceTexture - Input source texture to be filtered.guidanceTexture - Input guidance texture. This should be a color (RGB) image.weightsTexture - Optional input confidence texture. This should be a single channel image.destinationCoefficientsTextureA - Output texture with four coefficients A that minimize the mean squared error between
the source channels and an affine function of guidance channels.destinationCoefficientsTextureB - Output texture with four coefficients B that minimize the mean squared error between
the source channels and an affine function of guidance channels.
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.