我有一个在矩阵中转换的IplImage,现在我想逐个单元地迭代。

CvMat mtx = new CvMat(iplUltima);
for (int i = 0; i < 100; i++) {
     //I need something like mtx[0][i] = someValue;
}

最佳答案

我做的!!我分享:

CvMat mtx = new CvMat(iplUltima);

for (int i = 0; i < 100; i++) {
    for (int j = 0; j < 100; j++) {
         opencv_core.cvSet2D(mtx, i, j, CvScalar.ONE);
    }
}
iplUltima = new IplImage (mtx);

其中i =行,j =列

08-24 23:20