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

Base class for image grayscaling.

This class is the base class for image grayscaling. Other classes should inherit from this class and specify RGB coefficients used for color image conversion to grayscale.

The filter accepts 24, 32, 48 and 64 bpp color images and produces 8 (if source is 24 or 32 bpp image) or 16 (if source is 48 or 64 bpp image) bpp grayscale image.

Sample usage:

// create grayscale filter (BT709) Grayscale filter = new Grayscale( 0.2125, 0.7154, 0.0721 ); // apply the filter Bitmap grayImage = filter.Apply( image );

Initial image:

Result image:

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

공개 프로퍼티들

프로퍼티 타입 설명
BlueCoefficient double
GreenCoefficient double
RedCoefficient double

공개 메소드들

메소드 설명
Grayscale ( double cr, double cg, double cb ) : System

Initializes a new instance of the Grayscale class.

보호된 메소드들

메소드 설명
ProcessFilter ( UnmanagedImage sourceData, UnmanagedImage destinationData ) : void

Process the filter on the specified image.

메소드 상세

Grayscale() 공개 메소드

Initializes a new instance of the Grayscale class.
public Grayscale ( double cr, double cg, double cb ) : System
cr double Red coefficient.
cg double Green coefficient.
cb double Blue coefficient.
리턴 System

ProcessFilter() 보호된 메소드

Process the filter on the specified image.
protected ProcessFilter ( UnmanagedImage sourceData, UnmanagedImage destinationData ) : void
sourceData UnmanagedImage Source image data.
destinationData UnmanagedImage Destination image data.
리턴 void

프로퍼티 상세

BlueCoefficient 공개적으로 프로퍼티

Portion of blue channel's value to use during conversion from RGB to grayscale.
public double BlueCoefficient
리턴 double

GreenCoefficient 공개적으로 프로퍼티

Portion of green channel's value to use during conversion from RGB to grayscale.
public double GreenCoefficient
리턴 double

RedCoefficient 공개적으로 프로퍼티

Portion of red channel's value to use during conversion from RGB to grayscale.
public double RedCoefficient
리턴 double