C# Класс Accord.Imaging.Filters.Difference

Difference filter - get the difference between overlay and source images.

The difference filter takes two images (source and overlay images) of the same size and pixel format and produces an image, where each pixel equals to absolute difference between corresponding pixels from provided images.

The filter accepts 8 and 16 bpp grayscale images and 24, 32, 48 and 64 bpp color images for processing.

In the case if images with alpha channel are used (32 or 64 bpp), visualization of the result image may seem a bit unexpected - most probably nothing will be seen (in the case if image is displayed according to its alpha channel). This may be caused by the fact that after differencing the entire alpha channel will be zeroed (zero difference between alpha channels), what means that the resulting image will be 100% transparent.

Sample usage:

// create filter Difference filter = new Difference( overlayImage ); // apply the filter Bitmap resultImage = filter.Apply( sourceImage );

Source image:

Overlay image:

Result image:

Наследование: BaseInPlaceFilter2
Показать файл Открыть проект

Открытые методы

Метод Описание
Difference ( ) : System

Initializes a new instance of the Difference class.

Difference ( Bitmap overlayImage ) : System

Initializes a new instance of the Difference class.

Difference ( UnmanagedImage unmanagedOverlayImage ) : System

Initializes a new instance of the Difference class.

Защищенные методы

Метод Описание
ProcessFilter ( UnmanagedImage image, UnmanagedImage overlay ) : void

Process the filter on the specified image.

Приватные методы

Метод Описание
InitFormatTranslations ( ) : void

Описание методов

Difference() публичный Метод

Initializes a new instance of the Difference class.
public Difference ( ) : System
Результат System

Difference() публичный Метод

Initializes a new instance of the Difference class.
public Difference ( Bitmap overlayImage ) : System
overlayImage System.Drawing.Bitmap Overlay image.
Результат System

Difference() публичный Метод

Initializes a new instance of the Difference class.
public Difference ( UnmanagedImage unmanagedOverlayImage ) : System
unmanagedOverlayImage UnmanagedImage Unmanaged overlay image.
Результат System

ProcessFilter() защищенный Метод

Process the filter on the specified image.
protected ProcessFilter ( UnmanagedImage image, UnmanagedImage overlay ) : void
image UnmanagedImage Source image data.
overlay UnmanagedImage Overlay image data.
Результат void