1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
#![allow(
	unused_parens,
	clippy::excessive_precision,
	clippy::missing_safety_doc,
	clippy::not_unsafe_ptr_arg_deref,
	clippy::should_implement_trait,
	clippy::too_many_arguments,
	clippy::unused_unit,
)]
//! # Image Warping
use crate::{mod_prelude::*, core, sys, types};
pub mod prelude {
	pub use {  };
}

/// ## C++ default parameters
/// * stream: Stream::Null()
pub fn build_warp_affine_maps_2(mut m: core::Mat, inverse: bool, dsize: core::Size, xmap: &mut core::GpuMat, ymap: &mut core::GpuMat, stream: &mut core::Stream) -> Result<()> {
	unsafe { sys::cv_cuda_buildWarpAffineMaps_Mat_bool_Size_GpuMatR_GpuMatR_StreamR(m.as_raw_mut_Mat(), inverse, dsize.opencv_as_extern(), xmap.as_raw_mut_GpuMat(), ymap.as_raw_mut_GpuMat(), stream.as_raw_mut_Stream()) }.into_result()
}

/// ## C++ default parameters
/// * stream: Stream::Null()
pub fn build_warp_affine_maps_1(mut m: core::UMat, inverse: bool, dsize: core::Size, xmap: &mut core::GpuMat, ymap: &mut core::GpuMat, stream: &mut core::Stream) -> Result<()> {
	unsafe { sys::cv_cuda_buildWarpAffineMaps_UMat_bool_Size_GpuMatR_GpuMatR_StreamR(m.as_raw_mut_UMat(), inverse, dsize.opencv_as_extern(), xmap.as_raw_mut_GpuMat(), ymap.as_raw_mut_GpuMat(), stream.as_raw_mut_Stream()) }.into_result()
}

/// Builds transformation maps for affine transformation.
/// 
/// ## Parameters
/// * M: *2x3* Mat or UMat transformation matrix.
/// * inverse: Flag specifying that M is an inverse transformation ( dst=\>src ).
/// * dsize: Size of the destination image.
/// * xmap: X values with CV_32FC1 type.
/// * ymap: Y values with CV_32FC1 type.
/// * stream: Stream for the asynchronous version.
/// ## See also
/// cuda::warpAffine , cuda::remap
/// 
/// ## C++ default parameters
/// * stream: Stream::Null()
pub fn build_warp_affine_maps(m: &dyn core::ToInputArray, inverse: bool, dsize: core::Size, xmap: &mut dyn core::ToOutputArray, ymap: &mut dyn core::ToOutputArray, stream: &mut core::Stream) -> Result<()> {
	input_array_arg!(m);
	output_array_arg!(xmap);
	output_array_arg!(ymap);
	unsafe { sys::cv_cuda_buildWarpAffineMaps_const__InputArrayR_bool_Size_const__OutputArrayR_const__OutputArrayR_StreamR(m.as_raw__InputArray(), inverse, dsize.opencv_as_extern(), xmap.as_raw__OutputArray(), ymap.as_raw__OutputArray(), stream.as_raw_mut_Stream()) }.into_result()
}

/// ## C++ default parameters
/// * stream: Stream::Null()
pub fn build_warp_perspective_maps_2(mut m: core::Mat, inverse: bool, dsize: core::Size, xmap: &mut core::GpuMat, ymap: &mut core::GpuMat, stream: &mut core::Stream) -> Result<()> {
	unsafe { sys::cv_cuda_buildWarpPerspectiveMaps_Mat_bool_Size_GpuMatR_GpuMatR_StreamR(m.as_raw_mut_Mat(), inverse, dsize.opencv_as_extern(), xmap.as_raw_mut_GpuMat(), ymap.as_raw_mut_GpuMat(), stream.as_raw_mut_Stream()) }.into_result()
}

