Updated by Vladislav Vinogradov almost 12 years ago
I use visual studio 2010 and opencv 2.4.4. It's strange to get a compile error when I try to get an iterator for SparseMat. The error message and sample code are:
<pre>
opencv2\core\mat.hpp(2284): error C2440: '<function-style-cast>' : cannot convert from 'cv::SparseMat *const ' to 'cv::SparseMatIterator_<_Tp>'
</pre>
<pre> @
int main(int argc, char* argv[]){
int sz[2] = {10, 10};
SparseMat sparse_mat(2, sz, CV_32FC1);
SparseMatIterator_<float> it = sparse_mat.begin<float>();
return 0;
}
</pre> @
<pre>
opencv2\core\mat.hpp(2284): error C2440: '<function-style-cast>' : cannot convert from 'cv::SparseMat *const ' to 'cv::SparseMatIterator_<_Tp>'
</pre>
<pre> @
int main(int argc, char* argv[]){
int sz[2] = {10, 10};
SparseMat sparse_mat(2, sz, CV_32FC1);
SparseMatIterator_<float> it = sparse_mat.begin<float>();
return 0;
}
</pre> @