This question is related to this one std::array<T,N> need to be fetched in another types
I have noticed that OpenCV methods that deal with sequence of points accept either cv::InputArray or const* of the point type. e.g. (cv::Point* const) When you have your points in std::array, you may depend on the const* input of the OpenCV method and call my_array.data() in order to get a pointer of the type. However, you will have to deal with the cv::Point to cv::Point2f and vice-versa problem. Furthermore, it is not really the right way.
I thought that the solution could be found in cv::InputArray where I will find iterator-based solution or at least overloads for C++ standard containers. I read its documentation and I shocked that it takes either std::vector or cv::Mat and some other Gpu data types.
The question is : How to overcome this problem? Did I miss something? in other word: How to use OpenCV with the standard container in the best way?
Aucun commentaire:
Enregistrer un commentaire