Table Of Contents

Color Threshold (G Dataflow)

Last Modified: October 26, 2017

Applies a threshold to the three planes of an RGB or HSL image and places the result into an 8-bit image.

connector_pane_image
datatype_icon

color mode

Image color format to use for the operation.

Name Value Description
RGB 0

Specifies the color format RGB (red, green, and blue)

HSL 1

Specifies the color format HSL (hue, saturation, and luminance)

HSV 2

Specifies the color format HSV (hue, saturation, and value)

HSI 3

Specifies the color format HSI (hue, saturation, and intensity)

Default: RGB

datatype_icon

image src

Reference to the image to threshold.

The source image is converted to 8 bit and contains the result of the threshold if image dst is not connected.

datatype_icon

image dst

Reference to the destination image.

If image dst is connected, it must be an unsigned 8-bit image.

datatype_icon

red/hue range

Cluster used to determine the thresholding range for the red or hue plane, depending on the color mode.

Any pixel values not included in this range are reset to zero in the destination image. The pixel values included in this range are altered depending on the status of replace value. By default, all pixel values are included (0, 255).

datatype_icon

lower value

Minimum pixel value in the red or hue plane that is used for the threshold.

Default: 0

datatype_icon

upper value

Maximum pixel value in the red or hue plane that is used for the threshold.

Default: 255

datatype_icon

green/saturation range

Cluster used to determine the thresholding range for the green or saturation plane, depending on the color mode.

Any pixel values not included in this range are reset to zero in the destination image. The pixel values included in this range are altered depending on the status of replace value. By default, all pixel values are included (0, 255).

datatype_icon

lower value

Minimum pixel value in the green or saturation plane that is used for the threshold.

Default: 0

datatype_icon

upper value

Maximum pixel value in the green or saturation plane that is used for the threshold.

Default: 255

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

blue/luma/value/intensity range

Cluster used to determine the thresholding range for the blue, luminance, value, or intensity plane, depending on the color mode.

Any pixel values not included in this range are reset to zero in the destination image. The pixel values included in this range are altered depending on the status of replace value. By default, all pixel values are included (0, 255).

datatype_icon

lower value

Minimum pixel value in the blue, luminance, value, or intensity plane that is used for the threshold.

Default: 0

datatype_icon

upper value

Maximum pixel value in the blue, luminance, value, or intensity plane that is used for the threshold.

Default: 255

datatype_icon

replace value

Value that the node uses to fill pixels in the destination image when the corresponding pixels in the image src are found in all three ranges.

Default: 1

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.

Thresholding Behavior

A test is performed with each range (Red or Hue Range, Green or Sat Range, and Blue or Luma or Val or Inten Range) to determine whether the corresponding pixel from the image src is set to the value specified in replace value. If a pixel from image src does not have corresponding pixel values specified in all three ranges, the corresponding pixel in image dst out is set to 0. If the image destination image dst is not connected, the Color Threshold node converts image src to an 8-bit image and saves the resulting image in the image source.

If a range is not specified for a given plane, the value of the pixel for this color plane is ignored. For example, the algorithm always considers the pixel value for this plane to be in range. You can apply a threshold to one of the three ranges without having to set the values of the other two ranges.

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