/// ## C++ default parameters
/// * stream: Stream::Null()
pub fn build_warp_perspective_maps_1(mut m: core::UMat, inverse: bool, dsize: core::Size, xmap: &mut core::GpuMat, ymap: &mut core::GpuMat, stream: &mut core::Stream) -> Result<()> {
	unsafe { sys::cv_cuda_buildWarpPerspectiveMaps_UMat_bool_Size_GpuMatR_GpuMatR_StreamR(m.as_raw_mut_UMat(), inverse, dsize.opencv_as_extern(), xmap.as_raw_mut_GpuMat(), ymap.as_raw_mut_GpuMat(), stream.as_raw_mut_Stream()) }.into_result()
}

/// Builds transformation maps for perspective transformation.
/// 
/// ## Parameters
/// * M: *3x3* Mat or UMat transformation matrix.
/// * inverse: Flag specifying that M is an inverse transformation ( dst=\>src ).
/// * dsize: Size of the destination image.
/// * xmap: X values with CV_32FC1 type.
/// * ymap: Y values with CV_32FC1 type.
/// * stream: Stream for the asynchronous version.
/// ## See also
/// cuda::warpPerspective , cuda::remap
/// 
/// ## C++ default parameters
/// * stream: Stream::Null()
pub fn build_warp_perspective_maps(m: &dyn core::ToInputArray, inverse: bool, dsize: core::Size, xmap: &mut dyn core::ToOutputArray, ymap: &mut dyn core::ToOutputArray, stream: &mut core::Stream) -> Result<()> {
	input_array_arg!(m);
	output_array_arg!(xmap);
	output_array_arg!(ymap);
	unsafe { sys::cv_cuda_buildWarpPerspectiveMaps_const__InputArrayR_bool_Size_const__OutputArrayR_const__OutputArrayR_StreamR(m.as_raw__InputArray(), inverse, dsize.opencv_as_extern(), xmap.as_raw__OutputArray(), ymap.as_raw__OutputArray(), stream.as_raw_mut_Stream()) }.into_result()
}

/// Smoothes an image and downsamples it.
/// 
/// ## Parameters
/// * src: Source image.
/// * dst: Destination image. Will have Size((src.cols+1)/2, (src.rows+1)/2) size and the same
/// type as src .
/// * stream: Stream for the asynchronous version.
/// ## See also
/// pyrDown
/// 
/// ## C++ default parameters
/// * stream: Stream::Null()
pub fn pyr_down(src: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, stream: &mut core::Stream) -> Result<()> {
	input_array_arg!(src);
	output_array_arg!(dst);
	unsafe { sys::cv_cuda_pyrDown_const__InputArrayR_const__OutputArrayR_StreamR(src.as_raw__InputArray(), dst.as_raw__OutputArray(), stream.as_raw_mut_Stream()) }.into_result()
}

/// Upsamples an image and then smoothes it.
/// 
/// ## Parameters
/// * src: Source image.
/// * dst: Destination image. Will have Size(src.cols\*2, src.rows\*2) size and the same type as
/// src .
/// * stream: Stream for the asynchronous version.
/// 
/// ## C++ default parameters
/// * stream: Stream::Null()
pub fn pyr_up(src: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, stream: &mut core::Stream) -> Result<()> {
	input_array_arg!(src);
	output_array_arg!(dst);
	unsafe { sys::cv_cuda_pyrUp_const__InputArrayR_const__OutputArrayR_StreamR(src.as_raw__InputArray(), dst.as_raw__OutputArray(), stream.as_raw_mut_Stream()) }.into_result()
}

