本文介绍了如何在JavaCV中遍历cvMat矩阵?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have an IplImage that I converted in a Matrix, and now I want to iterate cell by cell.

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 =列

Where i = row and j = column

这篇关于如何在JavaCV中遍历cvMat矩阵?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 14:43