SparseMat Iterator compile error (Bug #2921)


Added by Ming-Ming Cheng almost 12 years ago. Updated almost 12 years ago.


Status:Done Start date:2013-03-26
Priority:Normal Due date:
Assignee:Vladislav Vinogradov % Done:

0%

Category:core
Target version:-
Affected version:branch '2.4' Operating System:
Difficulty: HW Platform:
Pull request:https://github.com/Itseez/opencv/pull/743

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

Revision 9d7e51eb
Added by Vladislav Vinogradov almost 12 years ago

fixed SparseMat Iterator compilation error (bug #2921)

Revision 6d253a20
Added by Alexander Alekhin over 10 years ago

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.

Also available in: Atom PDF