本文整理汇总了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");
}
}
示例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]);
}
}
示例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;
}