我正在使用 EmguCV,我有一个大小为 640x480 的字节类型灰度矩阵,矩阵的每个元素都是 255 或 0。现在我需要从中制作一个图像。我找到的最好的构造函数如下所示:
Image<Gray,byte>(int width, int height, int stride, IntPtr scan0)
我从矩阵中得到了第一个、第二个和第四个参数,我发送了 640 的步幅。但它给了我一个
Access violation exception: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
我会很感激任何帮助。