Thursday, April 18, 2013

armadillo to other data format conversion

Armadillo is a C++ linear algebra library, especially for computer vision application.

Armadillo is more similar to MATLAB with decent performance. (check http://nghiaho.com/?p=1726 for comparison).

We may want to cooperate Armadillo with OpenCV, STL or FFTW. In this blog the conversion between STL and OpenCV will be described.

1. armadillo to STL vector
2. Armadillo to OpenCV, Since OpenCV data is saved in row-wised, and armadillo data is saved in column-wised, therefore, when we convert the data, we may need to do transformation at first. The following is the sample code.
3. OpenCV to Armadillo

4. STL 2D vector (vector<vector<T> >) to Opencv cv::Mat 2D matrix
Hope these could be helpful for some one is seeking the answer~~



3 comments:

  1. Thank you very much for this code!

    ReplyDelete
  2. Yes, thank you it is very helpful, arma::mat <-> cv::Mat both work.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete

prettify