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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
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:
///
/// 
///
/// 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
///
/// 
///
///
/// 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:
/// 
/// * For two-channel arrays:
/// 
/// * 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.
/// * 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
///
/// * src: Source matrix. CV_8UC1 and CV_32FC1 matrices are supported for now.
/// * mean: Mean value.
/// * stddev: Standard deviation value.
/// * mask: Operation mask.
#[inline]
pub fn mean_std_dev_2(src: &dyn core::ToInputArray, mean: &mut core::Scalar, stddev: &mut core::Scalar, mask: &dyn core::ToInputArray) -> Result<()> {
extern_container_arg!(src);
extern_container_arg!(mask);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_meanStdDev_const__InputArrayR_ScalarR_ScalarR_const__InputArrayR(src.as_raw__InputArray(), mean, stddev, mask.as_raw__InputArray(), 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.
/// * dst: Target GpuMat with size 1x2 and type CV_64FC1. The first value is mean, the second - stddev.
/// * stream: Stream for the asynchronous version.
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn mean_std_dev_1(mtx: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(mtx);
extern_container_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_meanStdDev_const__InputArrayR_const__OutputArrayR_StreamR(mtx.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
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn mean_std_dev(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_meanStdDev_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)
}
/// Makes a multi-channel matrix out of several single-channel matrices.
///
/// ## Parameters
/// * src: Array/vector of source matrices.
/// * n: Number of source matrices.
/// * dst: Destination matrix.
/// * stream: Stream for the asynchronous version.
/// ## See also
/// merge
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn merge(src: &core::GpuMat, n: size_t, dst: &mut dyn core::ToOutputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_merge_const_GpuMatX_size_t_const__OutputArrayR_StreamR(src.as_raw_GpuMat(), n, 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)
}
/// Makes a multi-channel matrix out of several single-channel matrices.
///
/// ## Parameters
/// * src: Array/vector of source matrices.
/// * n: Number of source matrices.
/// * dst: Destination matrix.
/// * stream: Stream for the asynchronous version.
/// ## See also
/// merge
///
/// ## Overloaded parameters
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn merge_1(src: &core::Vector<core::GpuMat>, dst: &mut dyn core::ToOutputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_merge_const_vectorLGpuMatGR_const__OutputArrayR_StreamR(src.as_raw_VectorOfGpuMat(), 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)
}
/// Finds global minimum and maximum matrix elements and returns their values with locations.
///
/// ## Parameters
/// * src: Single-channel source image.
/// * minVal: Pointer to the returned minimum value. Use NULL if not required.
/// * maxVal: Pointer to the returned maximum value. Use NULL if not required.
/// * minLoc: Pointer to the returned minimum location. Use NULL if not required.
/// * maxLoc: Pointer to the returned maximum location. Use NULL if not required.
/// * mask: Optional mask to select a sub-matrix.
///
/// The function does not work with CV_64F images on GPU with the compute capability \< 1.3.
/// ## See also
/// minMaxLoc
///
/// ## C++ default parameters
/// * mask: noArray()
#[inline]
pub fn min_max_loc(src: &dyn core::ToInputArray, min_val: &mut f64, max_val: &mut f64, min_loc: &mut core::Point, max_loc: &mut core::Point, mask: &dyn core::ToInputArray) -> Result<()> {
extern_container_arg!(src);
extern_container_arg!(mask);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_minMaxLoc_const__InputArrayR_doubleX_doubleX_PointX_PointX_const__InputArrayR(src.as_raw__InputArray(), min_val, max_val, min_loc, max_loc, mask.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Finds global minimum and maximum matrix elements and returns their values.
///
/// ## Parameters
/// * src: Single-channel source image.
/// * minVal: Pointer to the returned minimum value. Use NULL if not required.
/// * maxVal: Pointer to the returned maximum value. Use NULL if not required.
/// * mask: Optional mask to select a sub-matrix.
///
/// The function does not work with CV_64F images on GPUs with the compute capability \< 1.3.
/// ## See also
/// minMaxLoc
///
/// ## C++ default parameters
/// * mask: noArray()
#[inline]
pub fn min_max(src: &dyn core::ToInputArray, min_val: &mut f64, max_val: &mut f64, mask: &dyn core::ToInputArray) -> Result<()> {
extern_container_arg!(src);
extern_container_arg!(mask);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_minMax_const__InputArrayR_doubleX_doubleX_const__InputArrayR(src.as_raw__InputArray(), min_val, max_val, mask.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Computes the per-element minimum 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
/// min
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn min(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_min_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)
}
/// Performs a per-element multiplication of two Fourier spectrums and scales the result.
///
/// ## Parameters
/// * src1: First spectrum.
/// * src2: Second spectrum with the same size and type as a .
/// * dst: Destination spectrum.
/// * flags: Mock parameter used for CPU/CUDA interfaces similarity, simply add a `0` value.
/// * scale: Scale constant.
/// * conjB: Optional flag to specify if the second spectrum needs to be conjugated before the
/// multiplication.
/// * stream: Stream for the asynchronous version.
///
/// Only full (not packed) CV_32FC2 complex spectrums in the interleaved format are supported for now.
/// ## See also
/// mulSpectrums
///
/// ## C++ default parameters
/// * conj_b: false
/// * stream: Stream::Null()
#[inline]
pub fn mul_and_scale_spectrums(src1: &dyn core::ToInputArray, src2: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, flags: i32, scale: f32, conj_b: bool, 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_mulAndScaleSpectrums_const__InputArrayR_const__InputArrayR_const__OutputArrayR_int_float_bool_StreamR(src1.as_raw__InputArray(), src2.as_raw__InputArray(), dst.as_raw__OutputArray(), flags, scale, conj_b, 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 multiplication of two Fourier spectrums.
///
/// ## Parameters
/// * src1: First spectrum.
/// * src2: Second spectrum with the same size and type as a .
/// * dst: Destination spectrum.
/// * flags: Mock parameter used for CPU/CUDA interfaces similarity.
/// * conjB: Optional flag to specify if the second spectrum needs to be conjugated before the
/// multiplication.
/// * stream: Stream for the asynchronous version.
///
/// Only full (not packed) CV_32FC2 complex spectrums in the interleaved format are supported for now.
/// ## See also
/// mulSpectrums
///
/// ## C++ default parameters
/// * conj_b: false
/// * stream: Stream::Null()
#[inline]
pub fn mul_spectrums(src1: &dyn core::ToInputArray, src2: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, flags: i32, conj_b: bool, 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_mulSpectrums_const__InputArrayR_const__InputArrayR_const__OutputArrayR_int_bool_StreamR(src1.as_raw__InputArray(), src2.as_raw__InputArray(), dst.as_raw__OutputArray(), flags, conj_b, 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 per-element product.
///
/// ## Parameters
/// * src1: First source matrix or 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.
/// ## See also
/// multiply
///
/// ## C++ default parameters
/// * scale: 1
/// * dtype: -1
/// * stream: Stream::Null()
#[inline]
pub fn multiply(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_multiply_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)
}
/// Returns the difference of two matrices.
///
/// ## Parameters
/// * src1: Source matrix. Any matrices except 64F are supported.
/// * src2: Second source matrix (if any) with the same size and type as src1.
/// * normType: Norm type. NORM_L1 , NORM_L2 , and NORM_INF are supported for now.
/// ## See also
/// norm
///
/// ## C++ default parameters
/// * norm_type: NORM_L2
#[inline]
pub fn norm_1(src1: &dyn core::ToInputArray, src2: &dyn core::ToInputArray, norm_type: i32) -> Result<f64> {
extern_container_arg!(src1);
extern_container_arg!(src2);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_norm_const__InputArrayR_const__InputArrayR_int(src1.as_raw__InputArray(), src2.as_raw__InputArray(), norm_type, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Returns the norm of a matrix (or difference of two matrices).
///
/// ## Parameters
/// * src1: Source matrix. Any matrices except 64F are supported.
/// * normType: Norm type. NORM_L1 , NORM_L2 , and NORM_INF are supported for now.
/// * mask: optional operation mask; it must have the same size as src1 and CV_8UC1 type.
/// ## See also
/// norm
///
/// ## C++ default parameters
/// * mask: noArray()
#[inline]
pub fn norm(src1: &dyn core::ToInputArray, norm_type: i32, mask: &dyn core::ToInputArray) -> Result<f64> {
extern_container_arg!(src1);
extern_container_arg!(mask);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_norm_const__InputArrayR_int_const__InputArrayR(src1.as_raw__InputArray(), norm_type, mask.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Normalizes the norm or value range of an array.
///
/// ## Parameters
/// * src: Input array.
/// * dst: Output array of the same size as src .
/// * alpha: Norm value to normalize to or the lower range boundary in case of the range
/// normalization.
/// * beta: Upper range boundary in case of the range normalization; it is not used for the norm
/// normalization.
/// * norm_type: Normalization type ( NORM_MINMAX , NORM_L2 , NORM_L1 or NORM_INF ).
/// * dtype: When negative, the output array has the same type as src; otherwise, it has the same
/// number of channels as src and the depth =CV_MAT_DEPTH(dtype).
/// * mask: Optional operation mask.
/// * stream: Stream for the asynchronous version.
/// ## See also
/// normalize
///
/// ## C++ default parameters
/// * mask: noArray()
/// * stream: Stream::Null()
#[inline]
pub fn normalize(src: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, alpha: f64, beta: f64, norm_type: i32, dtype: 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_normalize_const__InputArrayR_const__OutputArrayR_double_double_int_int_const__InputArrayR_StreamR(src.as_raw__InputArray(), dst.as_raw__OutputArray(), alpha, beta, norm_type, dtype, 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)
}
/// Computes polar angles of complex matrix elements.
///
/// ## Parameters
/// * x: Source matrix containing real components ( CV_32FC1 ).
/// * y: Source matrix containing imaginary components ( 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
/// phase
///
/// ## C++ default parameters
/// * angle_in_degrees: false
/// * stream: Stream::Null()
#[inline]
pub fn phase(x: &dyn core::ToInputArray, y: &dyn core::ToInputArray, 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!(angle);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_phase_const__InputArrayR_const__InputArrayR_const__OutputArrayR_bool_StreamR(x.as_raw__InputArray(), y.as_raw__InputArray(), 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)
}
/// Converts polar coordinates into Cartesian.
///
/// ## Parameters
/// * magnitude: Source matrix containing magnitudes ( CV_32FC1 or CV_64FC1 ).
/// * angle: Source matrix containing angles ( same type as magnitude ).
/// * x: Destination matrix of real components ( same type as magnitude ).
/// * y: Destination matrix of imaginary components ( same type as magnitude ).
/// * angleInDegrees: Flag that indicates angles in degrees.
/// * stream: Stream for the asynchronous version.
///
/// ## C++ default parameters
/// * angle_in_degrees: false
/// * stream: Stream::Null()
#[inline]
pub fn polar_to_cart(magnitude: &dyn core::ToInputArray, angle: &dyn core::ToInputArray, x: &mut dyn core::ToOutputArray, y: &mut dyn core::ToOutputArray, angle_in_degrees: bool, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(magnitude);
extern_container_arg!(angle);
extern_container_arg!(x);
extern_container_arg!(y);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_polarToCart_const__InputArrayR_const__InputArrayR_const__OutputArrayR_const__OutputArrayR_bool_StreamR(magnitude.as_raw__InputArray(), angle.as_raw__InputArray(), x.as_raw__OutputArray(), y.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)
}
/// Raises every matrix element to a power.
///
/// ## Parameters
/// * src: Source matrix.
/// * power: Exponent of power.
/// * dst: Destination matrix with the same size and type as src .
/// * stream: Stream for the asynchronous version.
///
/// The function pow raises every element of the input matrix to power :
///
/// 
/// ## See also
/// pow
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn pow(src: &dyn core::ToInputArray, power: f64, 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_pow_const__InputArrayR_double_const__OutputArrayR_StreamR(src.as_raw__InputArray(), power, 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 standard deviation of integral images.
///
/// ## Parameters
/// * src: Source image. Only the CV_32SC1 type is supported.
/// * sqr: Squared source image. Only the CV_32FC1 type is supported.
/// * dst: Destination image with the same type and size as src.
/// * rect: Rectangular window.
/// * stream: Stream for the asynchronous version.
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn rect_std_dev(src: &dyn core::ToInputArray, sqr: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, rect: core::Rect, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src);
extern_container_arg!(sqr);
extern_container_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_rectStdDev_const__InputArrayR_const__InputArrayR_const__OutputArrayR_Rect_StreamR(src.as_raw__InputArray(), sqr.as_raw__InputArray(), dst.as_raw__OutputArray(), rect.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)
}
/// Reduces a matrix to a vector.
///
/// ## Parameters
/// * mtx: Source 2D matrix.
/// * vec: Destination vector. Its size and type is defined by dim and dtype parameters.
/// * dim: Dimension index along which the matrix is reduced. 0 means that the matrix is reduced
/// to a single row. 1 means that the matrix is reduced to a single column.
/// * reduceOp: Reduction operation that could be one of the following:
/// * **REDUCE_SUM** The output is the sum of all rows/columns of the matrix.
/// * **REDUCE_AVG** The output is the mean vector of all rows/columns of the matrix.
/// * **REDUCE_MAX** The output is the maximum (column/row-wise) of all rows/columns of the
/// matrix.
/// * **REDUCE_MIN** The output is the minimum (column/row-wise) of all rows/columns of the
/// matrix.
/// * dtype: When it is negative, the destination vector will have the same type as the source
/// matrix. Otherwise, its type will be CV_MAKE_TYPE(CV_MAT_DEPTH(dtype), mtx.channels()) .
/// * stream: Stream for the asynchronous version.
///
/// The function reduce reduces the matrix to a vector by treating the matrix rows/columns as a set of
/// 1D vectors and performing the specified operation on the vectors until a single row/column is
/// obtained. For example, the function can be used to compute horizontal and vertical projections of a
/// raster image. In case of REDUCE_SUM and REDUCE_AVG , the output may have a larger element
/// bit-depth to preserve accuracy. And multi-channel arrays are also supported in these two reduction
/// modes.
/// ## See also
/// reduce
///
/// ## C++ default parameters
/// * dtype: -1
/// * stream: Stream::Null()
#[inline]
pub fn reduce(mtx: &dyn core::ToInputArray, vec: &mut dyn core::ToOutputArray, dim: i32, reduce_op: i32, dtype: i32, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(mtx);
extern_container_arg!(vec);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_reduce_const__InputArrayR_const__OutputArrayR_int_int_int_StreamR(mtx.as_raw__InputArray(), vec.as_raw__OutputArray(), dim, reduce_op, 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 pixel by pixel right shift of an image by a constant value.
///
/// ## Parameters
/// * src: Source matrix. Supports 1, 3 and 4 channels images with integers elements.
/// * 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 rshift(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_rshift_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 rshift_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_rshift_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)
}
/// Copies each plane of a multi-channel matrix into an array.
///
/// ## Parameters
/// * src: Source matrix.
/// * dst: Destination array/vector of single-channel matrices.
/// * stream: Stream for the asynchronous version.
/// ## See also
/// split
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn split(src: &dyn core::ToInputArray, dst: &mut core::GpuMat, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_split_const__InputArrayR_GpuMatX_StreamR(src.as_raw__InputArray(), dst.as_raw_mut_GpuMat(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Copies each plane of a multi-channel matrix into an array.
///
/// ## Parameters
/// * src: Source matrix.
/// * dst: Destination array/vector of single-channel matrices.
/// * stream: Stream for the asynchronous version.
/// ## See also
/// split
///
/// ## Overloaded parameters
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn split_1(src: &dyn core::ToInputArray, dst: &mut core::Vector<core::GpuMat>, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_split_const__InputArrayR_vectorLGpuMatGR_StreamR(src.as_raw__InputArray(), dst.as_raw_mut_VectorOfGpuMat(), 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 squared integral image.
///
/// ## Parameters
/// * src: Source image. Only CV_8UC1 images are supported for now.
/// * sqsum: Squared integral image containing 64-bit unsigned integer values packed into
/// CV_64FC1 .
/// * stream: Stream for the asynchronous version.
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn sqr_integral(src: &dyn core::ToInputArray, sqsum: &mut dyn core::ToOutputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src);
extern_container_arg!(sqsum);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_sqrIntegral_const__InputArrayR_const__OutputArrayR_StreamR(src.as_raw__InputArray(), sqsum.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)
}
/// Returns the squared sum of 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 sqr_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_sqrSum_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 a square 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.
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn sqr(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_sqr_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 a square root 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
/// sqrt
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn sqrt(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_sqrt_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 a matrix-matrix or matrix-scalar difference.
///
/// ## 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
/// subtract
///
/// ## C++ default parameters
/// * mask: noArray()
/// * dtype: -1
/// * stream: Stream::Null()
#[inline]
pub fn subtract(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_subtract_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)
}
/// Returns the sum of 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.
/// ## See also
/// sum
///
/// ## C++ default parameters
/// * mask: noArray()
#[inline]
pub fn 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_sum_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)
}
/// Applies a fixed-level threshold to each array element.
///
/// ## Parameters
/// * src: Source array (single-channel).
/// * dst: Destination array with the same size and type as src .
/// * thresh: Threshold value.
/// * maxval: Maximum value to use with THRESH_BINARY and THRESH_BINARY_INV threshold types.
/// * type: Threshold type. For details, see threshold . The THRESH_OTSU and THRESH_TRIANGLE
/// threshold types are not supported.
/// * stream: Stream for the asynchronous version.
/// ## See also
/// threshold
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn threshold(src: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, thresh: f64, maxval: f64, typ: i32, stream: &mut core::Stream) -> Result<f64> {
extern_container_arg!(src);
extern_container_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_threshold_const__InputArrayR_const__OutputArrayR_double_double_int_StreamR(src.as_raw__InputArray(), dst.as_raw__OutputArray(), thresh, maxval, typ, stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
/// Transposes a matrix.
///
/// ## Parameters
/// * src1: Source matrix. 1-, 4-, 8-byte element sizes are supported for now.
/// * dst: Destination matrix.
/// * stream: Stream for the asynchronous version.
/// ## See also
/// transpose
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
pub fn transpose(src1: &dyn core::ToInputArray, dst: &mut dyn core::ToOutputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(src1);
extern_container_arg!(dst);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_transpose_const__InputArrayR_const__OutputArrayR_StreamR(src1.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)
}
/// Constant methods for [crate::cudaarithm::Convolution]
pub trait ConvolutionConst: core::AlgorithmTraitConst {
fn as_raw_Convolution(&self) -> *const c_void;
}
/// Base class for convolution (or cross-correlation) operator. :
pub trait Convolution: core::AlgorithmTrait + crate::cudaarithm::ConvolutionConst {
fn as_raw_mut_Convolution(&mut self) -> *mut c_void;
/// Computes a convolution (or cross-correlation) of two images.
///
/// ## Parameters
/// * image: Source image. Only CV_32FC1 images are supported for now.
/// * templ: Template image. The size is not greater than the image size. The type is the same as
/// image .
/// * result: Result image. If image is *W x H* and templ is *w x h*, then result must be *W-w+1 x
/// H-h+1*.
/// * ccorr: Flags to evaluate cross-correlation instead of convolution.
/// * stream: Stream for the asynchronous version.
///
/// ## C++ default parameters
/// * ccorr: false
/// * stream: Stream::Null()
#[inline]
fn convolve(&mut self, image: &dyn core::ToInputArray, templ: &dyn core::ToInputArray, result: &mut dyn core::ToOutputArray, ccorr: bool, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(image);
extern_container_arg!(templ);
extern_container_arg!(result);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_Convolution_convolve_const__InputArrayR_const__InputArrayR_const__OutputArrayR_bool_StreamR(self.as_raw_mut_Convolution(), image.as_raw__InputArray(), templ.as_raw__InputArray(), result.as_raw__OutputArray(), ccorr, stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
/// Constant methods for [crate::cudaarithm::DFT]
pub trait DFTConst: core::AlgorithmTraitConst {
fn as_raw_DFT(&self) -> *const c_void;
}
/// Base class for DFT operator as a cv::Algorithm. :
pub trait DFT: core::AlgorithmTrait + crate::cudaarithm::DFTConst {
fn as_raw_mut_DFT(&mut self) -> *mut c_void;
/// Computes an FFT of a given image.
///
/// ## Parameters
/// * image: Source image. Only CV_32FC1 images are supported for now.
/// * result: Result image.
/// * stream: Stream for the asynchronous version.
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
fn compute(&mut self, image: &dyn core::ToInputArray, result: &mut dyn core::ToOutputArray, stream: &mut core::Stream) -> Result<()> {
extern_container_arg!(image);
extern_container_arg!(result);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_DFT_compute_const__InputArrayR_const__OutputArrayR_StreamR(self.as_raw_mut_DFT(), image.as_raw__InputArray(), result.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)
}
}
/// Constant methods for [crate::cudaarithm::LookUpTable]
pub trait LookUpTableConst: core::AlgorithmTraitConst {
fn as_raw_LookUpTable(&self) -> *const c_void;
}
/// Base class for transform using lookup table.
pub trait LookUpTable: core::AlgorithmTrait + crate::cudaarithm::LookUpTableConst {
fn as_raw_mut_LookUpTable(&mut self) -> *mut c_void;
/// Transforms the source matrix into the destination matrix using the given look-up table:
/// dst(I) = lut(src(I)) .
///
/// ## Parameters
/// * src: Source matrix. CV_8UC1 and CV_8UC3 matrices are supported for now.
/// * dst: Destination matrix.
/// * stream: Stream for the asynchronous version.
///
/// ## C++ default parameters
/// * stream: Stream::Null()
#[inline]
fn transform(&mut self, 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_LookUpTable_transform_const__InputArrayR_const__OutputArrayR_StreamR(self.as_raw_mut_LookUpTable(), 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)
}
}
}