### Image Pre-Processing

AutoVISION’s Image Pre-Processing algorithms are available for the following tools:

- Locate Tool (Locate Edge, Locate Blob)

- Decode Tool

- OCR Tool

- Count Tool (Blob Count)

- Measure Tool (Width Measure, Height Measure, Circle Measure, Angle Measure)

Image Pre-Processing makes it easier for the software to recognize and read characters in an image, detect features in an image, and measure width, height, and angle within an image. The Pre-Processing routine runs before the tool runs.

The Image Pre-Processing editor shown here is visible in the Decode Tool, OCR Tool, Count Tool (Blob Count), and Measure Tool’s parameters areas.

##### Separate Objects (Open)

Separate Objects (Open) uses morphological pre-processing to perform an open operation. This operation is useful when you want to separate objects from each other, such as multiple connected OCR characters that are connected and are misidentified as a single character. Once this option is selected, the editor is updated to provide parameters specific to the open operation.

Pixel Polarity selects the color of the objects you want to separate.

Iterations sets the number of times the operation is repeated on the image. The effect of the operation is increased as this value is increased. This parameter is defaulted to 1, but you will typically need to increase the number of iterations to achieve the desired effect.

Show Output Image is enabled by default. The pre-processed image will be shown within the ROI of your tool so you can see the effect of your chosen operation. You can use this option to hide the pre-processed image.

Separate Objects (Open) Example:

##### Connect Objects (Close)

Connect Objects (Close) uses morphological pre-processing to perform a close operation. This operation is useful when you want to connect objects to each other, such as multiple dot-matrix-printed OCR characters whose dots are too far apart, making it difficult to segment the characters. Once this option is selected, the editor is updated to provide parameters specific to the close operation.

Pixel Polarity selects the color of the objects you want to separate.

Iterations sets the number of times the operation is repeated on the image. The effect of the operation is increased as this value is increased. This parameter is defaulted to 1, but you will typically need to increase the number of iterations to achieve the desired effect.

Show Output Image is enabled by default. The pre-processed image will be shown within the ROI of your tool so you can see the effect of your chosen operation. You can use this option to hide the pre-processed image.

Connect Objects (Close) Example:

##### Shrink Objects (Erode)

Shrink Objects (Erode) uses morphological pre-processing to perform an erode operation. This decreases the size of objects. This operation is similar to Separate Objects in that it is typically used to separate objects that are touching. The difference is that the Separate Objects operation performs an erosion followed by a dilation, so that objects are separated but then returned to their original size. The Shrink Objects option only erodes objects. The editor options for this operation are the same as for Separate Objects.

Pixel Polarity selects the color of the objects you want to separate.

Iterations sets the number of times the operation is repeated on the image. The effect of the operation is increased as this value is increased. This parameter is defaulted to 1, but you will typically need to increase the number of iterations to achieve the desired effect.

Show Output Image is enabled by default. The pre-processed image will be shown within the ROI of your tool so you can see the effect of your chosen operation. You can use this option to hide the pre-processed image.

Shrink Objects (Erode) Example:

##### Grow Objects (Dilate)

Grow Objects (Dilate) uses morphological pre-processing to perform a dilate operation. This increases the size of objects. This operation is similar to Connect Objects option in that it is typically used to connect objects. The difference is that the Connect Objects operation performs a dilation followed by an erosion, so that objects are connected but then returned to their original size. The Grow Objects option only dilates objects. The editor options for this operation are the same as for Connect Objects

Pixel Polarity selects the color of the objects you want to separate.

Iterations sets the number of times the operation is repeated on the image. The effect of the operation is increased as this value is increased. This parameter is defaulted to 1, but you will typically need to increase the number of iterations to achieve the desired effect.

Show Output Image is enabled by default. The pre-processed image will be shown within the ROI of your tool so you can see the effect of your chosen operation. You can use this option to hide the pre-processed image..

Grow Objects (Dilate) Example:

##### Gradient Image (Sobel)

Gradient Image (Sobel) performs a Sobel operation on the image, which highlights areas where there is contrast. The resulting image is dark where there is no contrast and light where there is contrast. This option is often used when trying to detect features in an area where illumination is uneven or inconsistent. Use this option with the Count Tool for applications in which trying to set a grayscale threshold is nearly impossible, and in which you need to detect objects based on their degree of contrast with the background.

Size of Neighborhood refers to the size of the kernel that is used when calculating the contrast for each pixel within the image. Choose 3x3 to detect sharper contrast, and use 5x5 and 7x7 when trying to detect contrast that is more blurry and less sharp.

Show Output Image is enabled by default. The pre-processed image will be shown within the ROI of your tool so you can see the effect of your chosen operation. You can use this option to hide the pre-processed image.

Gradient Image (Sobel) Example:

##### Smooth Noise (Mean Low Pass Filter)

This option smoothes out background “noise” by softening image contrast via a weighted neighborhood average operation. It is typically used on specular, metallic backgrounds.

Iterations sets the number of times the operation is repeated on the image. The effect of the operation is increased as this value is increased. This parameter is defaulted to 1, but you will typically need to increase the number of iterations to achieve the desired effect.

Show Output Image is enabled by default. The pre-processed image will be shown within the ROI of your tool so you can see the effect of your chosen operation. You can use this option to hide the pre-processed image.

Smooth Noise (Mean Low Pass Filter) Example: