| 758 | |
| 759 | template <typename T> |
| 760 | cv::cuda::GpuMat Engine<T>::resizeKeepAspectRatioPadRightBottom(const cv::cuda::GpuMat &input, size_t height, size_t width, |
| 761 | const cv::Scalar &bgcolor) { |
| 762 | float r = std::min(width / (input.cols * 1.0), height / (input.rows * 1.0)); |
| 763 | int unpad_w = r * input.cols; |
| 764 | int unpad_h = r * input.rows; |
| 765 | cv::cuda::GpuMat re(unpad_h, unpad_w, CV_8UC3); |
| 766 | cv::cuda::resize(input, re, re.size()); |
| 767 | cv::cuda::GpuMat out(height, width, CV_8UC3, bgcolor); |
| 768 | re.copyTo(out(cv::Rect(0, 0, re.cols, re.rows))); |
| 769 | return out; |
| 770 | } |
| 771 | |
| 772 | template <typename T> |
| 773 | void Engine<T>::transformOutput(std::vector<std::vector<std::vector<T>>> &input, std::vector<std::vector<T>> &output) { |
nothing calls this directly
no outgoing calls
no test coverage detected