当前位置: 首页>>代码示例>>C#>>正文


C# Matrix.CopyTo方法代码示例

本文整理汇总了C#中Matrix.CopyTo方法的典型用法代码示例。如果您正苦于以下问题:C# Matrix.CopyTo方法的具体用法?C# Matrix.CopyTo怎么用?C# Matrix.CopyTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Matrix的用法示例。


在下文中一共展示了Matrix.CopyTo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: button1_Click

        //When clicked, the current image becomes the background image.
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            if (filterBoundariesExists)
            {
                backgroundImageExists = true;

                backgroundDepthMatrix = new Matrix<Double>(480, 640);
                depthMatrixROI.CopyTo(backgroundDepthMatrix);
                backgroundDepthMatrix.CopyTo(backgroundDepthImage);

                image3.Source = getBitmapImage(backgroundDepthImage.Bitmap);
            }
            else
            {
                MessageBox.Show("Please define ROI");
            }
        }
开发者ID:mtyan,项目名称:QU-KinectSurfaceObjectTracker,代码行数:18,代码来源:MainWindow.xaml.cs

示例2: DoAdd

        /// <summary>
        /// Adds another matrix to this matrix.
        /// </summary>
        /// <param name="other">The matrix to add to this matrix.</param>
        /// <param name="result">The matrix to store the result of the addition.</param>
        /// <exception cref="ArgumentOutOfRangeException">If the two matrices don't have the same dimensions.</exception>
        protected override void DoAdd(Matrix<double> other, Matrix<double> result)
        {
            // diagonal + diagonal = diagonal
            var diagOther = other as DiagonalMatrix;
            var diagResult = result as DiagonalMatrix;
            if (diagOther != null && diagResult != null)
            {
                Control.LinearAlgebraProvider.AddArrays(_data, diagOther._data, diagResult._data);
                return;
            }

            other.CopyTo(result);
            for (int i = 0; i < _data.Length; i++)
            {
                result.At(i, i, result.At(i, i) + _data[i]);
            }
        }
开发者ID:larzw,项目名称:mathnet-numerics,代码行数:23,代码来源:DiagonalMatrix.cs

示例3: BinaryImage


//.........这里部分代码省略.........

                    //await Dispatcher.BeginInvoke(_addImageToTheList,
                    //            mask.Mat);


                    CvInvoke.MorphologyEx(sobelMatrix, mask, MorphOp.Open, se2, new System.Drawing.Point(0, 0), 1, BorderType.Default, new MCvScalar(255, 0, 0, 255));
                    //CvInvoke.Erode(sobelMatrix, sobelMatrix, se1, new System.Drawing.Point(0, 0), 1, BorderType.Default, new MCvScalar(255, 0, 0, 255));
                    //await Dispatcher.BeginInvoke(_addImageToTheList,
                    //                mask.Mat);

                    var maskedSobel = new Matrix<byte>(image.Size);

                    for (int rowIndex = 0; rowIndex < image.Rows; rowIndex++)
                    {
                        for (int columnIndex = 0; columnIndex < image.Cols; columnIndex++)
                        {
                            maskedSobel[rowIndex, columnIndex] = ToByte(thresholdEdgeMatrix[rowIndex, columnIndex] * (mask[rowIndex, columnIndex] / 255));
                        }
                    }
                    //CvInvoke.Threshold(sobelMatrix, sobelMatrix, 160, 255, ThresholdType.Binary);

                    //await Dispatcher.BeginInvoke(_addImageToTheList,
                    //        maskedSobel.Mat);


                    //CvInvoke.Erode(sobelMatrix, sobelMatrix, aaa, new System.Drawing.Point(0, 0), 1, BorderType.Default, new MCvScalar(255, 0, 0, 255));

                    //await Dispatcher.BeginInvoke(_addImageToTheList,
                    //        sobelMatrix.Mat);

                    cannyImage.Save("canny" + number + ".bmp");

                    Matrix<byte> imageMatrix = new Matrix<byte>(image.Size);
                    image.CopyTo(imageMatrix);

                    Matrix<byte> cannyMatrix = new Matrix<byte>(cannyImage.Size);

                    //CvInvoke.Threshold(sobelMatrix, sobelMatrix, 80, 255, ThresholdType.Binary);

                    if (canny == null)
                    {
                        thresholdEdgeMatrix.CopyTo(cannyMatrix);
                    }
                    else
                    {
                        thresholdEdgeMatrix.CopyTo(cannyMatrix);
                    }




                    var skeletonMatrix = new Matrix<double>(image.Size);
                    var skeletonMatrixByte = new Matrix<byte>(image.Size);
                    //imageMatrix.Mul(cannyMatrix);

                    for (int rowIndex = 0; rowIndex < image.Rows; rowIndex++)
                    {
                        cannyMatrix[rowIndex, 0] = 255;
                        cannyMatrix[rowIndex, image.Cols - 1] = 255;
                    }

                    for (int columnIndex = 0; columnIndex < image.Cols; columnIndex++)
                    {
                        cannyMatrix[0, columnIndex] = 255;
                        cannyMatrix[image.Rows - 1, columnIndex] = 255;
                    }
开发者ID:chovik,项目名称:master-thesis,代码行数:67,代码来源:MainWindow.xaml.cs


注:本文中的Matrix.CopyTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。