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

Function ExportOpRemap

python/mod_cvcuda/operators/OpRemap.cpp:161–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159} // namespace
160
161void ExportOpRemap(py::module &m)
162{
163 using namespace pybind11::literals;
164
165 m.def("remap", &Remap, "src"_a, "map"_a, "src_interp"_a = NVCV_INTERP_NEAREST, "map_interp"_a = NVCV_INTERP_NEAREST,
166 "map_type"_a = NVCV_REMAP_ABSOLUTE, "align_corners"_a = false, "border"_a = NVCV_BORDER_CONSTANT,
167 "border_value"_a = pyarray{}, py::kw_only(), "stream"_a = nullptr, R"pbdoc(
168
169 cvcuda.remap(src: cvcuda.Tensor, map: cvcuda.Tensor, src_interp: cvcuda.Interp = cvcuda.Interp.NEAREST, map_interp: cvcuda.Interp = cvcuda.Interp.NEAREST, map_type: cvcuda.Remap = cvcuda.Remap.ABSOLUTE, align_corners: bool = False, border: cvcuda.Border = cvcuda.Border.CONSTANT, border_value: numpy.ndarray = np.ndarray((0,)), stream: Optional[cvcuda.Stream] = None) -> cvcuda.Tensor
170
171 Executes the Warp Perspective operation on the given cuda stream.
172
173 See also:
174 Refer to the CV-CUDA C API reference for the Remap operator for more details and usage
175 examples.
176
177 Args:
178 src (cvcuda.Tensor): Input tensor.
179 src_interp (cvcuda.Interp, optional): Interpolation type used when fetching values
180 from the source image.
181 map_interp (cvcuda.Interp, optional): Interpolation type used when fetching values
182 from the map tensor.
183 map_type (cvcuda.Remap, optional): This determines how the values inside the map are
184 interpreted. If it is cvcuda.Remap.ABSOLUTE the map values are absolute,
185 denormalized positions in the input tensor to fetch values from. If it is
186 cvcuda.Remap.ABSOLUTE_NORMALIZED the map values are absolute, normalized
187 positions in [-1, 1] range to fetch values from the input tensor in a resolution
188 agnostic way. If it is cvcuda.Remap.RELATIVE_NORMALIZED the map values are
189 relative, normalized offsets to be applied to each output position to fetch values
190 from the input tensor, also resolution agnostic.
191 align_corners (bool, optional): The remap operation from output to input via the map
192 is done in the floating-point domain. If ``True``, they are aligned by the center
193 points of their corner pixels. Otherwise, they are aligned by the corner points of
194 their corner pixels.
195 border (cvcuda.Border, optional): pixel extrapolation method (cvcuda.Border.CONSTANT,
196 cvcuda.Border.REPLICATE, cvcuda.Border.REFLECT, cvcuda.Border.REFLECT_101, or
197 cvcuda.Border.WRAP).
198 border_value (numpy.ndarray, optional): Used to specify values for a constant border,
199 should have size <= 4 and dim of 1, where the values specify the border color for
200 each color channel.
201 stream (cvcuda.Stream, optional): CUDA Stream on which to perform the operation.
202
203 Returns:
204 cvcuda.Tensor: The output tensor.
205
206 Caution:
207 Restrictions to several arguments may apply. Check the C API references of the CV-CUDA
208 operator.
209 )pbdoc");
210 m.def("remap_into", &RemapInto, "dst"_a, "src"_a, "map"_a, "src_interp"_a = NVCV_INTERP_NEAREST,
211 "map_interp"_a = NVCV_INTERP_NEAREST, "map_type"_a = NVCV_REMAP_ABSOLUTE, "align_corners"_a = false,
212 "border"_a = NVCV_BORDER_CONSTANT, "border_value"_a = pyarray{}, py::kw_only(), "stream"_a = nullptr, R"pbdoc(
213
214 cvcuda.remap_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, map: cvcuda.Tensor, src_interp: cvcuda.Interp = cvcuda.Interp.NEAREST, map_interp: cvcuda.Interp = cvcuda.Interp.NEAREST, map_type: cvcuda.Remap = cvcuda.Remap.ABSOLUTE, align_corners: bool = False, border: cvcuda.Border = cvcuda.Border.CONSTANT, border_value: numpy.ndarray = np.ndarray((0,)), stream: Optional[cvcuda.Stream] = None)
215
216 Executes the Warp Perspective operation on the given cuda stream.
217
218 See also:

Callers 1

PYBIND11_MODULEFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected