| 302 | } |
| 303 | |
| 304 | const MAT ArrayAsMat( // create a MAT from a C array of doubles |
| 305 | int nrows, // in |
| 306 | int ncols, // in |
| 307 | const double* data) // in: array of doubles |
| 308 | { |
| 309 | // <double *> cast is necessary because OpenCV mat constructors |
| 310 | // don't know how to use <const double *> (they should?) |
| 311 | |
| 312 | return cv::Mat(nrows, ncols, CV_64FC1, const_cast<double*>(data)); |
| 313 | } |
| 314 | |
| 315 | MAT RoundMat( // return mat with entries rounded to integers |
| 316 | const MAT& mat) // in |