Exemplo n.º 1
0
        public void SetData(cv.Mat input)
        {
            //if (xSize != -1 || zSize != -1)
            //{
            //    surfaceMeshRenderableSeries.DataSeries.Clear();
            //}

            zMap = new cv.Mat(new cv.Size(input.Width, input.Height), cv.MatType.CV_32FC1);
            input.ConvertTo(zMap, cv.MatType.CV_32FC1);
            //Init(zMap.Rows, zMap.Cols);
            Init(zMap.Rows, zMap.Cols);

            Parallel.For(0, xSize, x =>
            {
                for (int z = 0; z < zSize; ++z)
                {
                    MeshDataSeries[z, x] = zMap.At <float>(x, z);

                    if (yMax < zMap.Get <float>(x, z))
                    {
                        yMax = zMap.Get <float>(x, z);
                    }
                }
            });

            double min = 0.0f, max = 0.0f;

            zMap.MinMaxLoc(out min, out max);
            surfaceMeshRenderableSeries.Maximum = max;
            surfaceMeshRenderableSeries.Minimum = min;
            //backgroundSurfaceMesh.IsVisible = false;
        }