adeptsight image processing tools lee haney january 21, 2010
Post on 03-Jan-2016
219 Views
Preview:
TRANSCRIPT
AdeptSight Image Processing Tools
Lee HaneyJanuary 21, 2010
Background information...
I was raised in North Webster, Indiana.
Proof positive the rumor is false!!!
What are image processing tools?
• Most tools locate or measure.– Histogram/caliper– Line finder – Blob finder
• Image processing tool modifies an image.– Input image is acted upon by tool.– New image buffer is the result.– Some operations require two images.– Multiple tools can be combined.
Input Image
New Image
Operation
Why use them?
• Locator tool may be insufficient– Variably-shaped part
• Poor illumination– Uneven lighting surface
• Need to enhance or modify features
Types of image processing tools
• Assignment• Arithmetic• Logical• Filtering• Morphological• Histogram• Transform• Color matching
Tool Parameters
• Operation• Source image• Operand image• Scaling• Clipping• Data type
Scaling
• Occurs after tool operation .• Each resulting pixel is multiplied by
scale factor.• Scaling factor can range from 0-10,000• Not all operations support scaling.
Clipping
• Computations can result in new values which extend past data type boundaries.
• Performed after image processing and scaling.
• Normal clipping– Result < minimum, set output to minimum.– Result > maximum, set output to maximum.
• Absolute clipping– Absolute value of result– Result > maximum, set output to maximum.
AdeptSight 3 Considerations
• Data types– Unsigned 8-bit integer (0-255)– Signed 16-bit integer – Signed 32-bit integer – However, stick to the default 8-bit integer.
• Cannot work on color images
Types of image processing tools
• Assignment• Arithmetic• Logical• Filtering• Morphological• Histogram• Transform• Color matching
Assignment Operations
• Initialization– Output image pixels are set to constant
value.– Specify image size.
• Copy– Input image is copied to output image.
• Inversion– Input pixels are inverted (255-pixel).
• No scaling and clipping is needed.
Types of image processing tools
• Assignment
• Arithmetic• Logical• Filtering• Morphological• Histogram• Transform• Color matching
Arithmetic Operations
• Two modes for usage.– Input image and operand image.– Input image and constant.
• Addition• Subtraction• Multiplication• Division• Lightest – Maximum value used.• Darkest – Minimal value used.• Scaling and clipping are options.
Types of image processing tools
• Assignment• Arithmetic
• Logical• Filtering• Morphological• Histogram• Transform• Color matching
Logical Operations
• Requires two images of same size.• Logical operator performed on pixel by
pixel basis.• Supported operations
– AND– NAND– OR– NOR– XOR
• No scaling and clipping option.
Types of image processing tools
• Assignment• Arithmetic• Logical
• Filtering• Morphological• Histogram• Transform• Color matching
Filtering Basics
• Neighboring pixels in input image are processed to determine value of output pixel.
• Kernel specifies size of neighborhood and the weighting of each pixel.
Averaging Kernel
• Pixel from input image is replaced in output image by the average of all pixels in kernel.
• Removes noise and blurs edges.
3x3
1 1 1
1 1 1
1 1 1
5x5
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
7x7
1 1 1 1 1 1 1
1 1 1 1 1 1 1
1 1 1 1 1 1 1
1 1 1 1 1 1 1
1 1 1 1 1 1 1
1 1 1 1 1 1 1
1 1 1 1 1 1 1
Gaussian Kernel
• Acts like a low-pass filter.• Removes noise.• Blurs image.
3x3
1 2 1
2 4 2
1 2 1
5x5
2 7 12 7 2
7 31 52 31 7
12 52 127 52 12
7 31 52 31 7
2 7 12 7 2
7x7
1 1 2 2 2 1 1
1 3 4 5 4 3 1
2 4 7 8 7 4 2
2 5 8 10 8 5 2
2 4 7 8 7 4 2
1 3 4 5 4 3 1
1 1 2 2 2 1 1
Horizontal Prewitt Kernel
• Detects horizontal gradients or edges.• Typically used with absolute clipping.• May need to scale.
3x3
1 1 1
0 0 0
-1 -1 -1
Vertical Prewitt Kernel
• Detects vertical gradients or edges.• Typically used with absolute clipping.• May need to scale.
3x3
-1 0 1
-1 0 1
-1 0 1
Sobel Horizontal Kernel
• Responds to horizontal edges.• Typically use in absolute clipping mode.• May need to scale.
3x3
1 2 1
0 0 0
-1 -2 -1
5x5
1 4 7 4 1
2 10 17 10 2
0 0 0 0 0
-2 -10 -17 -10 -2
-1 -4 -7 -4 -1
7x7
1 4 9 13 9 4 1
3 11 26 34 26 11 3
3 13 30 40 30 13 3
0 0 0 0 0 0 0
-3 -13 -30 -40 -30 -13 -3
-3 -11 -26 -34 -26 -11 -3
-1 -4 -9 -13 -9 -4 -1
Sobel Vertical Kernel
• Responds to vertical edges.• Typically use in absolute clipping mode.• May need to scale.
3x3
-1 0 1
-2 0 2
-1 0 1
5x5
-1 -2 0 2 1
-4 -10 0 10 4
-7 -17 0 17 7
-4 -10 0 10 4
-1 -2 0 2 1
7x7
-1 -3 -3 0 3 3 1
-4 -11 -13 0 13 11 4
-9 -26 -30 0 30 26 9
-13 -34 -40 0 40 34 13
-9 -26 -30 0 30 26 9
-4 -11 -13 0 13 11 4
-1 -3 -3 0 3 3 1
Laplacian Kernel
• Circular gradient filter.• Highlights all edges.• Typically use in absolute clipping mode.
3x3
-1 -1 -1
-1 8 -1
-1 -1 -1
5x5
-1 -3 -4 -3 -1
-3 0 6 0 -3
-4 6 20 6 -4
-3 0 6 0 -3
-1 -3 -4 -3 -1
7x7
-2 -3 -4 -6 -4 -3 -2
-3 -5 -4 -3 -4 -5 -3
-4 -4 9 20 9 -4 -4
-6 -3 20 36 20 -3 -6
-4 -4 9 20 9 -4 -4
-3 -5 -4 -3 -4 -5 -3
-2 -3 -4 -6 -4 -3 -2
Sharpen Kernel
• Output pixels are the subtraction of the average of the input image pixels.
3x3
-1 -1 -1
-1 9 -1
-1 -1 -1
5x5
-1 -1 -1 -1 -1
-1 -1 -1 -1 -1
-1 -1 25 -1 -1
-1 -1 -1 -1 -1
-1 -1 -1 -1 -1
7x7
-1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1
-1 -1 -1 49 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1
SharpenLow Kernel
• Sharpens and smooths at the same time.
3x3
-1 -1 -1
-1 16 -1
-1 -1 -1
5x5
-1 -3 -4 -3 -1
-3 0 6 0 -3
-4 6 40 6 -4
-3 0 6 0 -3
-1 -3 -4 -3 -1
7x7
-2 -3 -4 -6 -4 -3 -2
-3 -5 -4 -3 -4 -5 -3
-4 -4 9 20 9 -4 -4
-6 -3 20 72 20 -3 -6
-4 -4 9 20 9 -4 -4
-3 -5 -4 -3 -4 -5 -3
-2 -3 -4 -6 -4 -3 -2
Median Filter
• Output pixel is equal to the input image’s neighborhood median.
• Reduces impulsive noise.• Doesn’t destroy edges by blurring as an
averaging filter does.• Non-linear filter
Custom Kernel
• Define kernel that you want.• Currently no way to define this kernel.• Not sure if this will be supported.
Types of image processing tools
• Assignment• Arithmetic• Logical• Filtering
• Morphological• Histogram• Transform• Color matching
Dilate Operation
• Output pixel is replaced by highest grey value of kernel neighborhood.
• Results in expanded of bright regions.• Operation is typically iterated.• Useful for connecting broken regions.• AdeptSight kernel is limited to 3x3.
Erode Operation
• Output pixel is replaced by lowest grey value of kernel neighborhood.
• Results in expanded of dark regions.• Operation is typically iterated.• Useful for removing thin light areas.• AdeptSight kernel is limited to 3x3.
Close Operation
• Equivalent to a dilate operation followed by an erode operation.
• Has the effect of removing small dark particles and holes
Open Operation
• Equivalent to an erode operation followed by a dilate operation.
• Has effect of removing peaks from an image, leaving only the image background.
Types of image processing tools
• Assignment• Arithmetic• Logical• Filtering• Morphological
• Histogram• Transform• Color matching
Equalization Operation
• Enhances the input image by flattening the histogram of the input image.
• Equalization is more beneficial for human viewers than machine vision.
Stretching Operation
• Increases the contrast an image.• Applies a simple piecewise linear
intensity transformation based on the input image’s histogram.
Light/Dark Threshold Operations
• Operation compares each pixel value to specified threshold.
• If light threshold, pixels >= threshold are set to max, remaining set to min.
• If dark threshold, pixels <= threshold are set to max, remaining set to min.
Types of image processing tools
• Assignment• Arithmetic• Logical• Filtering• Morphological• Histogram
• Transform• Color matching
Transform Operations
• Fast Fourier Transform (FFT) • Discrete Cosine Transform (DCT)• Results
– 1D Linear– 2D Linear – 2D Logarithmic– Histogram
• Unlikely you will use transforms.
Types of image processing tools
• Assignment• Arithmetic• Logical• Filtering• Morphological• Histogram• Transform
• Color Matching
Color Matching
• Executes on 3-band images.• Create 1 or more filters
– Specify target color as RGB or HSL– Define range in HSL coordinates
• Filters are applied to each pixel.• Resulting image can be color or
grayscale.• Segments image into similar colors
– Use locator or blob tool to locate instances.
• Be mindful of tool’s processing time.
top related