Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/267.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C#(OpenCV)中的等效Java Mat.put()_C#_.net_Opencv_Opencvsharp - Fatal编程技术网

C#(OpenCV)中的等效Java Mat.put()

C#(OpenCV)中的等效Java Mat.put(),c#,.net,opencv,opencvsharp,C#,.net,Opencv,Opencvsharp,我在一本书(JAVA)中多次遇到这一行代码。 它似乎用硬编码的值来设置矩阵 Mat src = new Mat(4, 1, CvType.CV_32FC2); src.put(0, 0, 0, 0, img.width() - 1, 0, 0, img.height() - 1, img.width() - 1, img.height() - 1 ); 并且找不到与.put方法等价的内容。 我有最新的4个版本。方法在行和列指定的起始位置插入数据 pu

我在一本书(JAVA)中多次遇到这一行代码。 它似乎用硬编码的值来设置矩阵

Mat src = new Mat(4, 1, CvType.CV_32FC2); 
src.put(0, 0,
    0, 0, 
    img.width() - 1, 0, 
    0, img.height() - 1, 
    img.width() - 1, img.height() - 1 
); 
并且找不到与
.put
方法等价的内容。 我有最新的4个版本。

方法在
行和
列指定的起始位置插入数据

public int put(int row, int col, int[] data)
OpenCVSharp中的等效项为

Mat src = new Mat(4, 1, MatType.CV_32FC2, 
    new [] 
    {
        0, 0, 
        img.Width - 1, 0, 
        0, img.Height - 1, 
        img.Width - 1, img.Height - 1 
    });

欢迎来到S.O.请阅读教程了解如何提问。请解释你的代码。什么是“垫”和“放”?