Calculate Euclidean difference between two images and threshold it.

The filter produces similar to ThresholdedDifference, however it uses Euclidean distance for finding difference between pixel values instead of Manhattan distance. 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.

Sample usage:

// create filter ThresholdedEuclideanDifference filter = new ThresholdedEuclideanDifference( 60 ); // apply the filter filter.OverlayImage = backgroundImage; Bitmap resultImage = filter.Apply( sourceImage );

Source image:

Background image:

Result image:

Inheritance: AForge.Imaging.Filters.BaseFilter2
Ejemplo n.º 1
0
 private Bitmap FilterImage(Bitmap image)
 {
     // Create the filters to get our difference from the background and threshold it to enhance
     ThresholdedEuclideanDifference TEDfilter = new ThresholdedEuclideanDifference(ThresVal);
     TEDfilter.OverlayImage = background;        // Sets the background of the difference filter to the global background image (set elsewhere)
     return TEDfilter.Apply(Grayscale.CommonAlgorithms.BT709.Apply(image));
 }