MCPcopy Create free account
hub / github.com/CMU-Perceptual-Computing-Lab/openpose / cpuResize

Function cpuResize

examples/tests/resizeTest.cpp:58–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 1

resizeTestFunction · 0.85

Calls 2

resizeAndMergeCpuFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected