本文整理汇总了C#中CvMat.SaveImage方法的典型用法代码示例。如果您正苦于以下问题:C# CvMat.SaveImage方法的具体用法?C# CvMat.SaveImage怎么用?C# CvMat.SaveImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CvMat
的用法示例。
在下文中一共展示了CvMat.SaveImage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: showrite
static void showrite(String s, CvMat image)
{
CvWindow window = new CvWindow(showiteCounter.ToString() + s);
window.ShowImage(image);
image.SaveImage(showiteCounter.ToString() + s + ".png");
showiteCounter++;
}
示例2: SaveImages
/// <summary>
/// 各Kinect情報の画像を保存する
/// </summary>
/// <param name="frameNo"></param>
/// <param name="colorPixels"></param>
/// <param name="depthBuffer"></param>
/// <param name="bodyIndexBuffer"></param>
private void SaveImages(int frameNo, ref byte[] colorPixels, ref ushort[] depthBuffer, ref byte[] bodyIndexBuffer)
{
string path = Path.Combine(this.dataDir, frameNo.ToString());
CvMat colorOrigMat = Utility.ColorArrayToCvMat(this.colorWidth, this.colorHeight, ref colorPixels);
CvMat depthMat = Utility.DpethArrayToCvMat(this.depthWidth, this.depthHeight, ref depthBuffer);
CvMat bodyIndexMat = Utility.BodyIndexArrayToCvMat(this.depthWidth, this.depthHeight, ref bodyIndexBuffer);
CvMat colorMat = new CvMat(this.colorHeight / 2, this.colorWidth / 2, MatrixType.U8C4);
Cv.Resize(colorOrigMat, colorMat, Interpolation.NearestNeighbor); // THIS IS A BOTTLENECK!!!
Task.Run(() => colorMat.SaveImage(path + "_color.jpg", new ImageEncodingParam(ImageEncodingID.JpegQuality, 85)));
Task.Run(() => depthMat.SaveImage(path + "_depth.png", new ImageEncodingParam(ImageEncodingID.PngCompression, 5)));
Task.Run(() => bodyIndexMat.SaveImage(path + "_user.png", new ImageEncodingParam(ImageEncodingID.PngCompression, 5)));
}