• yndk

    Hi, thanks for sharing the C++ code. Even not tested yet, I really appreciate it.

    Another way of using opencv matrix is like this:
    cv::Mat_ dmat(100,200); // 100×200 double matrix

    for (int r=0; r<dmat.rows; r++)
    for (int c=0; c<dmat.cols; c++)
    dmat(r,c) = value; // matrix element assigning

    Almost all the functions defined in cv::Mat are available, as written in OpenCV document.

  • yndk

    cv::Mat_\ dmat(100,200); // 100×200 double matrix

  • ngapweitham

    You can implement the core algorithm by Armadillo or Eigen, then convert them to cv::Mat, this way you should be able to share the joy of two worlds. Beware that the cv::Mat may do byte padding, when you convert the matrix of Armadillo to cv::Mat, you need to take care of it.

    ps : I prefer Eigen over Armadillo, because it is much easier to build on windows