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
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
pub mod cudawarping {
//! # Image Warping
use crate::mod_prelude::*;
use crate::{core, sys, types};
pub mod prelude {
}
/// ## Note
/// This alternative version of [build_warp_affine_maps_2] function uses the following default values for its arguments:
/// * stream: Stream::Null()
#[inline]
pub fn build_warp_affine_maps_2_def(mut m: impl core::MatTrait, inverse: bool, dsize: core::Size, xmap: &mut impl core::GpuMatTrait, ymap: &mut impl core::GpuMatTrait) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_buildWarpAffineMaps_Mat_bool_Size_GpuMatR_GpuMatR(m.as_raw_mut_Mat(), inverse, &dsize, xmap.as_raw_mut_GpuMat(), ymap.as_raw_mut_GpuMat(), ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn build_warp_affine_maps_2(mut m: impl core::MatTrait, inverse: bool, dsize: core::Size, xmap: &mut impl core::GpuMatTrait, ymap: &mut impl core::GpuMatTrait, stream: &mut impl core::StreamTrait) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_buildWarpAffineMaps_Mat_bool_Size_GpuMatR_GpuMatR_StreamR(m.as_raw_mut_Mat(), inverse, &dsize, xmap.as_raw_mut_GpuMat(), ymap.as_raw_mut_GpuMat(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// ## Note
/// This alternative version of [build_warp_affine_maps_1] function uses the following default values for its arguments:
/// * stream: Stream::Null()
#[inline]
pub fn build_warp_affine_maps_1_def(mut m: impl core::UMatTrait, inverse: bool, dsize: core::Size, xmap: &mut impl core::GpuMatTrait, ymap: &mut impl core::GpuMatTrait) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_buildWarpAffineMaps_UMat_bool_Size_GpuMatR_GpuMatR(m.as_raw_mut_UMat(), inverse, &dsize, xmap.as_raw_mut_GpuMat(), ymap.as_raw_mut_GpuMat(), ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn build_warp_affine_maps_1(mut m: impl core::UMatTrait, inverse: bool, dsize: core::Size, xmap: &mut impl core::GpuMatTrait, ymap: &mut impl core::GpuMatTrait, stream: &mut impl core::StreamTrait) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_buildWarpAffineMaps_UMat_bool_Size_GpuMatR_GpuMatR_StreamR(m.as_raw_mut_UMat(), inverse, &dsize, xmap.as_raw_mut_GpuMat(), ymap.as_raw_mut_GpuMat(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// 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
///
/// ## Note
/// This alternative version of [build_warp_affine_maps] function uses the following default values for its arguments:
/// * stream: Stream::Null()
#[inline]
pub fn build_warp_affine_maps_def(m: &impl ToInputArray, inverse: bool, dsize: core::Size, xmap: &mut impl ToOutputArray, ymap: &mut impl ToOutputArray) -> Result<()> {
input_array_arg!(m);
output_array_arg!(xmap);
output_array_arg!(ymap);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_buildWarpAffineMaps_const__InputArrayR_bool_Size_const__OutputArrayR_const__OutputArrayR(m.as_raw__InputArray(), inverse, &dsize, xmap.as_raw__OutputArray(), ymap.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// 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()
#[inline]
pub fn build_warp_affine_maps(m: &impl ToInputArray, inverse: bool, dsize: core::Size, xmap: &mut impl ToOutputArray, ymap: &mut impl ToOutputArray, stream: &mut impl core::StreamTrait) -> Result<()> {
input_array_arg!(m);
output_array_arg!(xmap);
output_array_arg!(ymap);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_buildWarpAffineMaps_const__InputArrayR_bool_Size_const__OutputArrayR_const__OutputArrayR_StreamR(m.as_raw__InputArray(), inverse, &dsize, xmap.as_raw__OutputArray(), ymap.as_raw__OutputArray(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// ## Note
/// This alternative version of [build_warp_perspective_maps_2] function uses the following default values for its arguments:
/// * stream: Stream::Null()
#[inline]
pub fn build_warp_perspective_maps_2_def(mut m: impl core::MatTrait, inverse: bool, dsize: core::Size, xmap: &mut impl core::GpuMatTrait, ymap: &mut impl core::GpuMatTrait) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_buildWarpPerspectiveMaps_Mat_bool_Size_GpuMatR_GpuMatR(m.as_raw_mut_Mat(), inverse, &dsize, xmap.as_raw_mut_GpuMat(), ymap.as_raw_mut_GpuMat(), ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn build_warp_perspective_maps_2(mut m: impl core::MatTrait, inverse: bool, dsize: core::Size, xmap: &mut impl core::GpuMatTrait, ymap: &mut impl core::GpuMatTrait, stream: &mut impl core::StreamTrait) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_buildWarpPerspectiveMaps_Mat_bool_Size_GpuMatR_GpuMatR_StreamR(m.as_raw_mut_Mat(), inverse, &dsize, xmap.as_raw_mut_GpuMat(), ymap.as_raw_mut_GpuMat(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// ## Note
/// This alternative version of [build_warp_perspective_maps_1] function uses the following default values for its arguments:
/// * stream: Stream::Null()
#[inline]
pub fn build_warp_perspective_maps_1_def(mut m: impl core::UMatTrait, inverse: bool, dsize: core::Size, xmap: &mut impl core::GpuMatTrait, ymap: &mut impl core::GpuMatTrait) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_buildWarpPerspectiveMaps_UMat_bool_Size_GpuMatR_GpuMatR(m.as_raw_mut_UMat(), inverse, &dsize, xmap.as_raw_mut_GpuMat(), ymap.as_raw_mut_GpuMat(), ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn build_warp_perspective_maps_1(mut m: impl core::UMatTrait, inverse: bool, dsize: core::Size, xmap: &mut impl core::GpuMatTrait, ymap: &mut impl core::GpuMatTrait, stream: &mut impl core::StreamTrait) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_buildWarpPerspectiveMaps_UMat_bool_Size_GpuMatR_GpuMatR_StreamR(m.as_raw_mut_UMat(), inverse, &dsize, xmap.as_raw_mut_GpuMat(), ymap.as_raw_mut_GpuMat(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// 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
///
/// ## Note
/// This alternative version of [build_warp_perspective_maps] function uses the following default values for its arguments:
/// * stream: Stream::Null()
#[inline]
pub fn build_warp_perspective_maps_def(m: &impl ToInputArray, inverse: bool, dsize: core::Size, xmap: &mut impl ToOutputArray, ymap: &mut impl ToOutputArray) -> Result<()> {
input_array_arg!(m);
output_array_arg!(xmap);
output_array_arg!(ymap);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_buildWarpPerspectiveMaps_const__InputArrayR_bool_Size_const__OutputArrayR_const__OutputArrayR(m.as_raw__InputArray(), inverse, &dsize, xmap.as_raw__OutputArray(), ymap.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// 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()
#[inline]
pub fn build_warp_perspective_maps(m: &impl ToInputArray, inverse: bool, dsize: core::Size, xmap: &mut impl ToOutputArray, ymap: &mut impl ToOutputArray, stream: &mut impl core::StreamTrait) -> Result<()> {
input_array_arg!(m);
output_array_arg!(xmap);
output_array_arg!(ymap);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_buildWarpPerspectiveMaps_const__InputArrayR_bool_Size_const__OutputArrayR_const__OutputArrayR_StreamR(m.as_raw__InputArray(), inverse, &dsize, xmap.as_raw__OutputArray(), ymap.as_raw__OutputArray(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// 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
///
/// ## Note
/// This alternative version of [pyr_down] function uses the following default values for its arguments:
/// * stream: Stream::Null()
#[inline]
pub fn pyr_down_def(src: &impl ToInputArray, dst: &mut impl ToOutputArray) -> Result<()> {
input_array_arg!(src);
output_array_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_pyrDown_const__InputArrayR_const__OutputArrayR(src.as_raw__InputArray(), dst.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// 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()
#[inline]
pub fn pyr_down(src: &impl ToInputArray, dst: &mut impl ToOutputArray, stream: &mut impl core::StreamTrait) -> Result<()> {
input_array_arg!(src);
output_array_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_pyrDown_const__InputArrayR_const__OutputArrayR_StreamR(src.as_raw__InputArray(), dst.as_raw__OutputArray(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// 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.
///
/// ## Note
/// This alternative version of [pyr_up] function uses the following default values for its arguments:
/// * stream: Stream::Null()
#[inline]
pub fn pyr_up_def(src: &impl ToInputArray, dst: &mut impl ToOutputArray) -> Result<()> {
input_array_arg!(src);
output_array_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_pyrUp_const__InputArrayR_const__OutputArrayR(src.as_raw__InputArray(), dst.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// 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()
#[inline]
pub fn pyr_up(src: &impl ToInputArray, dst: &mut impl ToOutputArray, stream: &mut impl core::StreamTrait) -> Result<()> {
input_array_arg!(src);
output_array_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_pyrUp_const__InputArrayR_const__OutputArrayR_StreamR(src.as_raw__InputArray(), dst.as_raw__OutputArray(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// 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.
/// The extra flag WARP_RELATIVE_MAP can be ORed to the interpolation method
/// (e.g. INTER_LINEAR | WARP_RELATIVE_MAP)
/// * 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:
///
/// 
///
/// with the WARP_RELATIVE_MAP flag :
///
/// 
///
/// Values of pixels with non-integer coordinates are computed using the bilinear interpolation.
/// ## See also
/// remap
///
/// ## Note
/// This alternative version of [remap] function uses the following default values for its arguments:
/// * border_mode: BORDER_CONSTANT
/// * border_value: Scalar()
/// * stream: Stream::Null()
#[inline]
pub fn remap_def(src: &impl ToInputArray, dst: &mut impl ToOutputArray, xmap: &impl ToInputArray, ymap: &impl ToInputArray, interpolation: i32) -> Result<()> {
input_array_arg!(src);
output_array_arg!(dst);
input_array_arg!(xmap);
input_array_arg!(ymap);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_remap_const__InputArrayR_const__OutputArrayR_const__InputArrayR_const__InputArrayR_int(src.as_raw__InputArray(), dst.as_raw__OutputArray(), xmap.as_raw__InputArray(), ymap.as_raw__InputArray(), interpolation, ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// 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.
/// The extra flag WARP_RELATIVE_MAP can be ORed to the interpolation method
/// (e.g. INTER_LINEAR | WARP_RELATIVE_MAP)
/// * 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:
///
/// 
///
/// with the WARP_RELATIVE_MAP flag :
///
/// 
///
/// 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()
#[inline]
pub fn remap(src: &impl ToInputArray, dst: &mut impl ToOutputArray, xmap: &impl ToInputArray, ymap: &impl ToInputArray, interpolation: i32, border_mode: i32, border_value: core::Scalar, stream: &mut impl core::StreamTrait) -> Result<()> {
input_array_arg!(src);
output_array_arg!(dst);
input_array_arg!(xmap);
input_array_arg!(ymap);
return_send!(via ocvrs_return);
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, stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// 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:
/// 
/// 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:
/// 
/// * fy: Scale factor along the vertical axis. If it is zero, it is computed as:
/// 
/// * interpolation: Interpolation method. INTER_NEAREST , INTER_LINEAR and INTER_CUBIC are
/// supported for now.
/// * stream: Stream for the asynchronous version.
/// ## See also
/// resize
///
/// ## Note
/// This alternative version of [resize] function uses the following default values for its arguments:
/// * fx: 0
/// * fy: 0
/// * interpolation: INTER_LINEAR
/// * stream: Stream::Null()
#[inline]
pub fn resize_def(src: &impl ToInputArray, dst: &mut impl ToOutputArray, dsize: core::Size) -> Result<()> {
input_array_arg!(src);
output_array_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_resize_const__InputArrayR_const__OutputArrayR_Size(src.as_raw__InputArray(), dst.as_raw__OutputArray(), &dsize, ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// 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:
/// 
/// 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:
/// 
/// * fy: Scale factor along the vertical axis. If it is zero, it is computed as:
/// 
/// * 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()
#[inline]
pub fn resize(src: &impl ToInputArray, dst: &mut impl ToOutputArray, dsize: core::Size, fx: f64, fy: f64, interpolation: i32, stream: &mut impl core::StreamTrait) -> Result<()> {
input_array_arg!(src);
output_array_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_resize_const__InputArrayR_const__OutputArrayR_Size_double_double_int_StreamR(src.as_raw__InputArray(), dst.as_raw__OutputArray(), &dsize, fx, fy, interpolation, stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// 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
///
/// ## Note
/// This alternative version of [rotate] function uses the following default values for its arguments:
/// * x_shift: 0
/// * y_shift: 0
/// * interpolation: INTER_LINEAR
/// * stream: Stream::Null()
#[inline]
pub fn rotate_def(src: &impl ToInputArray, dst: &mut impl ToOutputArray, dsize: core::Size, angle: f64) -> Result<()> {
input_array_arg!(src);
output_array_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_rotate_const__InputArrayR_const__OutputArrayR_Size_double(src.as_raw__InputArray(), dst.as_raw__OutputArray(), &dsize, angle, ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// 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()
#[inline]
pub fn rotate(src: &impl ToInputArray, dst: &mut impl ToOutputArray, dsize: core::Size, angle: f64, x_shift: f64, y_shift: f64, interpolation: i32, stream: &mut impl core::StreamTrait) -> Result<()> {
input_array_arg!(src);
output_array_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_rotate_const__InputArrayR_const__OutputArrayR_Size_double_double_double_int_StreamR(src.as_raw__InputArray(), dst.as_raw__OutputArray(), &dsize, angle, x_shift, y_shift, interpolation, stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// ## Note
/// This alternative version of [warp_affine_2] function uses the following default values for its arguments:
/// * flags: INTER_LINEAR
/// * border_mode: BORDER_CONSTANT
/// * border_value: Scalar()
/// * stream: Stream::Null()
#[inline]
pub fn warp_affine_2_def(src: &impl ToInputArray, dst: &mut impl ToOutputArray, mut m: impl core::MatTrait, dsize: core::Size) -> Result<()> {
input_array_arg!(src);
output_array_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_warpAffine_const__InputArrayR_const__OutputArrayR_Mat_Size(src.as_raw__InputArray(), dst.as_raw__OutputArray(), m.as_raw_mut_Mat(), &dsize, ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// ## C++ default parameters
/// * flags: INTER_LINEAR
/// * border_mode: BORDER_CONSTANT
/// * border_value: Scalar()
/// * stream: Stream::Null()
#[inline]
pub fn warp_affine_2(src: &impl ToInputArray, dst: &mut impl ToOutputArray, mut m: impl core::MatTrait, dsize: core::Size, flags: i32, border_mode: i32, border_value: core::Scalar, stream: &mut impl core::StreamTrait) -> Result<()> {
input_array_arg!(src);
output_array_arg!(dst);
return_send!(via ocvrs_return);
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, flags, border_mode, &border_value, stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// ## Note
/// This alternative version of [warp_affine_1] function uses the following default values for its arguments:
/// * flags: INTER_LINEAR
/// * border_mode: BORDER_CONSTANT
/// * border_value: Scalar()
/// * stream: Stream::Null()
#[inline]
pub fn warp_affine_1_def(src: &impl ToInputArray, dst: &mut impl ToOutputArray, mut m: impl core::UMatTrait, dsize: core::Size) -> Result<()> {
input_array_arg!(src);
output_array_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_warpAffine_const__InputArrayR_const__OutputArrayR_UMat_Size(src.as_raw__InputArray(), dst.as_raw__OutputArray(), m.as_raw_mut_UMat(), &dsize, ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// ## C++ default parameters
/// * flags: INTER_LINEAR
/// * border_mode: BORDER_CONSTANT
/// * border_value: Scalar()
/// * stream: Stream::Null()
#[inline]
pub fn warp_affine_1(src: &impl ToInputArray, dst: &mut impl ToOutputArray, mut m: impl core::UMatTrait, dsize: core::Size, flags: i32, border_mode: i32, border_value: core::Scalar, stream: &mut impl core::StreamTrait) -> Result<()> {
input_array_arg!(src);
output_array_arg!(dst);
return_send!(via ocvrs_return);
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, flags, border_mode, &border_value, stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// 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
///
/// ## Note
/// This alternative version of [warp_affine] function uses the following default values for its arguments:
/// * flags: INTER_LINEAR
/// * border_mode: BORDER_CONSTANT
/// * border_value: Scalar()
/// * stream: Stream::Null()
#[inline]
pub fn warp_affine_def(src: &impl ToInputArray, dst: &mut impl ToOutputArray, m: &impl ToInputArray, dsize: core::Size) -> Result<()> {
input_array_arg!(src);
output_array_arg!(dst);
input_array_arg!(m);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_warpAffine_const__InputArrayR_const__OutputArrayR_const__InputArrayR_Size(src.as_raw__InputArray(), dst.as_raw__OutputArray(), m.as_raw__InputArray(), &dsize, ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// 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()
#[inline]
pub fn warp_affine(src: &impl ToInputArray, dst: &mut impl ToOutputArray, m: &impl ToInputArray, dsize: core::Size, flags: i32, border_mode: i32, border_value: core::Scalar, stream: &mut impl core::StreamTrait) -> Result<()> {
input_array_arg!(src);
output_array_arg!(dst);
input_array_arg!(m);
return_send!(via ocvrs_return);
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, flags, border_mode, &border_value, stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// ## Note
/// This alternative version of [warp_perspective_2] function uses the following default values for its arguments:
/// * flags: INTER_LINEAR
/// * border_mode: BORDER_CONSTANT
/// * border_value: Scalar()
/// * stream: Stream::Null()
#[inline]
pub fn warp_perspective_2_def(src: &impl ToInputArray, dst: &mut impl ToOutputArray, mut m: impl core::MatTrait, dsize: core::Size) -> Result<()> {
input_array_arg!(src);
output_array_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_warpPerspective_const__InputArrayR_const__OutputArrayR_Mat_Size(src.as_raw__InputArray(), dst.as_raw__OutputArray(), m.as_raw_mut_Mat(), &dsize, ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// ## C++ default parameters
/// * flags: INTER_LINEAR
/// * border_mode: BORDER_CONSTANT
/// * border_value: Scalar()
/// * stream: Stream::Null()
#[inline]
pub fn warp_perspective_2(src: &impl ToInputArray, dst: &mut impl ToOutputArray, mut m: impl core::MatTrait, dsize: core::Size, flags: i32, border_mode: i32, border_value: core::Scalar, stream: &mut impl core::StreamTrait) -> Result<()> {
input_array_arg!(src);
output_array_arg!(dst);
return_send!(via ocvrs_return);
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, flags, border_mode, &border_value, stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// ## Note
/// This alternative version of [warp_perspective_1] function uses the following default values for its arguments:
/// * flags: INTER_LINEAR
/// * border_mode: BORDER_CONSTANT
/// * border_value: Scalar()
/// * stream: Stream::Null()
#[inline]
pub fn warp_perspective_1_def(src: &impl ToInputArray, dst: &mut impl ToOutputArray, mut m: impl core::UMatTrait, dsize: core::Size) -> Result<()> {
input_array_arg!(src);
output_array_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_warpPerspective_const__InputArrayR_const__OutputArrayR_UMat_Size(src.as_raw__InputArray(), dst.as_raw__OutputArray(), m.as_raw_mut_UMat(), &dsize, ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// ## C++ default parameters
/// * flags: INTER_LINEAR
/// * border_mode: BORDER_CONSTANT
/// * border_value: Scalar()
/// * stream: Stream::Null()
#[inline]
pub fn warp_perspective_1(src: &impl ToInputArray, dst: &mut impl ToOutputArray, mut m: impl core::UMatTrait, dsize: core::Size, flags: i32, border_mode: i32, border_value: core::Scalar, stream: &mut impl core::StreamTrait) -> Result<()> {
input_array_arg!(src);
output_array_arg!(dst);
return_send!(via ocvrs_return);
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, flags, border_mode, &border_value, stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// 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
///
/// ## Note
/// This alternative version of [warp_perspective] function uses the following default values for its arguments:
/// * flags: INTER_LINEAR
/// * border_mode: BORDER_CONSTANT
/// * border_value: Scalar()
/// * stream: Stream::Null()
#[inline]
pub fn warp_perspective_def(src: &impl ToInputArray, dst: &mut impl ToOutputArray, m: &impl ToInputArray, dsize: core::Size) -> Result<()> {
input_array_arg!(src);
output_array_arg!(dst);
input_array_arg!(m);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_warpPerspective_const__InputArrayR_const__OutputArrayR_const__InputArrayR_Size(src.as_raw__InputArray(), dst.as_raw__OutputArray(), m.as_raw__InputArray(), &dsize, ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// 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()
#[inline]
pub fn warp_perspective(src: &impl ToInputArray, dst: &mut impl ToOutputArray, m: &impl ToInputArray, dsize: core::Size, flags: i32, border_mode: i32, border_value: core::Scalar, stream: &mut impl core::StreamTrait) -> Result<()> {
input_array_arg!(src);
output_array_arg!(dst);
input_array_arg!(m);
return_send!(via ocvrs_return);
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, flags, border_mode, &border_value, stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}