运算符重载 (重载运算符 +, -, *,实现图像与图像,图像与值的运算)
Image<Gray,Byte> img1;
//Do somthing to initialize img1
Image<Gray,Byte> img2;
//Do somthing to initialize img2
IMage<Gray,Byte> img3=(img1+img2-2.0)*0.5;
像素操作(赋值,取反等)
Image<Gray, Byte> img1 = new Image<Gray, Byte>(400, 300, new Gray(30));
Image<Gray, Byte> img2 = img1.Not();
Image<Gray, Byte> img3 =
img1.Convert<Byte>( delegate(Byte b) { return (Byte) (255-b); } );
Image<Gray, Single> img4 = img1.Convert<Single>(
delegate(Byte b) { return (Single) Math.cos( b * b / 255.0); } );