Add constructors taking initializer_list for some of OpenCV data types (#9034)
* Add a constructor taking initializer_list for Matx
* Add a constructor taking initializer list for Mat and Mat_
* Add one more method to initialize Mat to the corresponding tutorial
* Add a note how to initialize Matx
* CV_CXX_11->CV_CXX11
Add support for std::array<T, N> (#8535)
* Add support for std::array<T, N>
* Add std::array<Mat, N> support
* Remove UMat constructor with std::array parameter
This test case uses a matrix with more dimensions than columns. Without
the fix in
b45e784beb
this crashes with a segmentation fault, hangs or simply fails with wrong
values.
Currently, to select a submatrix of a N-dimensional matrix, it requires
two lines of code while only one line of code is required if using a 2D
array.
I added functionality to be able to select an N-dim submatrix using a
vector list instead of a Range pointer. This allows initializer lists to
be used for a one-line selection.
add template specialization Mat::push_back() for MatExpr paramters
extend push_back MatExpr to mat in unit test
cast to object instead of reference
test with multi-row MatExpr input
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.
This and several following commits contain the "boring" changes required
to support the new Ptr. These are changes like:
* new T -> makePtr<T> or .reset(new T) or Ptr<T>(new T)
(depending on the situation)
* p.empty() -> !p
* delete_obj -> DefaultDeleter::operator()
and similar changes that are numerous, but primitive.