| 56 | } |
| 57 | |
| 58 | cv::Mat cpuResize(cv::Mat& img, cv::Size newSize) |
| 59 | { |
| 60 | // Upload to Source to GPU |
| 61 | float* cpuPtr = &img.at<float>(0); |
| 62 | |
| 63 | // Upload to Dest to GPU |
| 64 | cv::Mat newImg = cv::Mat(newSize,CV_32FC1,cv::Scalar(0)); |
| 65 | |
| 66 | std::vector<const float*> sourcePtrs; |
| 67 | sourcePtrs.emplace_back(cpuPtr); |
| 68 | std::array<int, 4> targetSize = {1,1,newImg.size().height,newImg.size().width}; |
| 69 | std::array<int, 4> sourceSize = {1,1,img.size().height,img.size().width}; |
| 70 | std::vector<std::array<int, 4>> sourceSizes; |
| 71 | sourceSizes.emplace_back(sourceSize); |
| 72 | op::resizeAndMergeCpu(&newImg.at<float>(0), sourcePtrs, targetSize, sourceSizes); |
| 73 | |
| 74 | return newImg; |
| 75 | } |
| 76 | |
| 77 | int resizeTest() |
| 78 | { |
no test coverage detected