| 34 | |
| 35 | template<typename T> |
| 36 | std::vector<T> toVector(cv::InputArray inputArray) { |
| 37 | cv::Mat_<T> mat(inputArray.getMat()); |
| 38 | if (!mat.isContinuous()) { |
| 39 | mat = mat.clone(); |
| 40 | } |
| 41 | const T* data = reinterpret_cast<T*>(mat.data); |
| 42 | return std::vector<T>(data, data + mat.total()); |
| 43 | } |
| 44 | |
| 45 | template<typename T> |
| 46 | cv::Rect_<T> fixRatio(cv::Rect_<T> rect, double ratio, bool extend) { |