我正在使用SparseMat
ofCV_32FC3
并正在尝试执行以下操作:
int dims = 2;
int size[] = {10,10};
SparseMat m = SparseMat(dims, size, CV_32FC3);
m.ref<Vec3f>(2,5)[0] = 0.5;
m.ref<Vec3f>(2,5)[0] = 0.5;
m.ref<Vec3f>(2,5)[0] = 0.5;
if(m.find(2,6) == m.end()){
cout << " could not find 2,6" << endl;
}
if(m.find(2,5) != m.end()){
cout << "found 2, 5" << m.ref<Vec3f>(2,5)[0] << ", " << .ref<Vec3f>(2,5)[1] << ", " << .ref<Vec3f>(2,5)[2] << endl;
}
但是,查找部分不正确,我如何使用它来检查该索引处的元素是否已添加到稀疏垫中?
谢谢