0
存在元素我使用的CV_32FC3
一個SparseMat
,我試圖做到以下幾點:OpenCV的:如何檢查是否在SparseMat
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;
}
然而,發現部分不正確,我怎麼用它來檢查如果該索引處的元素已添加到稀疏矩陣中?
由於