C# Class Accord.Imaging.ImageStatisticsHSL

Gather statistics about image in HSL color space.

The class is used to accumulate statistical values about images, like histogram, mean, standard deviation, etc. for each HSL color channel.

The class accepts 24 and 32 bpp color images for processing.

Sample usage:

// gather statistics ImageStatisticsHSL stat = new ImageStatisticsHSL( image ); // get saturation channel's histogram ContinuousHistogram saturation = stat.Saturation; // check mean value of saturation channel if ( saturation.Mean > 0.5 ) { // do further processing }
Datei anzeigen Open project: accord-net/framework

Public Methods

Method Description
ImageStatisticsHSL ( Bitmap image ) : System

Initializes a new instance of the ImageStatisticsHSL class.

ImageStatisticsHSL ( Bitmap image, Bitmap mask ) : System

Initializes a new instance of the ImageStatisticsHSL class.

The mask image must be a grayscale/binary (8bpp) image of the same size as the specified source image, where black pixels (value 0) correspond to areas which should be excluded from processing. So statistics is calculated only for pixels, which are none black in the mask image.

ImageStatisticsHSL ( Bitmap image, byte mask ) : System

Initializes a new instance of the ImageStatisticsHSL class.

The mask array must be of the same size as the specified source image, where 0 values correspond to areas which should be excluded from processing. So statistics is calculated only for pixels, which have none zero corresponding value in the mask.

ImageStatisticsHSL ( UnmanagedImage image ) : System

Initializes a new instance of the ImageStatisticsHSL class.

ImageStatisticsHSL ( UnmanagedImage image, UnmanagedImage mask ) : System

Initializes a new instance of the ImageStatisticsHSL class.

The mask image must be a grayscale/binary (8bpp) image of the same size as the specified source image, where black pixels (value 0) correspond to areas which should be excluded from processing. So statistics is calculated only for pixels, which are none black in the mask image.

ImageStatisticsHSL ( UnmanagedImage image, byte mask ) : System

Initializes a new instance of the ImageStatisticsHSL class.

The mask array must be of the same size as the specified source image, where 0 values correspond to areas which should be excluded from processing. So statistics is calculated only for pixels, which have none zero corresponding value in the mask.

Private Methods

Method Description
CheckMaskProperties ( PixelFormat maskFormat, Size maskSize, Size sourceImageSize ) : void
CheckSourceFormat ( PixelFormat pixelFormat ) : void
ProcessImage ( UnmanagedImage image, byte mask, int maskLineSize ) : void

Method Details

ImageStatisticsHSL() public method

Initializes a new instance of the ImageStatisticsHSL class.
Source pixel format is not supported.
public ImageStatisticsHSL ( Bitmap image ) : System
image System.Drawing.Bitmap Image to gather statistics about.
return System

ImageStatisticsHSL() public method

Initializes a new instance of the ImageStatisticsHSL class.

The mask image must be a grayscale/binary (8bpp) image of the same size as the specified source image, where black pixels (value 0) correspond to areas which should be excluded from processing. So statistics is calculated only for pixels, which are none black in the mask image.

Source pixel format is not supported. Mask image must be 8 bpp grayscale image. Mask must have the same size as the source image to get statistics for.
public ImageStatisticsHSL ( Bitmap image, Bitmap mask ) : System
image System.Drawing.Bitmap Image to gather statistics about.
mask System.Drawing.Bitmap Mask image which specifies areas to collect statistics for.
return System

ImageStatisticsHSL() public method

Initializes a new instance of the ImageStatisticsHSL class.

The mask array must be of the same size as the specified source image, where 0 values correspond to areas which should be excluded from processing. So statistics is calculated only for pixels, which have none zero corresponding value in the mask.

Source pixel format is not supported. Mask must have the same size as the source image to get statistics for.
public ImageStatisticsHSL ( Bitmap image, byte mask ) : System
image System.Drawing.Bitmap Image to gather statistics about.
mask byte Mask array which specifies areas to collect statistics for.
return System

ImageStatisticsHSL() public method

Initializes a new instance of the ImageStatisticsHSL class.
Source pixel format is not supported.
public ImageStatisticsHSL ( UnmanagedImage image ) : System
image UnmanagedImage Unmanaged image to gather statistics about.
return System

ImageStatisticsHSL() public method

Initializes a new instance of the ImageStatisticsHSL class.

The mask image must be a grayscale/binary (8bpp) image of the same size as the specified source image, where black pixels (value 0) correspond to areas which should be excluded from processing. So statistics is calculated only for pixels, which are none black in the mask image.

Source pixel format is not supported. Mask image must be 8 bpp grayscale image. Mask must have the same size as the source image to get statistics for.
public ImageStatisticsHSL ( UnmanagedImage image, UnmanagedImage mask ) : System
image UnmanagedImage Image to gather statistics about.
mask UnmanagedImage Mask image which specifies areas to collect statistics for.
return System

ImageStatisticsHSL() public method

Initializes a new instance of the ImageStatisticsHSL class.

The mask array must be of the same size as the specified source image, where 0 values correspond to areas which should be excluded from processing. So statistics is calculated only for pixels, which have none zero corresponding value in the mask.

Source pixel format is not supported. Mask must have the same size as the source image to get statistics for.
public ImageStatisticsHSL ( UnmanagedImage image, byte mask ) : System
image UnmanagedImage Image to gather statistics about.
mask byte Mask array which specifies areas to collect statistics for.
return System