Assembly: AForge.Imaging (in AForge.Imaging.dll) Version: 22.214.171.124 (126.96.36.199)
public class YCbCrReplaceChannel : BaseInPlacePartialFilter
Replaces specified YCbCr channel of color image with specified grayscale imge.
The filter is quite useful in conjunction with YCbCrExtractChannel filter (however may be used alone in some cases). Using the YCbCrExtractChannel filter it is possible to extract one of YCbCr channel, perform some image processing with it and then put it back into the original color image.
The filter accepts 24 and 32 bpp color images for processing.
// create YCbCrExtractChannel filter for channel extracting YCbCrExtractChannel extractFilter = new YCbCrExtractChannel( YCbCr.CbIndex ); // extract Cb channel Bitmap cbChannel = extractFilter.Apply( image ); // invert the channel Invert invertFilter = new Invert( ); invertFilter.ApplyInPlace( cbChannel ); // put the channel back into the source image YCbCrReplaceChannel replaceFilter = new YCbCrReplaceChannel( YCbCr.CbIndex, cbChannel ); replaceFilter.ApplyInPlace( image );