本文整理汇总了C#中Emgu.CV.Mat.Reshape方法的典型用法代码示例。如果您正苦于以下问题:C# Mat.Reshape方法的具体用法?C# Mat.Reshape怎么用?C# Mat.Reshape使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Emgu.CV.Mat
的用法示例。
在下文中一共展示了Mat.Reshape方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
MCvPoint3D32f[] _points;
Mat _left = CvInvoke.Imread("imL.png", ImreadModes.Color);
Mat _right = CvInvoke.Imread("imR.png", ImreadModes.Color);
Mat disparityMap = new Mat();
Stopwatch watch = Stopwatch.StartNew();
UMat leftGray = new UMat();
UMat rightGray = new UMat();
CvInvoke.CvtColor(_left, leftGray, ColorConversion.Bgr2Gray);
CvInvoke.CvtColor(_right, rightGray, ColorConversion.Bgr2Gray);
Mat points = new Mat();
Computer3DPointsFromStereoPair(leftGray, rightGray, disparityMap, points);
watch.Stop();
long disparityComputationTime = watch.ElapsedMilliseconds;
Mat pointsArray = points.Reshape(points.NumberOfChannels, points.Rows*points.Cols);
Mat colorArray = _left.Reshape(_left.NumberOfChannels, _left.Rows*_left.Cols);
Mat colorArrayFloat = new Mat();
colorArray.ConvertTo(colorArrayFloat, DepthType.Cv32F);
WCloud cloud = new WCloud(pointsArray, colorArray);
Emgu.CV.Viz3d v = new Emgu.CV.Viz3d("Simple stereo reconstruction");
WText wtext = new WText("3d point cloud", new System.Drawing.Point(20, 20), 20, new MCvScalar(255, 255, 255));
WCoordinateSystem wCoordinate = new WCoordinateSystem(1.0);
v.ShowWidget("text", wtext);
//v.ShowWidget("coordinate", wCoordinate);
v.ShowWidget("cloud", cloud);
v.Spin();
}