C# Class AForge.Imaging.ImageStatisticsYCbCr

Gather statistics about image in YCbCr color space.

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

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

Sample usage:

// gather statistics ImageStatisticsYCbCr stat = new ImageStatisticsYCbCr( image ); // get Y channel's histogram ContinuousHistogram y = stat.Y; // check mean value of Y channel if ( y.Mean > 0.5 ) { // do further processing }
Exibir arquivo Open project: holisticware-admin/MonoVersal.AForgeNET Class Usage Examples

Public Methods

Method Description
ImageStatisticsYCbCr ( Bitmap image ) : System

Initializes a new instance of the ImageStatisticsYCbCr class.

ImageStatisticsYCbCr ( Bitmap image, Bitmap mask ) : System

Initializes a new instance of the ImageStatisticsYCbCr 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.

ImageStatisticsYCbCr ( Bitmap image, byte mask ) : System

Initializes a new instance of the ImageStatisticsYCbCr 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.

ImageStatisticsYCbCr ( UnmanagedImage image ) : System

Initializes a new instance of the ImageStatisticsYCbCr class.

ImageStatisticsYCbCr ( UnmanagedImage image, UnmanagedImage mask ) : System

Initializes a new instance of the ImageStatisticsYCbCr 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.

ImageStatisticsYCbCr ( UnmanagedImage image, byte mask ) : System

Initializes a new instance of the ImageStatisticsYCbCr 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

ImageStatisticsYCbCr() public method

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

ImageStatisticsYCbCr() public method

Initializes a new instance of the ImageStatisticsYCbCr 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 ImageStatisticsYCbCr ( 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

ImageStatisticsYCbCr() public method

Initializes a new instance of the ImageStatisticsYCbCr 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 ImageStatisticsYCbCr ( 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

ImageStatisticsYCbCr() public method

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

ImageStatisticsYCbCr() public method

Initializes a new instance of the ImageStatisticsYCbCr 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 ImageStatisticsYCbCr ( 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

ImageStatisticsYCbCr() public method

Initializes a new instance of the ImageStatisticsYCbCr 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 ImageStatisticsYCbCr ( 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