Ask Your Question

Revision history [back]

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.