Houdini 20.5 Nodes Copernicus nodes

Kuwahara Filter Copernicus node

Applies Kuwhara Filter for Painterly Effects.

On this page

This operation applies the Kuwhara filter. This filter will set each pixel to the average value of one of four regions around the pixel. The four regions are offset from the pixel in each of the diagonal directions. The chosen region is the one with the smallest standard deviation, ie, the region that is “smoothest”.

While originally developed to improve segmentation, this tends to preserve edges and flatten noise; creating a painterly effect; making it a useful building block for artistic techniques.

See Wikipedia’s Kuwahara Filter page for more info.

Parameters

Signature

The layer type that the source accepts.

See Signatures for more information.

Mask

The amount of the new value to mix in with the original value. Higher values mix in more of the new value. Lower values mix in less of the new value. You can also set the RGBA channels to which you apply the effects of this node.

The default value is 1, which means this node uses only the new value. See Mask for more information.

Method

This filter requires accessing k^2 pixels for every pixel, where k is the kernel diameter. Large kernels can thus become very expensive.

Approximate

Rather than computing the standard deviations and means for each pixel, generate it in a single pre-pass. This speed computation but will cause variations in radius to affect neighbouring pixels.

Exact

The filter is computed exactly for each pixel. GPUs often make this practical even for surprisingly large radii.

Luminance

When more than one channel is processed, the filter still will pick the same source quadrant for all channels. A common standard deviation is then needed for quadrant selection, which this defines.

SGI Luminance

This is a historical luminance computation used in Houdini, which is believed to originate with SGI.

lum = 0.3086 * red + 0.6094 * green + 0.0820 * blue

NTSC Luminance

The standard NTSC luminance computation. This is probably the most commonly used luminance options.

lum = 0.299 * red + 0.587 * green + 0.114 * blue

HDTV Luminance

The HDTV standard luminance from BT 709.

lum = 0.2126 * red + 0.7152 * green + 0.0722 * blue

Average

An average of the channels.

Maximum Channel

The maximum of the channels.

Minimum Channel

The minimum of the channels.

Magnitude / Length

The length of the vector formed by taking the channels as components. For Mono input, this is the absolute value.

Hue

Convert to HSV and return the hue channel.

Saturation

Convert to HSV and return the saturation channel.

Value

Convert to HSV and return the value channel.

Red

Extract the red, or x, channel

Green

Extract the green, or y, channel

Blue

Extract the blue, or z, channel

Alpha

Extract the alpha, or w, channel

Radius

The radius of each of the four regions to perform blur on. This is measured in pixels.

Blur Scale

When computing the average of a region, the size of the region is scaled by this factor. Making this small will cause it to select a sharper source area, but use the larger area for determining standard deviation. Making this large increases the blur effect but doesn’t affect which quadrant is picked.

Blend to Blur

A value of 0 will pick the average from the region with smallest standard deviation. A value of 1 will average the averages, so effectively just perform a larger blur. Values inbeteween adjust the weighting, increasing the weight of areas with large standard deviations.

Separation

The four regions are offset by the radius, causing them to not overlap. Adjusting separation scales this offset - a value of 0 will cause them to all sample the same location, causing this to be a box blur. Values over 1 will have them sampling dislocated areas of the image.

Inputs

source

The Mono, UV, RGB, or RGBA layer to filter.

radius

A per-pixel scale for the size of the filter. This is scaled with the radius parameter.

mask

An optional per-pixel mask amount that’s scaled by the Mask parameter.

Outputs

blur

The filtered output layer.

See also

Copernicus nodes