MCPcopy Create free account
hub / github.com/CVCUDA/CV-CUDA / ParseRoi

Function ParseRoi

python/mod_cvcuda/operators/OpHQResize.cpp:67–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67inline void ParseRoi(HQResizeRoiF &parsedRoi, const Roi &roi, int ndim)
68{
69 assert(ndim == 2 || ndim == 3);
70 auto roiSize = roi.size();
71 if (roiSize != static_cast<decltype(roiSize)>(2 * ndim))
72 {
73 if (ndim == 2)
74 {
75 throw std::runtime_error(
76 "Got wrong number of ROI components. For image resize, 4 integers are expected: "
77 "low_height, low_width, high_height, high_width describing the bounding box for "
78 "the input.");
79 }
80 else
81 {
82 throw std::runtime_error(
83 "Got wrong number of ROI components. For volumetric data, 6 integers are expected: "
84 "low_depth, low_height, low_width, high_depth, high_height, high_width "
85 "describing the bounding box for the input.");
86 }
87 }
88 for (int d = 0; d < ndim; d++)
89 {
90 parsedRoi.lo[d] = roi[d].cast<float>();
91 }
92 for (int d = 0; d < ndim; d++)
93 {
94 parsedRoi.hi[d] = roi[ndim + d].cast<float>();
95 }
96}
97
98class RoiHelper
99{

Callers 1

RoiHelperMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected