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

Function VarShapeRemap

python/mod_cvcuda/operators/OpRemap.cpp:123–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123ImageBatchVarShape VarShapeRemap(ImageBatchVarShape &src, Tensor &map, NVCVInterpolationType srcInterp,
124 NVCVInterpolationType mapInterp, NVCVRemapMapValueType mapValueType, bool alignCorners,
125 NVCVBorderType borderMode, const pyarray &borderValue, std::optional<Stream> pstream)
126{
127 ImageBatchVarShape dst = ImageBatchVarShape::Create(src.capacity());
128
129 nvcv::Size2D mapSize;
130
131 if (mapValueType == NVCV_REMAP_ABSOLUTE || mapValueType == NVCV_REMAP_ABSOLUTE_NORMALIZED)
132 {
133 auto mapAccess = nvcv::TensorDataAccessStridedImagePlanar::Create(map.exportData());
134 if (!mapAccess)
135 {
136 throw std::runtime_error("Incompatible map tensor layout");
137 }
138
139 mapSize.w = mapAccess->numCols();
140 mapSize.h = mapAccess->numRows();
141 }
142
143 for (int i = 0; i < src.numImages(); ++i)
144 {
145 if (mapValueType == NVCV_REMAP_ABSOLUTE || mapValueType == NVCV_REMAP_ABSOLUTE_NORMALIZED)
146 {
147 dst.pushBack(Image::Create(mapSize, src[i].format()));
148 }
149 else
150 {
151 dst.pushBack(Image::Create(src[i].size(), src[i].format()));
152 }
153 }
154
155 return VarShapeRemapInto(dst, src, map, srcInterp, mapInterp, mapValueType, alignCorners, borderMode, borderValue,
156 pstream);
157}
158
159} // namespace
160

Callers

nothing calls this directly

Calls 9

VarShapeRemapIntoFunction · 0.85
capacityMethod · 0.45
exportDataMethod · 0.45
numColsMethod · 0.45
numRowsMethod · 0.45
numImagesMethod · 0.45
pushBackMethod · 0.45
formatMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected