From 12:00 AM CDT Sunday, October 17 - 11:30 AM CDT Sunday, October 17, ni.com will be undergoing system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Table Of Contents

Rank Filter (G Dataflow)

Last Modified: June 25, 2019

Orders or classifies the pixel values surrounding the processed pixel.

The data is placed into an array and the processed pixel is set to the nth pixel value, or the ordered number. This node modifies the source image. If you need the original source image, create a copy of the image using the Copy Image node before using this node.

connector_pane_image
datatype_icon

image src

Reference to the source image.

datatype_icon

image mask

8-bit image that specifies the region of the small image to be copied.

Only pixels in the image src image that correspond to a non-zero pixel in the mask image are copied. All other pixels keep their original values. The entire image is processed if image mask is not connected.

datatype_icon

image dst

Reference to the destination image.

datatype_icon

filter options

Cluster that specifies the variables of the horizontal and vertical matrix axis and the order number chosen after classifying the values.

The default values correspond to a 3 × 3 median filter.

datatype_icon

x size

Size of the horizontal matrix axis.

Default: 3

datatype_icon

y size

Size of the vertical matrix axis.

Default: 3

datatype_icon

order #

Number chosen after classifying the values.

Default: 4

datatype_icon

error in

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Default: No error

datatype_icon

image dst out

Reference to the destination image.

If image dst is connected, image dst out is the same as image dst. Otherwise, image dst out refers to the image referenced by image.

datatype_icon

error out

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Connected Source Image Border Size

The connected source image must be created with a border capable of supporting the size of the convolution matrix. A 3 × 3 matrix must have a minimum border of 1, a 5 × 5 matrix must have a minimum border of 2, and so on. The border size of the destination image is not important.

Default Median Operation

The default for this node is a 3 × 3 median operation with X = 3, Y = 3, and order = 4. To change to a 5 × 5 median operation, the cluster must take the values X = 5, Y = 5, and order = 12. In this example, the order number is determined by calculating the central pixel number in the array. For a 5 × 5 convolution, order = 12 (the 13th pixel) because that pixel is the center pixel number for a 2D array of 25 pixels.

Image Weight

A lighter image results when using a higher-order number, such as 7 in a 3 × 3 matrix. Darker images result when using a lower-order number, such as 1 in a 3 × 3 matrix.

Median Filter

A median (center-pixel) operation is advantageous because it standardizes the gray-level values without significantly modifying the form of the objects or the overall brightness in the image. You can use this node to apply a median filter by selecting the correct order, (f^2-1)/2, where f is the size of the convolution matrix.

Gray Morphology Erosion

If the order value that is entered is 0, the image obtained is representative of the local minimum from the source image. This operation is equivalent to a gray morphology erosion.

Gray Morphology Dilation

If the order value that is passed is equal to the following equation, the obtained image is representative of the local maximum from the source image. This operation is equivalent to a gray morphology dilation.

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported

Web Server: Not supported in VIs that run in a web application


Recently Viewed Topics