I think using matrix.at<type>(x,y) is not the best way to repeat through a Mat object! If I remember correctly, matrix.at<type>(x,y) will iterate from the beginning of the matrix every time you call it (I could be wrong, though). I would suggest using cv::MatIterator_
cv::Mat someMat(1, 4, CV_64F, &someData);; cv::MatIterator_<double> _it = someMat.begin<double>(); for(;_it!=someMat.end<double>(); _it++){ std::cout << *_it << std::endl; }
Dima Maligin Feb 18 '14 at 10:14 2014-02-18 10:14
source share