OpenCV C++11 Timeline
I am working on a project that involves working with 3D images. I am using OpenCV because they have the best multidimensional matrix support. With that in mind, many of the functionality in OpenCV is geared towards 2D matrices.
When creating matrices, the general functionality is:
(int ndims, const int* sizes, ...)
The issue with this is that it requires two lines of code; one to initialize the int pointer and another to actual create the array. Although this is a small issue, it can be solved using C++11 with std::initializer_list.
Old syntax:
int dims[] = { 12, 2, 3 };
cv::Mat mat(3, dims, CV_32FC1);
New syntax:
cv::Mat mat({ 12, 2, 3 }, CV_32FC1);
This syntax can be added to the following functions: Mat::zeros, Mat::ones, Mat constructor, Mat::create, UMat constructor, OutputArray::create.
What is the timeline for C++11 support? Any approximate date when it will be added? I noticed that OpenCV has discussed adding it in the near future according to their meeting notes.
see this post about 3dmat
Hm, that is an interesting way to do things. However, the method is a 'hack' to using multidimensional arrays. For example, I need to flip my 3D matrix along the Z dimension. This becomes very difficult to do efficiently using the channel method. (I am currently working on a flip function that works on multidimensional arrays).
I have try inrange method for 3D mat as in this post but I am not able to get data.
May be your question is Does opencv must be able to process 3D data and if yes which algorithm must be implemented?
Well, no, my question is more along the lines of "When will C++11 be implemented into OpenCV?" I do think 3D matrices are necessary in OpenCV because 3D images are very common. I am working with MRI data that is a 3D image and can even be 4D images if you factor in a time element. The fact is that a lot of the algorithms like findNonZero or flip are applicable to multidimensional matrices as well but are not implemented in OpenCV that way.