PointFilter

A multipurpose function, PointFilter produces a black-and-white or greyscale output image where every pixel is the result of a "global" image-enhancement technique - for example, thresholding, inversion, histogram equalization or greyscale stretching or clipping - applied to each pixel in the input image or region of interest (ROI).

Note:
  • This function is only available on In-Sight vision systems running In-Sight firmware 4.x.x, and is not available on In-Sight vision systems running In-Sight firmware 5.1.0 and later. For a complete list of models and supported firmware versions, see Firmware Versions.
  • In-Sight vision systems running In-Sight firmware 5.1.0 and later have had this function consolidated into the Filter function. For more information, see Filter.
  • If attempting to load a job containing the PointFilter or NeighborFilter functions to an In-Sight vision system running In-Sight 5.1.x firmware, and the function is password-protected using the Format Cells dialog’s Protection tab, the job load will fail. Load the job to an In-Sight vision system running In-Sight firmware 4.x.x and modify the job. For more information on accessing or removing password-protected cells, see Licensing.

PointFilter Inputs

Syntax: PointFilter(Image,Fixture.Row,Fixture.Column,Fixture.Theta,Region.X,Region.Y,Region.High,Region.Wide,Region.Angle,Operation,Minimum,Maximum,Threshold,Show)

Note: The Fixture and Region parameters must be defined within the bounds of the image; otherwise, the function will return #ERR.
Parameter Description

Image

This argument must reference a spreadsheet cell that contains a valid Image data structure. By default, the cell referenced is A0, which contains the Image data structure returned by AcquireImage. For more information, see AcquireImage.

Fixture

Defines the ROI relative to a Fixture input or the output of a Vision Tool function's image coordinate system. Setting the ROI relative to a fixture ensures that if the fixture is rotated or translated, the ROI will be rotated or translated in relation to the fixture.

Note: The default setting is (0,0,0), the top leftmost corner of the image. For more information, see Fixture or Vision Tools Functions.

Row

Specifies the row offset, in image coordinates.

Column

Specifies the column offset, in image coordinates.

Theta

Specifies the orientation, in image coordinates.

Region

Also known as the region of interest or ROI, specifies the region of the image that undergoes image processing; creates a rectangular image region that can be transformed and rotated. With this parameter selected, clicking the Maximize Region button will automatically stretch the region to cover the entire image.

X

Specifies the x-offset of the origin, in fixture coordinates.

Y

Specifies the y-offset of the origin, in fixture coordinates.

High

Specifies the dimension along the region's x-axis.

Wide

Specifies the dimension along the region's y-axis.

Angle

Specifies the orientation, in fixture coordinates.

Operation

Specifies the "pixel-by-pixel" image-processing operation that will produce a greyscale or black-and-white output image.

Note: Parameters not applicable to the selected operation are dimmed or "greyed-out."

0 = Binarize (default)

Specifies a black-and-white ("binary") threshold operation that compares each input pixel with the threshold level to determine whether the output pixel is white or black. Input pixel values equal to or above the threshold value are white; values below the threshold are black.

1 = Clip

Specifies a "clipping" operation, which eliminates the extreme ends of the greyscale spectrum so that the features in the output image are more uniform. This operation compares the greyscale value of each input pixel to a minimum and a maximum:

  • If the input pixel value is equal to or exceeds the minimum or the maximum, the output pixel is assigned ("clipped" to) the minimum or maximum value, respectively.
  • If the input pixel value is within the minimum and maximum, the output pixel is assigned the value of the input pixel.

2 = Equalize

Specifies a histogram equalization operation, which extracts the histogram of the input image and spreads out the most frequent greyscale values to create a more even distribution. The result is an output image with increased contrast.

7 = Greyscale Distance

Specifies the greyscale value of each output pixel as the difference between the greyscale value of each input pixel and the threshold level (for example, if the input pixel value is 100 and the threshold is 25, then the output pixel value will be 75).

4 = Invert

Specifies an inversion of pixel values based on the 256-step greyscale (for example, inverting an input pixel value of 10 results in an output pixel value of 245). The result is an output image that is a "negative" of the input image.

6 = Threshold Range

Specifies a black-and-white ("binary") threshold operation that compares each input pixel with two threshold values (minimum and maximum) to determine whether the output pixel is white or black:

  • If the input pixel value is equal to or exceeds the minimum or the maximum, the output pixel is white.
  • If the input pixel value is within the minimum and maximum, the output pixel is black.

5 = Optical Density

Specifies an inversion of pixel values based on a logarithmic scale. The result is an output image that reveals the density of objects and features in the input image by measuring the amount of light that passes through them. Denser objects and features are represented by lighter pixels in the output image.

3 = Stretch

Specifies a stretching operation. This operation linearly "scales up" or "stretches" the greyscale values in the input image to the full 256-step greyscale. The result is an output image with increased contrast.

Minimum

Specifies the minimum greyscale value (0–255; default = 0) for the Clip and Threshold Range operations.

Maximum

Specifies the maximum greyscale value (0–255; default = 255) for the Clip and Threshold Range operations.

Threshold

Specifies the threshold levels for the Binarize and Greyscale Distance operations.

-1 (default)

Automatically computes a threshold level based on the greyscale values within the specified region.

0–255

Directly specifies the threshold, from 0 to 255.

Show

Specifies which graphical overlays are displayed on top of the image.

0 = hide all (default)

The input image region will be hidden, except when the cell containing the PointFilter function is highlighted in the spreadsheet.

1 = result graphics only

The processed image will be displayed at all times.

2 = input graphics only

The input image region will be displayed at all times.

PointFilter Outputs

Returns

An Image data structure containing the processed image, or #ERR if any of the input parameters are invalid.

PointFilter Example

In this example, various filters from PointFilter are applied to enhance the input image of a container of dental floss (below).

After inserting PointFilter into the spreadsheet, the user defines the ROI by double-clicking on the word "Region" in the property sheet, which disappears to reveal the red ROI box overlaid on the image. The user moves or resizes the box using the cursor, and clicks the OK button on the Job Edit toolbar to confirm the selection and return to the property sheet. (The selection can also be confirmed by pressing the Enter key or by double-clicking within the ROI.)

Selecting a filter from the Operation pull-down menu, accepting the default settings of the other parameters and clicking OK in the property sheet completes the configuration for this example and applies the function to the input image.

Below is the output image produced by the Binarize operation. All input pixel values equal to or above the user-set threshold are displayed as white; all values below the threshold are black.

Below is the output image produced by the Clip operation. The minimum and maximum values are set at 40 and 125, respectively. Compared with the input image, the output image below displays slightly decreased contrast, while still differentiating the object from its background. This operation is useful if glare or bright areas in the image make it difficult to extract the desired data.

Below is the output image produced by the Stretch operation, which is the opposite of the Clip operation. The minimum and maximum are scaled to the full greyscale range, with values of 0 and 255, respectively. As a result, the output image displays greater contrast than the input image.

For more information, see Property Sheet, Image, or Image.