| 135 | } // namespace |
| 136 | |
| 137 | void ExportOpWarpPerspective(py::module &m) |
| 138 | { |
| 139 | using namespace pybind11::literals; |
| 140 | |
| 141 | py::options options; |
| 142 | options.disable_function_signatures(); |
| 143 | |
| 144 | m.def("warp_perspective", &WarpPerspective, "src"_a, "xform"_a, "flags"_a, py::kw_only(), "border_mode"_a, |
| 145 | "border_value"_a, "stream"_a = nullptr, R"pbdoc( |
| 146 | |
| 147 | cvcuda.warp_perspective(src: cvcuda.Tensor, xform: cvcuda.Tensor, flags: int, border_mode: cvcuda.Border, border_value: numpy.ndarray, stream: Optional[cvcuda.Stream] = None) -> cvcuda.Tensor |
| 148 | |
| 149 | Executes the Warp Perspective operation on the given cuda stream. |
| 150 | |
| 151 | See also: |
| 152 | Refer to the CV-CUDA C API reference for the Warp Perspective operator |
| 153 | for more details and usage examples. |
| 154 | |
| 155 | Args: |
| 156 | src (cvcuda.Tensor): Input tensor containing one or more images. |
| 157 | xform (numpy.ndarray: 3x3 perspective transformation matrix. |
| 158 | flags (int): Combination of interpolation methods(cvcuda.Interp.NEAREST, cvcuda.Interp.LINEAR or cvcuda.Interp.CUBIC) |
| 159 | and the optional flag cvcuda.Interp.WARP_INVERSE_MAP, that sets trans_matrix as the inverse transformation. |
| 160 | border_mode (cvcuda.Border): pixel extrapolation method (cvcuda.Border.CONSTANT or |
| 161 | cvcuda.Border.REPLICATE). |
| 162 | border_value (numpy.ndarray): Used to specify values for a constant border, should be a size <= 4 and dim of 1, |
| 163 | where the values specify the border color for each color channel. |
| 164 | stream (cvcuda.Stream, optional): CUDA Stream on which to perform the operation. |
| 165 | |
| 166 | Returns: |
| 167 | cvcuda.Tensor: The output tensor. |
| 168 | |
| 169 | Caution: |
| 170 | Restrictions to several arguments may apply. Check the C |
| 171 | API references of the CV-CUDA operator. |
| 172 | )pbdoc"); |
| 173 | |
| 174 | m.def("warp_perspective_into", &WarpPerspectiveInto, "dst"_a, "src"_a, "xform"_a, "flags"_a, py::kw_only(), |
| 175 | "border_mode"_a, "border_value"_a, "stream"_a = nullptr, R"pbdoc( |
| 176 | |
| 177 | cvcuda.warp_perspective_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, xform: cvcuda.Tensor, flags: int, border_mode: cvcuda.Border, border_value: numpy.ndarray, stream: Optional[cvcuda.Stream] = None) |
| 178 | |
| 179 | Executes the Warp Perspective operation on the given cuda stream. |
| 180 | |
| 181 | See also: |
| 182 | Refer to the CV-CUDA C API reference for the Warp Perspective operator |
| 183 | for more details and usage examples. |
| 184 | |
| 185 | Args: |
| 186 | dst (cvcuda.Tensor): Output tensor to store the result of the operation. |
| 187 | src (cvcuda.Tensor): Input tensor containing one or more images. |
| 188 | xform (numpy.ndarray: 3x3 perspective transformation matrix. |
| 189 | flags (int): Combination of interpolation methods(cvcuda.Interp.NEAREST, cvcuda.Interp.LINEAR or cvcuda.Interp.CUBIC) |
| 190 | and the optional flag cvcuda.Interp.WARP_INVERSE_MAP, that sets trans_matrix as the inverse transformation. |
| 191 | border_mode (cvcuda.Border): pixel extrapolation method (cvcuda.Border.CONSTANT or |
| 192 | cvcuda.Border.REPLICATE). |
| 193 | border_value (numpy.ndarray): Used to specify values for a constant border, should be a size <= 4 and dim of 1, |
| 194 | where the values specify the border color for each color channel. |