VIEW Vision

Keeping your VIEW current - February 17, 2020


Image Filtering

VMS has the ability to perform several different types of image filters to help make measuring easier. This can be done using the filter_image(IMAGE InputImage, INTEGER FilterType, INTEGER Radius, IMAGE OutputImage) function. The parameters for the function are as follows:

  • InputImage – The image on which the filter is going to be applied
  • FilterType – The parameter that specifies which filter to use
  • Radius – This is the size of the filter that is going to be applied to an image in pixels. For example, when running a smoothing filter with a radius of 5, this will average every pixel with all surrounding pixels within a 5-pixel radius.
  • OutputImage – The filtered image. 

There are 7 total filters that can be used with this function. Below are the 3 most commonly used ones and what they are used for.

Smoothing Filter

The smoothing filter runs a moving average filter over every pixel in an image. Every pixel is replaced with the average of its surrounding pixels. The size of the filter is specified by the radius parameter. The smoothing filter is especially useful when trying to eliminate noise in an image. The downside to this filter is that edges are smoothed out as well.

UnfilteredFrostedGlass

Original image

SmoothedFrostedGlass

Image with smoothing filter applied

Median Filter 

The median filter works similarly to the smoothing filter, but rather than replacing every pixel with the average of its surrounding pixels, it will replace it with the median value. This is especially useful for reducing sparse amounts of noise such as scratches. The median filter has the added benefit of usually preserving edges.

OriginalImageHole

Original image

MedianFilteredHole

Image with median filter applied

Contrast Filter

The contrast filter works by highlighting any areas in an image where there is a sharp edge.   This filter is useful when attempting to highlight edges, especially when the intensity of the background is unknown or variable. This filter is also very useful for defect detection.

UnFilteredPart

Original image

ContrastFilteredPart

Image with contrast filter applied

Future issues of The VIEW Vision will cover interesting topics such as off-axis sensors, feature constructions and fun with blobs. Let us know what topics you would like covered. Email your suggestions to applications@viewmm.com.

Terms of UsePrivacy PolicyVIEW PhoneVIEW Email

Quality Vision International

Copyright © 2019 Quality Vision International Inc.
All Rights Reserved.

 QVI ISO9001 Certificate

VIEW systems are manufactured by Quality Vision International in Rochester, New York.