SurfaceFX

The SurfaceFX function performs feature enhancement, utilizing lighting to create a high contrast image which enhances three dimensional features on an object, for feature extraction and inspection by other Vision Tools.

The function removes noise and/or clutter from the surface's background, isolating surface features that are engraved, embossed, stamped, etched, recessed or raised, as well as defects (such as chips, dents, wrinkles, punctures and tears). Once a contrast image is generated, other Vision Tools (such as OCRMax, TrainPatMaxRedLine and FindPatMaxRedLine, DetectBlobs, SurfaceFlaw and InspectEdge) can be used for inspections and defect detection.

The SurfaceFX algorithm requires four images to be acquired, in sequence, from four individual, low angular (less than 45°) light sources. The light sources should be spaced evenly around the circumference of a circle, with the object placed under the center of the lights. During the acquisition phase, the object should remain stationary, and the lighting and image acquisition sequence must be clockwise; starting from the right quadrant of the object, followed by the bottom quadrant, then the left quadrant, and finally the top quadrant.

The algorithm will then produce a surface irregularity image, with the raised features displayed in white, and indented features displayed in black.

Note: This function is only available on In-Sight vision systems running In-Sight firmware 5.4.0 and later. For a complete list of models and supported firmware versions, see Firmware Versions.

SurfaceFX Inputs

Syntax: SurfaceFX(Right,Bottom,Left,Top,Sigma,Brightness,Contrast,Show)

   

Right, Bottom, Left, Top

These arguments must reference a spreadsheet cell that contains a valid Image or LatchImage data structure, with low angular (less than 45°) lighting from the right, bottom, left or top of the object.

  • Right = Input Image or LatchImage data structure 0, with illumination from the right (towards decreasing X)
  • Bottom = Input Image or LatchImage data structure 1, with illumination from below (towards decreasing Y)
  • Left = Input Image or LatchImage data structure 2, with illumination from the left (towards increasing X)
  • Top = Input Image or LatchImage data structure 3, with illumination from above (towards increasing Y)
Note:
  • The SurfaceFX function operates on the entire input Image data structure, whether that is an image acquired by an In-Sight camera, or an Image data structure output by another Vision Tool. Therefore, all of the input Image data structures must have the same size. Otherwise, the tool will report #ERR. For example, if each of the acquired images was processed by a Filter function, (which outputs an Image data structure) before being passed into the Surface FX function, the SurfaceFX function will use the area of the acquired image defined by the Filter function's Region parameter, and all of the Filter function's Region parameters must be set to the same dimensions and angle.
  • If using an Image data structure that is output by another Vision Tool, the function providing the Image data structure must have a rectangular image region, without curvature, and cannot use an External Region or an EditCompositeRegion. Also, the defined Region cannot undergo any curvature, or the SurfaceFX function will result in a #ERR.
  • The input Image data structures may be rotated, but the rotation of each input must be the same. Otherwise, the function will report #ERR.
  • The input Image data structures should have the same location and/or offset, but they may exhibit slight lateral movement. However, an excessive amount of lateral movement will result in a poor surface irregularity output image.
  • All four input Image data structures must be present, or the function will report #ERR.

Sigma

Specifies the smoothness value (0–10; default = 1) to help eliminate high-frequency noise in the output image.

Brightness

Specifies the average intensity (0–255; default = 128) of the background in the output image.

Contrast

Specifies the intensity difference (0–100; default = 10) between surface features and the background pixels in the output image.

Show

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

0 = hide all (default)

The available graphics items will be hidden, except when the cell containing the SurfaceFX function is highlighted in the spreadsheet.

1 = result graphics only

The processed image will be displayed at all times.

SurfaceFX Outputs

Returns

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

SurfaceFX Example

In this example, the goal is to use the SurfaceFX function to generate an output image with enhanced surface features that will be passed to a SurfaceFlaw function for further inspection. SurfaceFX requires external light sources, with a control over the light sources, to combine the lighting and image acquisition sequence. Each image should have low angular (less than 45°) lighting coming from a single quadrant of the image plane (right, bottom, left and top). As each quadrant is illuminated, an image should be acquired. Once all four images are acquired, the images can be passed into the SurfaceFX function. These images can be stored via disabling cells or using latched images.

  • This example uses four LatchImage functions that have the Event parameter set to a corresponding Button function (Latch1, Latch2, Latch3, Latch4). For more information, see LatchImage and Button.
  • Their Region parameter shares a common EditRegion function, so that each image passed into the SurfaceFX function will have the same shape and orientation. For more information, see EditRegion.
  • The images stored by the LatchImage functions are acquired with lighting from the four different directions (right, bottom, left and top) and then passed to a SurfaceFX function (A11).
  • A SurfaceFlaw function with the Image parameter referencing the Image data structure output by the SurfaceFX function performs the inspection of the object. For more information, see SurfaceFlaw

  1. For the first image, lighting from the right side is activated and an image is acquired. The Latch1 Button (cell A5) is then pressed to store the acquired image in the LatchImage cell at B5.

  2. For the second image, lighting from the bottom side is activated and an image is acquired. The Latch2 Button (cell A6) is then pressed to store the acquired image in the LatchImage cell at B6.

  3. For the third image, lighting from the left side is activated and an image is acquired. The Latch3 Button (cell A7) is then pressed to store the acquired image in the LatchImage cell at B7.

  4. For fourth image, lighting from the top side is activated and an image is acquired. The Latch4 Button (cell A8) is then pressed to store the acquired image in the LatchImage cell at B8.

  5. The SurfaceFX function then runs based on the four LatchImage data structures as input images, generating an output image with enhanced features that highlight indentations on the surface (below).

  6. Finally, the SurfaceFlaw function uses the SurfaceFX output image as its input image, detecting areas of local intensity and size variations to identify flaws in the image (below).