本文整理汇总了C#中CvSize类的典型用法代码示例。如果您正苦于以下问题:C#CvSize类的具体用法?C#CvSize怎么用?C#CvSize使用的例子?这里精选的类代码示例或许可以为您提供帮助。
示例1:Resize
publicResize()
{
//cvResize
//指定した出力画像サイズに合うように、入力画像のサイズを変更し出力する.
//(1)画像を読み込む
using(IplImagesrc=newIplImage(Const.ImageSquare5,LoadMode.AnyColor|LoadMode.AnyDepth))
{
//(2)出力用画像領域の確保を行なう
CvSizesize=newCvSize(src.Width*2,src.Height*2);
using(IplImagedstNN=newIplImage(size,src.Depth,src.NChannels))
using(IplImagedstCubic=newIplImage(size,src.Depth,src.NChannels))
using(IplImagedstLinear=newIplImage(size,src.Depth,src.NChannels))
using(IplImagedstLanczos=newIplImage(size,src.Depth,src.NChannels))
{
//(3)画像のサイズ変更を行う
Cv.Resize(src,dstNN,Interpolation.NearestNeighbor);
Cv.Resize(src,dstCubic,Interpolation.Cubic);
Cv.Resize(src,dstLinear,Interpolation.Linear);
Cv.Resize(src,dstLanczos,Interpolation.Lanczos4);
//(4)結果を表示する
using(newCvWindow("src",src))
using(newCvWindow("dstNearestNeighbor",dstNN))
using(newCvWindow("dstCubic",dstCubic))
using(newCvWindow("dstLinear",dstLinear))
using(newCvWindow("dstLanczos4",dstLanczos))
{
Cv.WaitKey();
}
}
}
}
原文链接:
http://www.jxszl.com/biancheng/C/556829.html