
I propose forEach method for cv::Mat and cv::Mat_. This is solution for the overhead of MatIterator_<_Tp>. I runs a test that micro opecode runs all over the pixel of cv::Mat_<cv::Point3_<uint8_t>>. And this implementation 40% faster than the simple pointer, 80% faster than iterator. With OpenMP, 70% faster than simple pointer, 95% faster than iterator (Core i7 920). Above all, code is more readable. My test code is here. https://gist.github.com/kazuki-ma/8285876 Thanks.
OpenCV: Open Source Computer Vision Library
Resources
- Homepage: http://opencv.org
- Docs: http://docs.opencv.org
- Q&A forum: http://answers.opencv.org
- Issue tracking: http://code.opencv.org
Contributing
Please read before starting work on a pull request: http://code.opencv.org/projects/opencv/wiki/How_to_contribute
Summary of guidelines:
- One pull request per issue;
- Choose the right base branch;
- Include tests and documentation;
- Clean up "oops" commits before submitting;
- Follow the coding style guide.
Description
Languages
C++
83.4%
Cuda
5.9%
C
3.8%
Java
2.4%
CMake
2.2%
Other
2.1%