C# 클래스 Accord.Imaging.Filters.ReplaceChannel

Replace RGB channel of color imgae.

Replaces specified RGB channel of color image with specified grayscale image.

The filter is quite useful in conjunction with ExtractChannel filter (however may be used alone in some cases). Using the ExtractChannel filter it is possible to extract one of RGB channel, perform some image processing with it and then put it back into the original color image.

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

Sample usage:

// extract red channel ExtractChannel extractFilter = new ExtractChannel( RGB.R ); Bitmap channel = extractFilter.Apply( image ); // threshold channel Threshold thresholdFilter = new Threshold( 230 ); thresholdFilter.ApplyInPlace( channel ); // put the channel back ReplaceChannel replaceFilter = new ReplaceChannel( RGB.R, channel ); replaceFilter.ApplyInPlace( image );

Initial image:

Result image:

상속: BaseInPlacePartialFilter
파일 보기 프로젝트 열기: accord-net/framework 1 사용 예제들

공개 메소드들

메소드 설명
ReplaceChannel ( short channel ) : System

Initializes a new instance of the ReplaceChannel class.

ReplaceChannel ( short channel, Bitmap channelImage ) : System

Initializes a new instance of the ReplaceChannel class.

ReplaceChannel ( short channel, UnmanagedImage channelImage ) : System

Initializes a new instance of the YCbCrReplaceChannel class.

보호된 메소드들

메소드 설명
ProcessFilter ( UnmanagedImage image, Rectangle rect ) : void

Process the filter on the specified image.

비공개 메소드들

메소드 설명
ReplaceChannel ( ) : System

메소드 상세

ProcessFilter() 보호된 메소드

Process the filter on the specified image.
Channel image was not specified. Channel image size does not match source /// image size. Channel image's format does not correspond to format of the source image. Can not replace alpha channel of none ARGB image. The /// exception is throw, when alpha channel is requested to be replaced in RGB image.
protected ProcessFilter ( UnmanagedImage image, Rectangle rect ) : void
image UnmanagedImage Source image data.
rect System.Drawing.Rectangle Image rectangle for processing by the filter.
리턴 void

ReplaceChannel() 공개 메소드

Initializes a new instance of the ReplaceChannel class.
public ReplaceChannel ( short channel ) : System
channel short ARGB channel to replace.
리턴 System

ReplaceChannel() 공개 메소드

Initializes a new instance of the ReplaceChannel class.
public ReplaceChannel ( short channel, Bitmap channelImage ) : System
channel short ARGB channel to replace.
channelImage System.Drawing.Bitmap Channel image to use for replacement.
리턴 System

ReplaceChannel() 공개 메소드

Initializes a new instance of the YCbCrReplaceChannel class.
public ReplaceChannel ( short channel, UnmanagedImage channelImage ) : System
channel short RGB channel to replace.
channelImage UnmanagedImage Unmanaged channel image to use for replacement.
리턴 System