forked from twistedfall/opencv-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcudaarithm.rs
1870 lines (1784 loc) · 83.4 KB
/
cudaarithm.rs
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
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
pub mod cudaarithm {
//! # Operations on Matrices
//! # Core Operations on Matrices
//! # Per-element Operations
//! # Matrix Reductions
//! # Arithm Operations on Matrices
use crate::{mod_prelude::*, core, sys, types};
pub mod prelude {
pub use { super::LookUpTableConst, super::LookUpTable, super::DFTConst, super::DFT, super::ConvolutionConst, super::Convolution };
}
/// Returns the sum of absolute values for matrix elements.
///
/// ## Parameters
/// * src: Source image of any depth except for CV_64F .
/// * mask: optional operation mask; it must have the same size as src1 and CV_8UC1 type.
///
/// ## C++ default parameters
/// * mask: noArray()
#[inline]
pub fn abs_sum(src: &dyn core::ToInputArray, mask: &dyn core::ToInputArray) -> Result<core::Scalar> {
extern_container_arg!(src);
extern_container_arg!(mask);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_absSum_const__InputArrayR_const__InputArrayR(src.as_raw__InputArray(), mask.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Computes an absolute value of each matrix element.
///
/// ## Parameters
/// * src: Source matrix.
/// * dst: Destination matrix with the same size and type as src .
/// * stream: Stream for the asynchronous version.
/// ## See also
/// abs
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn abs(src: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src);
extern_container_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_abs_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!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Computes per-element absolute difference of two matrices (or of a matrix and scalar).
///
/// ## Parameters
/// * src1: First source matrix or scalar.
/// * src2: Second source matrix or scalar.
/// * dst: Destination matrix that has the same size and type as the input array(s).
/// * stream: Stream for the asynchronous version.
/// ## See also
/// absdiff
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn absdiff(src1: &dyn core::ToInputArray, src2: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src1);
extern_container_arg!(src2);
extern_container_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_absdiff_const__InputArrayR_const__InputArrayR_const__OutputArrayR_StreamR(src1.as_raw__InputArray(), src2.as_raw__InputArray(), dst.as_raw__OutputArray(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Computes the weighted sum of two arrays.
///
/// ## Parameters
/// * src1: First source array.
/// * alpha: Weight for the first array elements.
/// * src2: Second source array of the same size and channel number as src1 .
/// * beta: Weight for the second array elements.
/// * dst: Destination array that has the same size and number of channels as the input arrays.
/// * gamma: Scalar added to each sum.
/// * dtype: Optional depth of the destination array. When both input arrays have the same depth,
/// dtype can be set to -1, which will be equivalent to src1.depth().
/// * stream: Stream for the asynchronous version.
///
/// The function addWeighted calculates the weighted sum of two arrays as follows:
///
/// ![block formula](https://latex.codecogs.com/png.latex?%5Ctexttt%7Bdst%7D%20%28I%29%3D%20%5Ctexttt%7Bsaturate%7D%20%28%20%5Ctexttt%7Bsrc1%7D%20%28I%29%2A%20%5Ctexttt%7Balpha%7D%20%2B%20%20%5Ctexttt%7Bsrc2%7D%20%28I%29%2A%20%5Ctexttt%7Bbeta%7D%20%2B%20%20%5Ctexttt%7Bgamma%7D%20%29)
///
/// where I is a multi-dimensional index of array elements. In case of multi-channel arrays, each
/// channel is processed independently.
/// ## See also
/// addWeighted
///
/// ## C++ default parameters
/// * dtype: -1
/// * stream: Stream::Null()
#[inline]
pub fn add_weighted(src1: &dyn core::ToInputArray, alpha: f64, src2: &dyn core::ToInputArray, beta: f64, gamma: f64, dst: &mut dyn core::ToOutputArray, dtype: i32, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src1);
extern_container_arg!(src2);
extern_container_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_addWeighted_const__InputArrayR_double_const__InputArrayR_double_double_const__OutputArrayR_int_StreamR(src1.as_raw__InputArray(), alpha, src2.as_raw__InputArray(), beta, gamma, dst.as_raw__OutputArray(), dtype, stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Computes a matrix-matrix or matrix-scalar sum.
///
/// ## Parameters
/// * src1: First source matrix or scalar.
/// * src2: Second source matrix or scalar. Matrix should have the same size and type as src1 .
/// * dst: Destination matrix that has the same size and number of channels as the input array(s).
/// The depth is defined by dtype or src1 depth.
/// * mask: Optional operation mask, 8-bit single channel array, that specifies elements of the
/// destination array to be changed. The mask can be used only with single channel images.
/// * dtype: Optional depth of the output array.
/// * stream: Stream for the asynchronous version.
/// ## See also
/// add
///
/// ## C++ default parameters
/// * mask: noArray()
/// * dtype: -1
/// * stream: Stream::Null()
#[inline]
pub fn add(src1: &dyn core::ToInputArray, src2: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, mask: &dyn core::ToInputArray, dtype: i32, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src1);
extern_container_arg!(src2);
extern_container_arg!(dst);
extern_container_arg!(mask);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_add_const__InputArrayR_const__InputArrayR_const__OutputArrayR_const__InputArrayR_int_StreamR(src1.as_raw__InputArray(), src2.as_raw__InputArray(), dst.as_raw__OutputArray(), mask.as_raw__InputArray(), dtype, stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Performs a per-element bitwise conjunction of two matrices (or of matrix and scalar).
///
/// ## Parameters
/// * src1: First source matrix or scalar.
/// * src2: Second source matrix or scalar.
/// * dst: Destination matrix that has the same size and type as the input array(s).
/// * mask: Optional operation mask, 8-bit single channel array, that specifies elements of the
/// destination array to be changed. The mask can be used only with single channel images.
/// * stream: Stream for the asynchronous version.
///
/// ## C++ default parameters
/// * mask: noArray()
/// * stream: Stream::Null()
#[inline]
pub fn bitwise_and(src1: &dyn core::ToInputArray, src2: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, mask: &dyn core::ToInputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src1);
extern_container_arg!(src2);
extern_container_arg!(dst);
extern_container_arg!(mask);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_bitwise_and_const__InputArrayR_const__InputArrayR_const__OutputArrayR_const__InputArrayR_StreamR(src1.as_raw__InputArray(), src2.as_raw__InputArray(), dst.as_raw__OutputArray(), mask.as_raw__InputArray(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Performs a per-element bitwise inversion.
///
/// ## Parameters
/// * src: Source matrix.
/// * dst: Destination matrix with the same size and type as src .
/// * mask: Optional operation mask, 8-bit single channel array, that specifies elements of the
/// destination array to be changed. The mask can be used only with single channel images.
/// * stream: Stream for the asynchronous version.
///
/// ## C++ default parameters
/// * mask: noArray()
/// * stream: Stream::Null()
#[inline]
pub fn bitwise_not(src: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, mask: &dyn core::ToInputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src);
extern_container_arg!(dst);
extern_container_arg!(mask);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_bitwise_not_const__InputArrayR_const__OutputArrayR_const__InputArrayR_StreamR(src.as_raw__InputArray(), dst.as_raw__OutputArray(), mask.as_raw__InputArray(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Performs a per-element bitwise disjunction of two matrices (or of matrix and scalar).
///
/// ## Parameters
/// * src1: First source matrix or scalar.
/// * src2: Second source matrix or scalar.
/// * dst: Destination matrix that has the same size and type as the input array(s).
/// * mask: Optional operation mask, 8-bit single channel array, that specifies elements of the
/// destination array to be changed. The mask can be used only with single channel images.
/// * stream: Stream for the asynchronous version.
///
/// ## C++ default parameters
/// * mask: noArray()
/// * stream: Stream::Null()
#[inline]
pub fn bitwise_or(src1: &dyn core::ToInputArray, src2: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, mask: &dyn core::ToInputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src1);
extern_container_arg!(src2);
extern_container_arg!(dst);
extern_container_arg!(mask);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_bitwise_or_const__InputArrayR_const__InputArrayR_const__OutputArrayR_const__InputArrayR_StreamR(src1.as_raw__InputArray(), src2.as_raw__InputArray(), dst.as_raw__OutputArray(), mask.as_raw__InputArray(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Performs a per-element bitwise exclusive or operation of two matrices (or of matrix and scalar).
///
/// ## Parameters
/// * src1: First source matrix or scalar.
/// * src2: Second source matrix or scalar.
/// * dst: Destination matrix that has the same size and type as the input array(s).
/// * mask: Optional operation mask, 8-bit single channel array, that specifies elements of the
/// destination array to be changed. The mask can be used only with single channel images.
/// * stream: Stream for the asynchronous version.
///
/// ## C++ default parameters
/// * mask: noArray()
/// * stream: Stream::Null()
#[inline]
pub fn bitwise_xor(src1: &dyn core::ToInputArray, src2: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, mask: &dyn core::ToInputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src1);
extern_container_arg!(src2);
extern_container_arg!(dst);
extern_container_arg!(mask);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_bitwise_xor_const__InputArrayR_const__InputArrayR_const__OutputArrayR_const__InputArrayR_StreamR(src1.as_raw__InputArray(), src2.as_raw__InputArray(), dst.as_raw__OutputArray(), mask.as_raw__InputArray(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
///
/// ## C++ default parameters
/// * mask: noArray()
/// * stream: Stream::Null()
#[inline]
pub fn calc_abs_sum(src: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, mask: &dyn core::ToInputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src);
extern_container_arg!(dst);
extern_container_arg!(mask);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_calcAbsSum_const__InputArrayR_const__OutputArrayR_const__InputArrayR_StreamR(src.as_raw__InputArray(), dst.as_raw__OutputArray(), mask.as_raw__InputArray(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
///
/// ## C++ default parameters
/// * norm_type: NORM_L2
/// * stream: Stream::Null()
#[inline]
pub fn calc_norm_diff(src1: &dyn core::ToInputArray, src2: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, norm_type: i32, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src1);
extern_container_arg!(src2);
extern_container_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_calcNormDiff_const__InputArrayR_const__InputArrayR_const__OutputArrayR_int_StreamR(src1.as_raw__InputArray(), src2.as_raw__InputArray(), dst.as_raw__OutputArray(), norm_type, stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
///
/// ## C++ default parameters
/// * mask: noArray()
/// * stream: Stream::Null()
#[inline]
pub fn calc_norm(src: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, norm_type: i32, mask: &dyn core::ToInputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src);
extern_container_arg!(dst);
extern_container_arg!(mask);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_calcNorm_const__InputArrayR_const__OutputArrayR_int_const__InputArrayR_StreamR(src.as_raw__InputArray(), dst.as_raw__OutputArray(), norm_type, mask.as_raw__InputArray(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
///
/// ## C++ default parameters
/// * mask: noArray()
/// * stream: Stream::Null()
#[inline]
pub fn calc_sqr_sum(src: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, mask: &dyn core::ToInputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src);
extern_container_arg!(dst);
extern_container_arg!(mask);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_calcSqrSum_const__InputArrayR_const__OutputArrayR_const__InputArrayR_StreamR(src.as_raw__InputArray(), dst.as_raw__OutputArray(), mask.as_raw__InputArray(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
///
/// ## C++ default parameters
/// * mask: noArray()
/// * stream: Stream::Null()
#[inline]
pub fn calc_sum(src: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, mask: &dyn core::ToInputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src);
extern_container_arg!(dst);
extern_container_arg!(mask);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_calcSum_const__InputArrayR_const__OutputArrayR_const__InputArrayR_StreamR(src.as_raw__InputArray(), dst.as_raw__OutputArray(), mask.as_raw__InputArray(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Converts Cartesian coordinates into polar.
///
/// ## Parameters
/// * x: Source matrix containing real components ( CV_32FC1 ).
/// * y: Source matrix containing imaginary components ( CV_32FC1 ).
/// * magnitude: Destination matrix of float magnitudes ( CV_32FC1 ).
/// * angle: Destination matrix of angles ( CV_32FC1 ).
/// * angleInDegrees: Flag for angles that must be evaluated in degrees.
/// * stream: Stream for the asynchronous version.
/// ## See also
/// cartToPolar
///
/// ## C++ default parameters
/// * angle_in_degrees: false
/// * stream: Stream::Null()
#[inline]
pub fn cart_to_polar(x: &dyn core::ToInputArray, y: &dyn core::ToInputArray, magnitude: &mut dyn core::ToOutputArray, angle: &mut dyn core::ToOutputArray, angle_in_degrees: bool, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(x);
extern_container_arg!(y);
extern_container_arg!(magnitude);
extern_container_arg!(angle);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_cartToPolar_const__InputArrayR_const__InputArrayR_const__OutputArrayR_const__OutputArrayR_bool_StreamR(x.as_raw__InputArray(), y.as_raw__InputArray(), magnitude.as_raw__OutputArray(), angle.as_raw__OutputArray(), angle_in_degrees, stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Compares elements of two matrices (or of a matrix and scalar).
///
/// ## Parameters
/// * src1: First source matrix or scalar.
/// * src2: Second source matrix or scalar.
/// * dst: Destination matrix that has the same size as the input array(s) and type CV_8U.
/// * cmpop: Flag specifying the relation between the elements to be checked:
/// * **CMP_EQ:** a(.) == b(.)
/// * **CMP_GT:** a(.) \> b(.)
/// * **CMP_GE:** a(.) \>= b(.)
/// * **CMP_LT:** a(.) \< b(.)
/// * **CMP_LE:** a(.) \<= b(.)
/// * **CMP_NE:** a(.) != b(.)
/// * stream: Stream for the asynchronous version.
/// ## See also
/// compare
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn compare(src1: &dyn core::ToInputArray, src2: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, cmpop: i32, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src1);
extern_container_arg!(src2);
extern_container_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_compare_const__InputArrayR_const__InputArrayR_const__OutputArrayR_int_StreamR(src1.as_raw__InputArray(), src2.as_raw__InputArray(), dst.as_raw__OutputArray(), cmpop, stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Forms a border around an image.
///
/// ## Parameters
/// * src: Source image. CV_8UC1 , CV_8UC4 , CV_32SC1 , and CV_32FC1 types are supported.
/// * dst: Destination image with the same type as src. The size is
/// Size(src.cols+left+right, src.rows+top+bottom) .
/// * top: Number of top pixels
/// * bottom: Number of bottom pixels
/// * left: Number of left pixels
/// * right: Number of pixels in each direction from the source image rectangle to extrapolate.
/// For example: top=1, bottom=1, left=1, right=1 mean that 1 pixel-wide border needs to be built.
/// * borderType: Border type. See borderInterpolate for details. BORDER_REFLECT101 ,
/// BORDER_REPLICATE , BORDER_CONSTANT , BORDER_REFLECT and BORDER_WRAP are supported for now.
/// * value: Border value.
/// * stream: Stream for the asynchronous version.
///
/// ## C++ default parameters
/// * value: Scalar()
/// * stream: Stream::Null()
#[inline]
pub fn copy_make_border(src: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, top: i32, bottom: i32, left: i32, right: i32, border_type: i32, value: core::Scalar, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src);
extern_container_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_copyMakeBorder_const__InputArrayR_const__OutputArrayR_int_int_int_int_int_Scalar_StreamR(src.as_raw__InputArray(), dst.as_raw__OutputArray(), top, bottom, left, right, border_type, value.opencv_as_extern(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Counts non-zero matrix elements.
///
/// ## Parameters
/// * src: Single-channel source image.
///
/// The function does not work with CV_64F images on GPUs with the compute capability \< 1.3.
/// ## See also
/// countNonZero
#[inline]
pub fn count_non_zero(src: &dyn core::ToInputArray) -> Result<i32> {
extern_container_arg!(src);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_countNonZero_const__InputArrayR(src.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Counts non-zero matrix elements.
///
/// ## Parameters
/// * src: Single-channel source image.
///
/// The function does not work with CV_64F images on GPUs with the compute capability \< 1.3.
/// ## See also
/// countNonZero
///
/// ## Overloaded parameters
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn count_non_zero_1(src: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src);
extern_container_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_countNonZero_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!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Creates implementation for cuda::Convolution .
///
/// ## Parameters
/// * user_block_size: Block size. If you leave default value Size(0,0) then automatic
/// estimation of block size will be used (which is optimized for speed). By varying user_block_size
/// you can reduce memory requirements at the cost of speed.
///
/// ## C++ default parameters
/// * user_block_size: Size()
#[inline]
pub fn create_convolution(user_block_size: core::Size) -> Result<core::Ptr<dyn crate::cudaarithm::Convolution>> {
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_createConvolution_Size(user_block_size.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Ptr::<dyn crate::cudaarithm::Convolution>::opencv_from_extern(ret) };
Ok(ret)
}
/// Creates implementation for cuda::DFT.
///
/// ## Parameters
/// * dft_size: The image size.
/// * flags: Optional flags:
/// * **DFT_ROWS** transforms each individual row of the source matrix.
/// * **DFT_SCALE** scales the result: divide it by the number of elements in the transform
/// (obtained from dft_size ).
/// * **DFT_INVERSE** inverts DFT. Use for complex-complex cases (real-complex and complex-real
/// cases are always forward and inverse, respectively).
/// * **DFT_COMPLEX_INPUT** Specifies that inputs will be complex with 2 channels.
/// * **DFT_REAL_OUTPUT** specifies the output as real. The source matrix is the result of
/// real-complex transform, so the destination matrix must be real.
#[inline]
pub fn create_dft(dft_size: core::Size, flags: i32) -> Result<core::Ptr<dyn crate::cudaarithm::DFT>> {
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_createDFT_Size_int(dft_size.opencv_as_extern(), flags, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Ptr::<dyn crate::cudaarithm::DFT>::opencv_from_extern(ret) };
Ok(ret)
}
/// Creates implementation for cuda::LookUpTable .
///
/// ## Parameters
/// * lut: Look-up table of 256 elements. It is a continuous CV_8U matrix.
#[inline]
pub fn create_look_up_table(lut: &dyn core::ToInputArray) -> Result<core::Ptr<dyn crate::cudaarithm::LookUpTable>> {
extern_container_arg!(lut);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_createLookUpTable_const__InputArrayR(lut.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Ptr::<dyn crate::cudaarithm::LookUpTable>::opencv_from_extern(ret) };
Ok(ret)
}
/// Performs a forward or inverse discrete Fourier transform (1D or 2D) of the floating point matrix.
///
/// ## Parameters
/// * src: Source matrix (real or complex).
/// * dst: Destination matrix (real or complex).
/// * dft_size: Size of a discrete Fourier transform.
/// * flags: Optional flags:
/// * **DFT_ROWS** transforms each individual row of the source matrix.
/// * **DFT_SCALE** scales the result: divide it by the number of elements in the transform
/// (obtained from dft_size ).
/// * **DFT_INVERSE** inverts DFT. Use for complex-complex cases (real-complex and complex-real
/// cases are always forward and inverse, respectively).
/// * **DFT_COMPLEX_INPUT** Specifies that input is complex input with 2 channels.
/// * **DFT_REAL_OUTPUT** specifies the output as real. The source matrix is the result of
/// real-complex transform, so the destination matrix must be real.
/// * stream: Stream for the asynchronous version.
///
/// Use to handle real matrices ( CV32FC1 ) and complex matrices in the interleaved format ( CV32FC2 ).
///
/// The source matrix should be continuous, otherwise reallocation and data copying is performed. The
/// function chooses an operation mode depending on the flags, size, and channel count of the source
/// matrix:
///
/// * If the source matrix is complex and the output is not specified as real, the destination
/// matrix is complex and has the dft_size size and CV_32FC2 type. The destination matrix
/// contains a full result of the DFT (forward or inverse).
/// * If the source matrix is complex and the output is specified as real, the function assumes that
/// its input is the result of the forward transform (see the next item). The destination matrix
/// has the dft_size size and CV_32FC1 type. It contains the result of the inverse DFT.
/// * If the source matrix is real (its type is CV_32FC1 ), forward DFT is performed. The result of
/// the DFT is packed into complex ( CV_32FC2 ) matrix. So, the width of the destination matrix
/// is dft_size.width / 2 + 1 . But if the source is a single column, the height is reduced
/// instead of the width.
/// ## See also
/// dft
///
/// ## C++ default parameters
/// * flags: 0
/// * stream: Stream::Null()
#[inline]
pub fn dft(src: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, dft_size: core::Size, flags: i32, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src);
extern_container_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_dft_const__InputArrayR_const__OutputArrayR_Size_int_StreamR(src.as_raw__InputArray(), dst.as_raw__OutputArray(), dft_size.opencv_as_extern(), flags, stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Computes a matrix-matrix or matrix-scalar division.
///
/// ## Parameters
/// * src1: First source matrix or a scalar.
/// * src2: Second source matrix or scalar.
/// * dst: Destination matrix that has the same size and number of channels as the input array(s).
/// The depth is defined by dtype or src1 depth.
/// * scale: Optional scale factor.
/// * dtype: Optional depth of the output array.
/// * stream: Stream for the asynchronous version.
///
/// This function, in contrast to divide, uses a round-down rounding mode.
/// ## See also
/// divide
///
/// ## C++ default parameters
/// * scale: 1
/// * dtype: -1
/// * stream: Stream::Null()
#[inline]
pub fn divide(src1: &dyn core::ToInputArray, src2: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, scale: f64, dtype: i32, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src1);
extern_container_arg!(src2);
extern_container_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_divide_const__InputArrayR_const__InputArrayR_const__OutputArrayR_double_int_StreamR(src1.as_raw__InputArray(), src2.as_raw__InputArray(), dst.as_raw__OutputArray(), scale, dtype, stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Computes an exponent of each matrix element.
///
/// ## Parameters
/// * src: Source matrix.
/// * dst: Destination matrix with the same size and type as src .
/// * stream: Stream for the asynchronous version.
/// ## See also
/// exp
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn exp(src: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src);
extern_container_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_exp_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!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
///
/// ## C++ default parameters
/// * mask: noArray()
/// * stream: Stream::Null()
#[inline]
pub fn find_min_max_loc(src: &dyn core::ToInputArray, min_max_vals: &mut dyn core::ToOutputArray, loc: &mut dyn core::ToOutputArray, mask: &dyn core::ToInputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src);
extern_container_arg!(min_max_vals);
extern_container_arg!(loc);
extern_container_arg!(mask);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_findMinMaxLoc_const__InputArrayR_const__OutputArrayR_const__OutputArrayR_const__InputArrayR_StreamR(src.as_raw__InputArray(), min_max_vals.as_raw__OutputArray(), loc.as_raw__OutputArray(), mask.as_raw__InputArray(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
///
/// ## C++ default parameters
/// * mask: noArray()
/// * stream: Stream::Null()
#[inline]
pub fn find_min_max(src: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, mask: &dyn core::ToInputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src);
extern_container_arg!(dst);
extern_container_arg!(mask);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_findMinMax_const__InputArrayR_const__OutputArrayR_const__InputArrayR_StreamR(src.as_raw__InputArray(), dst.as_raw__OutputArray(), mask.as_raw__InputArray(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Flips a 2D matrix around vertical, horizontal, or both axes.
///
/// ## Parameters
/// * src: Source matrix. Supports 1, 3 and 4 channels images with CV_8U, CV_16U, CV_32S or
/// CV_32F depth.
/// * dst: Destination matrix.
/// * flipCode: Flip mode for the source:
/// * 0 Flips around x-axis.
/// * \> 0 Flips around y-axis.
/// * \< 0 Flips around both axes.
/// * stream: Stream for the asynchronous version.
/// ## See also
/// flip
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn flip(src: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, flip_code: i32, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src);
extern_container_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_flip_const__InputArrayR_const__OutputArrayR_int_StreamR(src.as_raw__InputArray(), dst.as_raw__OutputArray(), flip_code, stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Performs generalized matrix multiplication.
///
/// ## Parameters
/// * src1: First multiplied input matrix that should have CV_32FC1 , CV_64FC1 , CV_32FC2 , or
/// CV_64FC2 type.
/// * src2: Second multiplied input matrix of the same type as src1 .
/// * alpha: Weight of the matrix product.
/// * src3: Third optional delta matrix added to the matrix product. It should have the same type
/// as src1 and src2 .
/// * beta: Weight of src3 .
/// * dst: Destination matrix. It has the proper size and the same type as input matrices.
/// * flags: Operation flags:
/// * **GEMM_1_T** transpose src1
/// * **GEMM_2_T** transpose src2
/// * **GEMM_3_T** transpose src3
/// * stream: Stream for the asynchronous version.
///
/// The function performs generalized matrix multiplication similar to the gemm functions in BLAS level
/// 3. For example, gemm(src1, src2, alpha, src3, beta, dst, GEMM_1_T + GEMM_3_T) corresponds to
///
/// ![block formula](https://latex.codecogs.com/png.latex?%5Ctexttt%7Bdst%7D%20%3D%20%20%5Ctexttt%7Balpha%7D%20%5Ccdot%20%5Ctexttt%7Bsrc1%7D%20%5ET%20%20%5Ccdot%20%5Ctexttt%7Bsrc2%7D%20%2B%20%20%5Ctexttt%7Bbeta%7D%20%5Ccdot%20%5Ctexttt%7Bsrc3%7D%20%5ET)
///
///
/// Note: Transposition operation doesn't support CV_64FC2 input type.
/// ## See also
/// gemm
///
/// ## C++ default parameters
/// * flags: 0
/// * stream: Stream::Null()
#[inline]
pub fn gemm(src1: &dyn core::ToInputArray, src2: &dyn core::ToInputArray, alpha: f64, src3: &dyn core::ToInputArray, beta: f64, dst: &mut dyn core::ToOutputArray, flags: i32, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src1);
extern_container_arg!(src2);
extern_container_arg!(src3);
extern_container_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_gemm_const__InputArrayR_const__InputArrayR_double_const__InputArrayR_double_const__OutputArrayR_int_StreamR(src1.as_raw__InputArray(), src2.as_raw__InputArray(), alpha, src3.as_raw__InputArray(), beta, dst.as_raw__OutputArray(), flags, stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Checks if array elements lie between two scalars.
///
/// The function checks the range as follows:
/// * For every element of a single-channel input array:
/// ![block formula](https://latex.codecogs.com/png.latex?%5Ctexttt%7Bdst%7D%20%28I%29%3D%20%5Ctexttt%7Blowerb%7D%5F0%20%20%5Cleq%20%5Ctexttt%7Bsrc%7D%20%28I%29%5F0%20%5Cleq%20%20%5Ctexttt%7Bupperb%7D%5F0)
/// * For two-channel arrays:
/// ![block formula](https://latex.codecogs.com/png.latex?%5Ctexttt%7Bdst%7D%20%28I%29%3D%20%5Ctexttt%7Blowerb%7D%5F0%20%20%5Cleq%20%5Ctexttt%7Bsrc%7D%20%28I%29%5F0%20%5Cleq%20%20%5Ctexttt%7Bupperb%7D%5F0%20%20%5Cland%20%5Ctexttt%7Blowerb%7D%5F1%20%20%5Cleq%20%5Ctexttt%7Bsrc%7D%20%28I%29%5F1%20%5Cleq%20%20%5Ctexttt%7Bupperb%7D%5F1)
/// * and so forth.
///
/// That is, dst (I) is set to 255 (all 1 -bits) if src (I) is within the
/// specified 1D, 2D, 3D, ... box and 0 otherwise.
///
/// Note that unlike the CPU inRange, this does NOT accept an array for lowerb or
/// upperb, only a cv::Scalar.
///
/// ## Parameters
/// * src: first input array.
/// * lowerb: inclusive lower boundary cv::Scalar.
/// * upperb: inclusive upper boundary cv::Scalar.
/// * dst: output array of the same size as src and CV_8U type.
/// * stream: Stream for the asynchronous version.
/// ## See also
/// cv::inRange
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn in_range(src: &dyn core::ToInputArray, lowerb: core::Scalar, upperb: core::Scalar, dst: &mut dyn core::ToOutputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src);
extern_container_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_inRange_const__InputArrayR_const_ScalarR_const_ScalarR_const__OutputArrayR_StreamR(src.as_raw__InputArray(), &lowerb, &upperb, dst.as_raw__OutputArray(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Computes an integral image.
///
/// ## Parameters
/// * src: Source image. Only CV_8UC1 images are supported for now.
/// * sum: Integral image containing 32-bit unsigned integer values packed into CV_32SC1 .
/// * stream: Stream for the asynchronous version.
/// ## See also
/// integral
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn integral(src: &dyn core::ToInputArray, sum: &mut dyn core::ToOutputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src);
extern_container_arg!(sum);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_integral_const__InputArrayR_const__OutputArrayR_StreamR(src.as_raw__InputArray(), sum.as_raw__OutputArray(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Computes a natural logarithm of absolute value of each matrix element.
///
/// ## Parameters
/// * src: Source matrix.
/// * dst: Destination matrix with the same size and type as src .
/// * stream: Stream for the asynchronous version.
/// ## See also
/// log
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn log(src: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src);
extern_container_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_log_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!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Performs pixel by pixel right left of an image by a constant value.
///
/// ## Parameters
/// * src: Source matrix. Supports 1, 3 and 4 channels images with CV_8U , CV_16U or CV_32S
/// depth.
/// * val: Constant values, one per channel.
/// * dst: Destination matrix with the same size and type as src .
/// * stream: Stream for the asynchronous version.
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn lshift(src: &dyn core::ToInputArray, val: core::Scalar_<i32>, dst: &mut dyn core::ToOutputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src);
extern_container_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_lshift_const__InputArrayR_Scalar_LintG_const__OutputArrayR_StreamR(src.as_raw__InputArray(), val.opencv_as_extern(), dst.as_raw__OutputArray(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn lshift_1(src: &dyn core::ToInputArray, val: core::Scalar, dst: &mut dyn core::ToOutputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src);
extern_container_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_lshift_const__InputArrayR_Scalar_const__OutputArrayR_StreamR(src.as_raw__InputArray(), val.opencv_as_extern(), dst.as_raw__OutputArray(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Computes squared magnitudes of complex matrix elements.
///
/// ## Parameters
/// * xy: Source complex matrix in the interleaved format ( CV_32FC2 ).
/// * magnitude: Destination matrix of float magnitude squares ( CV_32FC1 ).
/// * stream: Stream for the asynchronous version.
///
/// ## Overloaded parameters
///
/// computes squared magnitude of each (x(i), y(i)) vector
/// supports only floating-point source
/// * x: Source matrix containing real components ( CV_32FC1 ).
/// * y: Source matrix containing imaginary components ( CV_32FC1 ).
/// * magnitude: Destination matrix of float magnitude squares ( CV_32FC1 ).
/// * stream: Stream for the asynchronous version.
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn magnitude_sqr_1(x: &dyn core::ToInputArray, y: &dyn core::ToInputArray, magnitude: &mut dyn core::ToOutputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(x);
extern_container_arg!(y);
extern_container_arg!(magnitude);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_magnitudeSqr_const__InputArrayR_const__InputArrayR_const__OutputArrayR_StreamR(x.as_raw__InputArray(), y.as_raw__InputArray(), magnitude.as_raw__OutputArray(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Computes squared magnitudes of complex matrix elements.
///
/// ## Parameters
/// * xy: Source complex matrix in the interleaved format ( CV_32FC2 ).
/// * magnitude: Destination matrix of float magnitude squares ( CV_32FC1 ).
/// * stream: Stream for the asynchronous version.
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn magnitude_sqr(xy: &dyn core::ToInputArray, magnitude: &mut dyn core::ToOutputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(xy);
extern_container_arg!(magnitude);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_magnitudeSqr_const__InputArrayR_const__OutputArrayR_StreamR(xy.as_raw__InputArray(), magnitude.as_raw__OutputArray(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Computes magnitudes of complex matrix elements.
///
/// ## Parameters
/// * xy: Source complex matrix in the interleaved format ( CV_32FC2 ).
/// * magnitude: Destination matrix of float magnitudes ( CV_32FC1 ).
/// * stream: Stream for the asynchronous version.
/// ## See also
/// magnitude
///
/// ## Overloaded parameters
///
/// computes magnitude of each (x(i), y(i)) vector
/// supports only floating-point source
/// * x: Source matrix containing real components ( CV_32FC1 ).
/// * y: Source matrix containing imaginary components ( CV_32FC1 ).
/// * magnitude: Destination matrix of float magnitudes ( CV_32FC1 ).
/// * stream: Stream for the asynchronous version.
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn magnitude_1(x: &dyn core::ToInputArray, y: &dyn core::ToInputArray, magnitude: &mut dyn core::ToOutputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(x);
extern_container_arg!(y);
extern_container_arg!(magnitude);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_magnitude_const__InputArrayR_const__InputArrayR_const__OutputArrayR_StreamR(x.as_raw__InputArray(), y.as_raw__InputArray(), magnitude.as_raw__OutputArray(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Computes magnitudes of complex matrix elements.
///
/// ## Parameters
/// * xy: Source complex matrix in the interleaved format ( CV_32FC2 ).
/// * magnitude: Destination matrix of float magnitudes ( CV_32FC1 ).
/// * stream: Stream for the asynchronous version.
/// ## See also
/// magnitude
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn magnitude(xy: &dyn core::ToInputArray, magnitude: &mut dyn core::ToOutputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(xy);
extern_container_arg!(magnitude);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_magnitude_const__InputArrayR_const__OutputArrayR_StreamR(xy.as_raw__InputArray(), magnitude.as_raw__OutputArray(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Computes the per-element maximum of two matrices (or a matrix and a scalar).
///
/// ## Parameters
/// * src1: First source matrix or scalar.
/// * src2: Second source matrix or scalar.
/// * dst: Destination matrix that has the same size and type as the input array(s).
/// * stream: Stream for the asynchronous version.
/// ## See also
/// max
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn max(src1: &dyn core::ToInputArray, src2: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src1);
extern_container_arg!(src2);
extern_container_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_max_const__InputArrayR_const__InputArrayR_const__OutputArrayR_StreamR(src1.as_raw__InputArray(), src2.as_raw__InputArray(), dst.as_raw__OutputArray(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Computes a mean value and a standard deviation of matrix elements.
///
/// ## Parameters
/// * src: Source matrix. CV_8UC1 and CV_32FC1 matrices are supported for now.
/// * dst: Target GpuMat with size 1x2 and type CV_64FC1. The first value is mean, the second - stddev.
/// * mask: Operation mask.
/// * stream: Stream for the asynchronous version.
/// ## See also
/// meanStdDev
///
/// ## Overloaded parameters
///
/// * mtx: Source matrix. CV_8UC1 and CV_32FC1 matrices are supported for now.
/// * mean: Mean value.
/// * stddev: Standard deviation value.
#[inline]
pub fn mean_std_dev_3(mtx: &dyn core::ToInputArray, mean: &mut core::Scalar, stddev: &mut core::Scalar) -> Result<()> {
extern_container_arg!(mtx);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_meanStdDev_const__InputArrayR_ScalarR_ScalarR(mtx.as_raw__InputArray(), mean, stddev, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Computes a mean value and a standard deviation of matrix elements.
///
/// ## Parameters
/// * src: Source matrix. CV_8UC1 and CV_32FC1 matrices are supported for now.