OpenCV's Mat has a pointer to its data. Armadillo has a constructor that is capable of reading from external data. It's easy to put them together. Remember that Armadillo stores in column-major order, whereas OpenCV uses row-major. I suppose you'll need to add another step for transformation, before or after.
OpenCV's
Mathas a pointer to its data. Armadillo has a constructor that is capable of reading from external data. It's easy to put them together. Remember that Armadillo stores in column-major order, whereas OpenCV uses row-major. I suppose you'll need to add another step for transformation, before or after.The
cv::Matconstructor has a form that accepts pointer to data, andarma::mathas a function for a double* pointer to its data called memptr().So, if you'd like to convert from
arma::mattocv::Mat, this should work: