0

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.

Alex Magsam
  • 53
  • 1
  • 7

0 Answers0