/// Applies a generic geometrical transformation to an image.
/// 
/// ## Parameters
/// * src: Source image.
/// * dst: Destination image with the size the same as xmap and the type the same as src .
/// * xmap: X values. Only CV_32FC1 type is supported.
/// * ymap: Y values. Only CV_32FC1 type is supported.
/// * interpolation: Interpolation method (see resize ). INTER_NEAREST , INTER_LINEAR and
/// INTER_CUBIC are supported for now.
/// * borderMode: Pixel extrapolation method (see borderInterpolate ). BORDER_REFLECT101 ,
/// BORDER_REPLICATE , BORDER_CONSTANT , BORDER_REFLECT and BORDER_WRAP are supported for now.
/// * borderValue: Value used in case of a constant border. By default, it is 0.
/// * stream: Stream for the asynchronous version.
/// 
/// The function transforms the source image using the specified map:
/// 
/// ![block formula](https://latex.codecogs.com/png.latex?%5Ctexttt%7Bdst%7D%20%28x%2Cy%29%20%3D%20%20%5Ctexttt%7Bsrc%7D%20%28xmap%28x%2Cy%29%2C%20ymap%28x%2Cy%29%29)
/// 
/// Values of pixels with non-integer coordinates are computed using the bilinear interpolation.
/// ## See also
/// remap
/// 
/// ## C++ default parameters
/// * border_mode: BORDER_CONSTANT
/// * border_value: Scalar()
/// * stream: Stream::Null()
pub fn remap(src: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, xmap: &dyn core::ToInputArray, ymap: &dyn core::ToInputArray, interpolation: i32, border_mode: i32, border_value: core::Scalar, stream: &mut core::Stream) -> Result<()> {
	input_array_arg!(src);
	output_array_arg!(dst);
	input_array_arg!(xmap);
	input_array_arg!(ymap);
	unsafe { sys::cv_cuda_remap_const__InputArrayR_const__OutputArrayR_const__InputArrayR_const__InputArrayR_int_int_Scalar_StreamR(src.as_raw__InputArray(), dst.as_raw__OutputArray(), xmap.as_raw__InputArray(), ymap.as_raw__InputArray(), interpolation, border_mode, border_value.opencv_as_extern(), stream.as_raw_mut_Stream()) }.into_result()
}

/// Resizes an image.
/// 
/// ## Parameters
/// * src: Source image.
/// * dst: Destination image with the same type as src . The size is dsize (when it is non-zero)
/// or the size is computed from src.size() , fx , and fy .
/// * dsize: Destination image size. If it is zero, it is computed as:
/// ![block formula](https://latex.codecogs.com/png.latex?%5Ctexttt%7Bdsize%20%3D%20Size%28round%28fx%2Asrc%2Ecols%29%2C%20round%28fy%2Asrc%2Erows%29%29%7D)
/// Either dsize or both fx and fy must be non-zero.
/// * fx: Scale factor along the horizontal axis. If it is zero, it is computed as:
/// ![block formula](https://latex.codecogs.com/png.latex?%5Ctexttt%7B%28double%29dsize%2Ewidth%2Fsrc%2Ecols%7D)
/// * fy: Scale factor along the vertical axis. If it is zero, it is computed as:
/// ![block formula](https://latex.codecogs.com/png.latex?%5Ctexttt%7B%28double%29dsize%2Eheight%2Fsrc%2Erows%7D)
/// * interpolation: Interpolation method. INTER_NEAREST , INTER_LINEAR and INTER_CUBIC are
/// supported for now.
/// * stream: Stream for the asynchronous version.
/// ## See also
/// resize
/// 
/// ## C++ default parameters
/// * fx: 0
/// * fy: 0
/// * interpolation: INTER_LINEAR
/// * stream: Stream::Null()
pub fn resize(src: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, dsize: core::Size, fx: f64, fy: f64, interpolation: i32, stream: &mut core::Stream) -> Result<()> {
	input_array_arg!(src);
	output_array_arg!(dst);
	unsafe { sys::cv_cuda_resize_const__InputArrayR_const__OutputArrayR_Size_double_double_int_StreamR(src.as_raw__InputArray(), dst.as_raw__OutputArray(), dsize.opencv_as_extern(), fx, fy, interpolation, stream.as_raw_mut_Stream()) }.into_result()
}

