Calculate difference between two images and threshold it.
Namespace:
AForge.Imaging.FiltersAssembly: AForge.Imaging (in AForge.Imaging.dll) Version: 2.2.5.0 (2.2.5.0)
Syntax
| C# |
|---|
public class ThresholdedDifference : BaseFilter2 |
Remarks
The filter produces similar result as applying Difference filter and then Threshold filter – thresholded difference between two images. Result of this image processing routine may be useful in motion detection applications or finding areas of significant difference.
The filter accepts 8 and 24/32color images for processing. In the case of color images, the image processing routine differences sum over 3 RGB channels (Manhattan distance), i.e. |diffR| + |diffG| + |diffB|.
Sample usage:
// create filter ThresholdedDifference filter = new ThresholdedDifference( 60 ); // apply the filter filter.OverlayImage = backgroundImage; Bitmap resultImage = filter.Apply( sourceImage );
Source image:
Background image:
Result image:
Inheritance Hierarchy
System..::.Object
AForge.Imaging.Filters..::.BaseFilter
AForge.Imaging.Filters..::.BaseFilter2
AForge.Imaging.Filters..::.ThresholdedDifference
AForge.Imaging.Filters..::.BaseFilter
AForge.Imaging.Filters..::.BaseFilter2
AForge.Imaging.Filters..::.ThresholdedDifference