Operation Property
Applies To
Vision Objects: ImageOp
Description
Sets which image operation to perform. Some operations can determine the number of iterations by Iteration Property.
Usage
VGet Sequence.Object.Operation, var
VSet Sequence.Object.Operation, value
- Sequence
- Name of a sequence or string variable containing a sequence name.
- Object
- Name of an object or string variable containing an object name. The object must exist in the specified sequence.
- var
- Integer variable that will contain the value of the property.
- value
- Integer value or expression for the new value of the property.
Values
- 1 - Open
- Vision Constant: VISION_OPERATION_OPEN
- Performs an opening-type morphological operation. This is an erosion (3-Erode) followed by a dilation (4-Dilate). Since Erosion (3-Erode) operation can erase small image groups with the similar colors as the target object, noise, small scratches, and dirt can be removed without blurring the edges.
Set the brightness of the object against the background by Polarity property.Image before performing the operation Image after performing the operation
Iterations: 1
- 2 - Close
- Vision Constant: VISION_OPERATION_CLOSE
- Performs a closing-type morphological operation. This is a dilation (4-Dilate) followed by an erosion (3-Erode). Since Dilation (4-Dilate) operation can erase small image groups with the opposite colors as the target object, noise, small scratches, and dirt can be removed without blurring the edges.
Set the brightness of the object against the background by Polarity property.Image before performing the operation Image after performing the operation
Iterations: 1
- 3 - Erode
- Vision Constant: VISION_OPERATION_ERODE
- Performs an erosion-type morphological operation. This operation makes the object thin. It can modify the object thinner that is viewed thick in the lighting environment, and can intentionally separate the connected object. This operation can be used for separating characters as a preparation of OCR.
Set the brightness of the object against the background by Polarity property.Image before performing the operation Image after performing the operation
Iterations: 1
- 4 - Dilate
- Vision Constant: VISION_OPERATION_DILATE
- Performs a dilation-type morphological operation. This operation makes the object thick. It can modify the object thicker that is viewed thin in the lighting environment, and can intentionally connect the adjoining object. This operation can be used for connecting divided line segments as a preparation of OCR.
Set the brightness of the object against the background by Polarity property.Image before preforming the operation Image after preforming the operation
Iterations: 1
- 5 - Smooth
- Vision Constant: VISION_OPERATION_SMOOTH
- Performs a smoothing type convolution operation. This operation smooths the values of adjacent pixels and reduces the changes of pixel values when the value changes largely between adjoining pixels or so much noise is contained due to the environment of image acquisition or the settings. This operation is effective for removal of whole noise. Please be noted that the edges become blurred depending on the settings of Iterations property.
Image before performing the operation Image after performing the operation
Iterations: 20
- 6 - Sharpen1
- Vision Constant: VISION_OPERATION_SHARPEN1
- Performs a sharpen type convolution operation. This operation checks the change of brightness in vertical, horizontal, and diagonal directions and highlights edges. Sharpen the blurred image. This operation also checks the change of brightness in diagonal direction comparing to 7-Sharpen2. Therefore, edges may be more highlighted.
Image before performing the operation Image after performing the operation
Iterations: 1
- 7 - Sharpen2
- Vision Constant: VISION_OPERATION_SHARPEN2
- Performs a sharpen type convolution operation. This operation checks the change of brightness in vertical and horizontal directions and highlights edges. Sharpen the blurred image.
Image before performing the operation Image after performing the operation
Iterations: 1
- 8 - HorizEdge
- Vision Constant: VISION_OPERATION_HORIZEDGE
- Highlights horizontal edges. This operation extracts edges by the difference of brightness in vertical direction. This is available for scratch inspection in horizontal direction by combining with Blob.
In the Image after performing the operation below, the scratch on the right is highlighted since it is in horizontal direction and the other one on the left side is not highlighted much since it is in vertical direction.Image before performing the operation Image after performing the operation
Iterations: 1
- 9 - VertEdge
- Vision Constant: VISION_OPERATION_VERTEDGE
- Highlights vertical edges. This operation extracts edges by the difference of brightness in horizontal direction. This is available for scratch inspection in vertical direction by combining with Blob.
In the Image after performing the operation below, the scratch on the right is not highlighted much since it is in horizontal direction and the other one on the left side is highlighted since it is in vertical direction.Image before performing the operation Image after performing the operation
Iterations: 1
- 10 - EdgeDetect1
- Vision Constant: VISION_OPERATION_EDGEDETECT1
- Extracts edges. Perform Gaussian smoothing that applies weight at neighboring target pixel. Through smoothing, edges can be detected while removing noise. This is available for scratch inspection regardless of direction.
Image before performing the operation Image after performing the operation
Iterations: 1
- 11 - EdgeDetect2
- Vision onstant: VISION_OPERATION_EDGEDETECT2
- Extracts edges. Perform image averaging at neighboring target pixel to detect edges. Through averaging, edges can be detected while removing noise. This is available for scratch inspection regardless of direction.
Image before performing the operation Image after performing the operation
Iterations: 1
- 12 - LaPlaceEdge1
- Vision Constant: VISION_OPERATION_LAPLACE1
- Highlights edges. This operation highlights edges by quadratic differentiation of brightness value in vertical and horizontal directions. Though usage is similar to 10-EdgeDetect1and 11-EdgeDetect2, this operation can highlights edges regardless of the directions of brightness change. In addition, noise may increase since smoothing is not performed.
Image before performing the operation Image after performing the operation
Iterations: 1
- 13 - LaPlaceEdge2
- Vision Constant: VISION_OPERATION_LAPLACE2
- Highlights edges. This operation highlights edges by quadratic differentiation of brightness value in vertical, horizontal, and diagonal directions. Edges may be more highlighted since this operation also checks the change of brightness in diagonal direction in addition to 12-LaPlaceEdge1.
Image before performing the operation Image after performing the operation
Iterations: 1
- 14 - Thin
- Vision Constant: VISION_OPERATION_THIN
- Thins blobs in the image. Though this operation is similar to 3-Erode, this is a thinning process while keeping the object framework. In this operation, object area will not be disappeared and connected objects will not be separated depending on the number of Iterations.
Image before performing the operation Image after performing the operation
Iterations: 1
- 15 - Thicken
- Vision Constant: VISION_OPERATION_THICKEN
- Thickens blobs in the image. Though this operation is similar to 4-Dilate, this is a thickening process while keeping the object framework. In this operation, the object can be thicken with keeping its shape, so separated objects will not connect each other.
Image before performing the operation Image after performing the operation
Iterations: 1
- 16 - Binarize
- Vision Constant: VISION_OPERATION_BINARIZE
- Binarize the image according to the ThresholdLow and ThresholdHigh settings. Only the area with the same brightness value as the object is extracted by setting the brightness value range to ThresholdLow and ThresholdHigh. Speed and accuracy of object detection such as Geometric are improved by removing noise and other unnecessary area.
Image before performing the operation Image after performing the operation
- 17 - Rotate
- Vision Constant: VISION_OPERATION_ROTATE
- Rotates the image according to the AngleObject or RotationAngle settings. If AngleObject is "Screen", then the rotation angle is determined by RotationAngle property. Otherwise, the rotation angle is determined by Angle result of AngleObject. The rotation is counter-clockwise for positive angles. By using this operation as a preparation of OCR or CodeReader, the object can be rotated to the direction where the recognition rate increases.
Image before performing the operation Image after performing the operation
RotationAngle: 45
- 18 - FlipHoriz
- Vision Constant: VISION_OPERATION_FLIPHORIZ
- Flips the image from left to right. This operation can correct a character or workpiece shape that was flipped due to manufacturing specification of printing or molding to its original orientation.
Image before performing the operation Image after performing the operation
- 19 - FlipVert
- Vision Constant: VISION_OPERATION_FLIPVERT
- Flips the image from top to bottom. This operation can correct a character or workpiece shape that was flipped due to manufacturing specification of printing or molding to its original orientation.
Image before performing the operation Image after performing the operation
- 20 - FlipBoth
- Vision Constant: VISION_OPERATION_FLIPBOTH
- Flips the image from left to right and top to bottom. This operation can correct a character or workpiece shape that was flipped due to manufacturing specification of printing or molding to its original orientation.
Image before performing the operation Image after performing the operation
- 21 - ColorFilter
- Vision Constant: VISION_OPERATION_COLORFILTER
- Filters the image using the color models. This operation can extracts the area of specified pixel values. Unlike 16-Binarize, this operation keeps the extracted pixel values and the color of the removed area (background) can be specified to any value. Gray scale image is also available.
Image before performing the operation Image after performing the operation
Background color: 255, 255, 255
Filter color: 35, 35, 255
Allowable value: 100
- 22 - SubtractAbs
- Vision Constant: VISION_OPERATION_SUBTRACTABS
- Returns absolute difference image of ImageBuffer1 and ImageBuffer2. Subtract the pixel values of ImageBuffer1 and ImageBuffer2 to output the difference value This operation can be used for checking color changes of workpiece per image acquisition by the same camera or determination of glue or coating material application. For more details on setting of ImageBuffer1 and ImageBuffer2, refer to the corresponding pages in this manual.
ImageBuffer1 Property
ImageBuffer2 PropertyImageBuffer1/ImageBuffer2 Absolute difference image
- 23 - Zoom
- Vision constant: VISION_OPERATION_ZOOM
- Enlarges or reduces the image. This operation can correct the object size that is viewed too large or too small by enlarging or reducing the image size at the specified magnification. This is available for displaying the operation image in proper size when monitoring.
Image before performing the operation Image after performing the operation
ZoomFactor: 3
- 24 - ColorStretch
- Vision Constant: VISION_OPERATION_COLORSTRETCH
- Stretches the color values in the image between MinRGB and MaxRGB. Stretch the image histogram so that the values of MinRGB becomes"0” and MaxRGB becomes "255", and create an image with high contrast. This operation is effective for correcting small contrast image. Noise can be removed and the recognition rate increases by setting brightness value of the object to MinRGB and MaxRGB. Gray scale image is also available.
Image before performing the operation Image after performing the operation
MaxRGB: 202,202,202
MinRGB: 87,87,87
- 25 - Shift
- Vision Constant: VISION_OPERATION_SHIFT
- Shifts the image according to ShiftObject or other settings of ShiftX and ShiftY.
When ShiftObject is set to "None", shifting amount is set by ShiftX property and ShiftY property. In other cases, an image shifts according to the detection positions set by ShiftObject. This is used for image alignment when getting the difference ( for example 22-SubtractAbs).Image before performing the operation Image after performing the operation
ShiftX: 100
ShiftY: 100
- 26 - DetectFocus
- Vision Constant: VISION_OPERATION_DETECTFOCUS
- Detects a relative focus level of the image. If edges are blurred, that is if the lens is out of focus, FocusValue increases. By checking FocusValue, you can determine whether the distance between a camera and a workpiece is proper.
For focus level, refer to FocusValue result.
FocusValue ResultFocusValue: 7.265 FocusValue: 1.196
- 27 - BinarizeAdaptive
- Vision constant: VISION_OPERATION_BINARIZEADAPT
- Binarize the image according to the ThresholdBlockSize and ThresholdLevel settings. Unlike 16-Binarize , the threshold is changed for each pixel to binarize. This is available for area extraction processing of the object when the brightness values of the object are not stable in the image.
Image before preforming the operation Image after preforming the operation
Default: 1-Open
Remarks
The Operation settings can be grouped as follows:
- Morphology
- Open, Close, Erode, Dilate
- The morphological operations use gray scale image to change the image by dilating or eroding, or combination of both. The Polarity property determines which shade to operate on: Dark or Light. For example, if you have dark objects on a light background, then you should set the Polarity property to “1-DarkOnLight”. If you were to set Polarity to 2-LightOnDark for the same image, then executing Erode will look like a Dilate, because the light objects will be eroded, making the dark objects dilated. The Iterations property determines how many times to execute the operation.
- Convolution
- Smooth, Sharpen1, Sharpen2, HorizEdge, VertEdge, EdgeDetect1, EdgeDetect2, LaPlaceEdge1, LaPlaceEdge2, Thin, Thicken
- In convolution operation, perform a specific filtering to change an image. The Polarity property determines which brightness to operate on for Thin and Thicken operations. The Iterations property determines how many times to execute the operation.
- Image Manipulation
- Rotate, FlipHoriz, FlipVert, FlipBoth, Zoom, Shift
- Rotate, flip, zoom, or shift an image. You can set the rotation angle in Rotate operation, zoom ratio in Zoom operation, and shifting amount in Shift operation.
- Binarize
- Binarize
- ThresholdLow and ThresholdHigh are the boundaries for determining which gray values will be black and which values will be white. All gray values in between the thresholds will be black and all others will be white.
- BinarizeAdaptive
- This is the adaptive binarize processing that automatically calculates a proper threshold without fixing the threshold for binarization. Uses the ThresholdBlockSize and ThresholdLevel properties to perform adaptive thresholding, which changes the threshold used for binarization dynamically over the image.
- Pixel to Pixel Operation
- SubtractAbs
- Calculates the difference image (absolute value) of the image buffers set to the ImageBuffer1 property and the ImageBuffer2 property.
- Color Filter
- ColorFilter
- One or more filter colors and a background color can be taught. At runtime, the ImageOp tool checks each pixel color in the image ROI. If a pixel color is within the specified tolerance of one of the filter colors, then the pixel is unchanged. Otherwise, the pixel color is set to the specified background color.
- Color Stretch
- ColorStretch
- This operation changes the color values in an image by mapping the RGB values between MinRGB and MaxRGB to 0 to 255. The KeepRGBRatio property also affects how the values are stretched.
- Focus Level
- DetectFocus
- Detect a focus level. Detected focus level becomes FocusValue result value.
See Also
ImageOp Object, Iterations Property, MinRGB Property, MaxRGB Property, KeepRGBRatio Property, ImageBuffer1 Property, ImageBuffer2 Property