/// Rotates an image around the origin (0,0) and then shifts it.
/// 
/// ## Parameters
/// * src: Source image. Supports 1, 3 or 4 channels images with CV_8U , CV_16U or CV_32F
/// depth.
/// * dst: Destination image with the same type as src . The size is dsize .
/// * dsize: Size of the destination image.
/// * angle: Angle of rotation in degrees.
/// * xShift: Shift along the horizontal axis.
/// * yShift: Shift along the vertical axis.
/// * interpolation: Interpolation method. Only INTER_NEAREST , INTER_LINEAR , and INTER_CUBIC
/// are supported.
/// * stream: Stream for the asynchronous version.
/// ## See also
/// cuda::warpAffine
/// 
/// ## C++ default parameters
/// * x_shift: 0
/// * y_shift: 0
/// * interpolation: INTER_LINEAR
/// * stream: Stream::Null()
pub fn rotate(src: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, dsize: core::Size, angle: f64, x_shift: f64, y_shift: f64, interpolation: i32, stream: &mut core::Stream) -> Result<()> {
	input_array_arg!(src);
	output_array_arg!(dst);
	unsafe { sys::cv_cuda_rotate_const__InputArrayR_const__OutputArrayR_Size_double_double_double_int_StreamR(src.as_raw__InputArray(), dst.as_raw__OutputArray(), dsize.opencv_as_extern(), angle, x_shift, y_shift, interpolation, stream.as_raw_mut_Stream()) }.into_result()
}

/// ## C++ default parameters
/// * flags: INTER_LINEAR
/// * border_mode: BORDER_CONSTANT
/// * border_value: Scalar()
/// * stream: Stream::Null()
pub fn warp_affine_2(src: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, mut m: core::Mat, dsize: core::Size, flags: i32, border_mode: i32, border_value: core::Scalar, stream: &mut core::Stream) -> Result<()> {
	input_array_arg!(src);
	output_array_arg!(dst);
	unsafe { sys::cv_cuda_warpAffine_const__InputArrayR_const__OutputArrayR_Mat_Size_int_int_Scalar_StreamR(src.as_raw__InputArray(), dst.as_raw__OutputArray(), m.as_raw_mut_Mat(), dsize.opencv_as_extern(), flags, border_mode, border_value.opencv_as_extern(), stream.as_raw_mut_Stream()) }.into_result()
}

/// ## C++ default parameters
/// * flags: INTER_LINEAR
/// * border_mode: BORDER_CONSTANT
/// * border_value: Scalar()
/// * stream: Stream::Null()
pub fn warp_affine_1(src: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, mut m: core::UMat, dsize: core::Size, flags: i32, border_mode: i32, border_value: core::Scalar, stream: &mut core::Stream) -> Result<()> {
	input_array_arg!(src);
	output_array_arg!(dst);
	unsafe { sys::cv_cuda_warpAffine_const__InputArrayR_const__OutputArrayR_UMat_Size_int_int_Scalar_StreamR(src.as_raw__InputArray(), dst.as_raw__OutputArray(), m.as_raw_mut_UMat(), dsize.opencv_as_extern(), flags, border_mode, border_value.opencv_as_extern(), stream.as_raw_mut_Stream()) }.into_result()
}

/// Applies an affine transformation to an image.
/// 
/// ## Parameters
/// * src: Source image. CV_8U , CV_16U , CV_32S , or CV_32F depth and 1, 3, or 4 channels are
/// supported.
/// * dst: Destination image with the same type as src . The size is dsize .
/// * M: *2x3* Mat or UMat transformation matrix.
/// * dsize: Size of the destination image.
/// * flags: Combination of interpolation methods (see resize) and the optional flag
/// WARP_INVERSE_MAP specifying that M is an inverse transformation ( dst=\>src ). Only
/// INTER_NEAREST , INTER_LINEAR , and INTER_CUBIC interpolation methods are supported.
/// * borderMode: 
/// * borderValue: 
/// * stream: Stream for the asynchronous version.
/// ## See also
/// warpAffine
/// 
/// ## C++ default parameters
/// * flags: INTER_LINEAR
/// * border_mode: BORDER_CONSTANT
/// * border_value: Scalar()
/// * stream: Stream::Null()
pub fn warp_affine(src: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, m: &dyn core::ToInputArray, dsize: core::Size, flags: i32, border_mode: i32, border_value: core::Scalar, stream: &mut core::Stream) -> Result<()> {
	input_array_arg!(src);
	output_array_arg!(dst);
	input_array_arg!(m);
	unsafe { sys::cv_cuda_warpAffine_const__InputArrayR_const__OutputArrayR_const__InputArrayR_Size_int_int_Scalar_StreamR(src.as_raw__InputArray(), dst.as_raw__OutputArray(), m.as_raw__InputArray(), dsize.opencv_as_extern(), flags, border_mode, border_value.opencv_as_extern(), stream.as_raw_mut_Stream()) }.into_result()
}

