SparseMat Iterator compile error (Bug #2921)
Description
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:
opencv2\core\mat.hpp(2284): error C2440: '<function-style-cast>' : cannot convert from 'cv::SparseMat *const ' to 'cv::SparseMatIterator_<_Tp>'
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; }
Associated revisions
fixed SparseMat Iterator compilation error (bug #2921)
Merge pull request #2921 from ilya-lavrenov:tapi_memop
History
Updated by Vladislav Vinogradov almost 12 years ago
Hello, Ming-Ming Cheng.
Try to use SparseMat_<float>
:
SparseMat_<float> sparse_mat(2, sz); SparseMatIterator_<float> it = sparse_mat.begin();
- Category set to core
Updated by Vladislav Vinogradov almost 12 years ago
- Assignee set to Vadim Pisarevsky
Updated by Vladislav Vinogradov almost 12 years ago
- Assignee changed from Vadim Pisarevsky to Vladislav Vinogradov
- Pull request set to https://github.com/Itseez/opencv/pull/743
Updated by Vladislav Vinogradov almost 12 years ago
- Description changed from I use visual studio 2010 and opencv 2.4.4. It's strange to get a compile ... to I use visual studio 2010 and opencv 2.4.4. It's strange to get a compile ... More
Updated by Vladislav Vinogradov almost 12 years ago
Bug was fixed in 2.4 branch.
Thanks for your report.
- Status changed from Open to Done
Updated by Ming-Ming Cheng almost 12 years ago
Thank you very much for the update.
Vladislav Vinogradov wrote:
Bug was fixed in 2.4 branch.
Thanks for your report.