cppflow icon indicating copy to clipboard operation
cppflow copied to clipboard

Support for cv::Mat

Open serizba opened this issue 3 years ago • 2 comments

Many people use cppflow for computer vision, and they usually work converting a cv::Mat into a std::vector, and then into a cppflow::tensor. We could directly provide a constructor and a get data function for this datatypes.

template<typename T>
  tensor(const cv::Mat<T>& m);

And probably:

template<typename T>
  cv::Mat<T> get_mat() const;

Probably both functions should be wrapped in a precompiler directive that only activates if a opencv installation is found, so non opencv users can still use the library.

This would help issues like #157

serizba avatar Sep 23 '22 11:09 serizba

Also useful for #137

serizba avatar Sep 23 '22 14:09 serizba

Would like to try and contribute on this useful feature @serizba .

yochananscharf avatar Oct 25 '22 13:10 yochananscharf