/// ## C++ default parameters
/// * flags: INTER_LINEAR
/// * border_mode: BORDER_CONSTANT
/// * border_value: Scalar()
/// * stream: Stream::Null()
pub fn warp_perspective_2(src: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, mut m: core::Mat, dsize: core::Size, flags: i32, border_mode: i32, border_value: core::Scalar, stream: &mut core::Stream) -> Result<()> {
	input_array_arg!(src);
	output_array_arg!(dst);
	unsafe { sys::cv_cuda_warpPerspective_const__InputArrayR_const__OutputArrayR_Mat_Size_int_int_Scalar_StreamR(src.as_raw__InputArray(), dst.as_raw__OutputArray(), m.as_raw_mut_Mat(), dsize.opencv_as_extern(), flags, border_mode, border_value.opencv_as_extern(), stream.as_raw_mut_Stream()) }.into_result()
}

/// ## C++ default parameters
/// * flags: INTER_LINEAR
/// * border_mode: BORDER_CONSTANT
/// * border_value: Scalar()
/// * stream: Stream::Null()
pub fn warp_perspective_1(src: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, mut m: core::UMat, dsize: core::Size, flags: i32, border_mode: i32, border_value: core::Scalar, stream: &mut core::Stream) -> Result<()> {
	input_array_arg!(src);
	output_array_arg!(dst);
	unsafe { sys::cv_cuda_warpPerspective_const__InputArrayR_const__OutputArrayR_UMat_Size_int_int_Scalar_StreamR(src.as_raw__InputArray(), dst.as_raw__OutputArray(), m.as_raw_mut_UMat(), dsize.opencv_as_extern(), flags, border_mode, border_value.opencv_as_extern(), stream.as_raw_mut_Stream()) }.into_result()
}

/// Applies a perspective transformation to an image.
/// 
/// ## Parameters
/// * src: Source image. CV_8U , CV_16U , CV_32S , or CV_32F depth and 1, 3, or 4 channels are
/// supported.
/// * dst: Destination image with the same type as src . The size is dsize .
/// * M: *3x3* Mat or UMat transformation matrix.
/// * dsize: Size of the destination image.
/// * flags: Combination of interpolation methods (see resize ) and the optional flag
/// WARP_INVERSE_MAP specifying that M is the inverse transformation ( dst =\> src ). Only
/// INTER_NEAREST , INTER_LINEAR , and INTER_CUBIC interpolation methods are supported.
/// * borderMode: 
/// * borderValue: 
/// * stream: Stream for the asynchronous version.
/// ## See also
/// warpPerspective
/// 
/// ## C++ default parameters
/// * flags: INTER_LINEAR
/// * border_mode: BORDER_CONSTANT
/// * border_value: Scalar()
/// * stream: Stream::Null()
pub fn warp_perspective(src: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, m: &dyn core::ToInputArray, dsize: core::Size, flags: i32, border_mode: i32, border_value: core::Scalar, stream: &mut core::Stream) -> Result<()> {
	input_array_arg!(src);
	output_array_arg!(dst);
	input_array_arg!(m);
	unsafe { sys::cv_cuda_warpPerspective_const__InputArrayR_const__OutputArrayR_const__InputArrayR_Size_int_int_Scalar_StreamR(src.as_raw__InputArray(), dst.as_raw__OutputArray(), m.as_raw__InputArray(), dsize.opencv_as_extern(), flags, border_mode, border_value.opencv_as_extern(), stream.as_raw_mut_Stream()) }.into_result()
}