I have a 2D OpenCV Mat that I need to convert to a C++ array. I have seen an example on here that converts the Mat object to a 1D array, but I feel there could be a more efficient way than Mat --> 1D array --> 2D array. Perhaps using GetRows() or GetCols() and then assigning each row or column to the new row/column in the C++ array? I am not sure if this could bypass the typical double for loop that is needed for the conversion, but I was just looking for suggestions. If there is an efficient way to convert Mat objects to 2D arrays in C++ I would like to know.
Asked
Active
Viewed 130 times
0
-
A mat already has most capabilities of a 2D array, what would you like to use this for that you cannot do with the mat itself? – Easton Bornemeier Jun 19 '17 at 20:58
-
Passing to a cuda FFT program that requires 2D data in floating-point format in a C++ array. – Alex Magsam Jun 19 '17 at 21:37