opencv 0.94.4

Rust bindings for OpenCV
Documentation
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
pub mod line_descriptor {
	//! # Binary descriptors for lines extracted from an image
	//!
	//! Introduction
	//! ------------
	//!
	//! One of the most challenging activities in computer vision is the extraction of useful information
	//! from a given image. Such information, usually comes in the form of points that preserve some kind of
	//! property (for instance, they are scale-invariant) and are actually representative of input image.
	//!
	//! The goal of this module is seeking a new kind of representative information inside an image and
	//! providing the functionalities for its extraction and representation. In particular, differently from
	//! previous methods for detection of relevant elements inside an image, lines are extracted in place of
	//! points; a new class is defined ad hoc to summarize a line's properties, for reuse and plotting
	//! purposes.
	//!
	//! Computation of binary descriptors
	//! ---------------------------------
	//!
	//! To obtatin a binary descriptor representing a certain line detected from a certain octave of an
	//! image, we first compute a non-binary descriptor as described in [LBD](https://docs.opencv.org/4.11.0/d0/de3/citelist.html#CITEREF_LBD) . Such algorithm works on
	//! lines extracted using EDLine detector, as explained in [EDL](https://docs.opencv.org/4.11.0/d0/de3/citelist.html#CITEREF_EDL) . Given a line, we consider a
	//! rectangular region centered at it and called *line support region (LSR)*. Such region is divided
	//! into a set of bands ![inline formula](https://latex.codecogs.com/png.latex?%5C%7BB%5F1%2C%20B%5F2%2C%20%2E%2E%2E%2C%20B%5Fm%5C%7D), whose length equals the one of line.
	//!
	//! If we indicate with ![inline formula](https://latex.codecogs.com/png.latex?%5Cbf%7Bd%7D%5FL) the direction of line, the orthogonal and clockwise direction to line
	//! ![inline formula](https://latex.codecogs.com/png.latex?%5Cbf%7Bd%7D%5F%7B%5Cperp%7D) can be determined; these two directions, are used to construct a reference frame
	//! centered in the middle point of line. The gradients of pixels ![inline formula](https://latex.codecogs.com/png.latex?%5Cbf%7Bg%27%7D) inside LSR can be projected
	//! to the newly determined frame, obtaining their local equivalent
	//! ![inline formula](https://latex.codecogs.com/png.latex?%5Cbf%7Bg%27%7D%20%3D%20%28%5Cbf%7Bg%7D%5ET%20%5Ccdot%20%5Cbf%7Bd%7D%5F%7B%5Cperp%7D%2C%20%5Cbf%7Bg%7D%5ET%20%5Ccdot%20%5Cbf%7Bd%7D%5FL%29%5ET%20%5Ctriangleq%20%28%5Cbf%7Bg%27%7D%5F%7Bd%5F%7B%5Cperp%7D%7D%2C%20%5Cbf%7Bg%27%7D%5F%7Bd%5FL%7D%29%5ET).
	//!
	//! Later on, a Gaussian function is applied to all LSR's pixels along ![inline formula](https://latex.codecogs.com/png.latex?%5Cbf%7Bd%7D%5F%5Cperp) direction; first,
	//! we assign a global weighting coefficient ![inline formula](https://latex.codecogs.com/png.latex?f%5Fg%28i%29%20%3D%20%281%2F%5Csqrt%7B2%5Cpi%7D%5Csigma%5Fg%29e%5E%7B%2Dd%5E2%5Fi%2F2%5Csigma%5E2%5Fg%7D) to
	//! *i*-th row in LSR, where ![inline formula](https://latex.codecogs.com/png.latex?d%5Fi) is the distance of *i*-th row from the center row in LSR,
	//! ![inline formula](https://latex.codecogs.com/png.latex?%5Csigma%5Fg%20%3D%200%2E5%28m%20%5Ccdot%20w%20%2D%201%29) and ![inline formula](https://latex.codecogs.com/png.latex?w) is the width of bands (the same for every band). Secondly,
	//! considering a band ![inline formula](https://latex.codecogs.com/png.latex?B%5Fj) and its neighbor bands ![inline formula](https://latex.codecogs.com/png.latex?B%5F%7Bj%2D1%7D%2C%20B%5F%7Bj%2B1%7D), we assign a local weighting
	//! ![inline formula](https://latex.codecogs.com/png.latex?F%5Fl%28k%29%20%3D%20%281%2F%5Csqrt%7B2%5Cpi%7D%5Csigma%5Fl%29e%5E%7B%2Dd%27%5E2%5Fk%2F2%5Csigma%5Fl%5E2%7D), where ![inline formula](https://latex.codecogs.com/png.latex?d%27%5Fk) is the distance of *k*-th
	//! row from the center row in ![inline formula](https://latex.codecogs.com/png.latex?B%5Fj) and ![inline formula](https://latex.codecogs.com/png.latex?%5Csigma%5Fl%20%3D%20w). Using the global and local weights, we obtain,
	//! at the same time, the reduction of role played by gradients far from line and of boundary effect,
	//! respectively.
	//!
	//! Each band ![inline formula](https://latex.codecogs.com/png.latex?B%5Fj) in LSR has an associated *band descriptor(BD)* which is computed considering
	//! previous and next band (top and bottom bands are ignored when computing descriptor for first and
	//! last band). Once each band has been assignen its BD, the LBD descriptor of line is simply given by
	//!
	//! ![block formula](https://latex.codecogs.com/png.latex?LBD%20%3D%20%28BD%5F1%5ET%2C%20BD%5F2%5ET%2C%20%2E%2E%2E%20%2C%20BD%5ET%5Fm%29%5ET%2E)
	//!
	//! To compute a band descriptor ![inline formula](https://latex.codecogs.com/png.latex?B%5Fj), each *k*-th row in it is considered and the gradients in such
	//! row are accumulated:
	//!
	//! ![block formula](https://latex.codecogs.com/png.latex?%5Cbegin%7Bmatrix%7D%20%5Cbf%7BV1%7D%5Ek%5Fj%20%3D%20%5Clambda%20%5Csum%5Climits%5F%7B%5Cbf%7Bg%7D%27%5F%7Bd%5F%5Cperp%7D%3E0%7D%5Cbf%7Bg%7D%27%5F%7Bd%5F%5Cperp%7D%2C%20%26%20%20%5Cbf%7BV2%7D%5Ek%5Fj%20%3D%20%5Clambda%20%5Csum%5Climits%5F%7B%5Cbf%7Bg%7D%27%5F%7Bd%5F%5Cperp%7D%3C0%7D%20%2D%5Cbf%7Bg%7D%27%5F%7Bd%5F%5Cperp%7D%2C%20%5C%5C%20%5Cbf%7BV3%7D%5Ek%5Fj%20%3D%20%5Clambda%20%5Csum%5Climits%5F%7B%5Cbf%7Bg%7D%27%5F%7Bd%5FL%7D%3E0%7D%5Cbf%7Bg%7D%27%5F%7Bd%5FL%7D%2C%20%26%20%5Cbf%7BV4%7D%5Ek%5Fj%20%3D%20%5Clambda%20%5Csum%5Climits%5F%7B%5Cbf%7Bg%7D%27%5F%7Bd%5FL%7D%3C0%7D%20%2D%5Cbf%7Bg%7D%27%5F%7Bd%5FL%7D%5Cend%7Bmatrix%7D%2E)
	//!
	//! with ![inline formula](https://latex.codecogs.com/png.latex?%5Clambda%20%3D%20f%5Fg%28k%29f%5Fl%28k%29).
	//!
	//! By stacking previous results, we obtain the *band description matrix (BDM)*
	//!
	//! ![block formula](https://latex.codecogs.com/png.latex?BDM%5Fj%20%3D%20%5Cleft%28%5Cbegin%7Bmatrix%7D%20%5Cbf%7BV1%7D%5Fj%5E1%20%26%20%5Cbf%7BV1%7D%5Fj%5E2%20%26%20%5Cldots%20%26%20%5Cbf%7BV1%7D%5Fj%5En%20%5C%5C%20%5Cbf%7BV2%7D%5Fj%5E1%20%26%20%5Cbf%7BV2%7D%5Fj%5E2%20%26%20%5Cldots%20%26%20%5Cbf%7BV2%7D%5Fj%5En%20%5C%5C%20%5Cbf%7BV3%7D%5Fj%5E1%20%26%20%5Cbf%7BV3%7D%5Fj%5E2%20%26%20%5Cldots%20%26%20%5Cbf%7BV3%7D%5Fj%5En%20%5C%5C%20%5Cbf%7BV4%7D%5Fj%5E1%20%26%20%5Cbf%7BV4%7D%5Fj%5E2%20%26%20%5Cldots%20%26%20%5Cbf%7BV4%7D%5Fj%5En%20%5Cend%7Bmatrix%7D%20%5Cright%29%20%5Cin%20%5Cmathbb%7BR%7D%5E%7B4%5Ctimes%20n%7D%2C)
	//!
	//! with ![inline formula](https://latex.codecogs.com/png.latex?n) the number of rows in band ![inline formula](https://latex.codecogs.com/png.latex?B%5Fj):
	//!
	//! ![block formula](https://latex.codecogs.com/png.latex?n%20%3D%20%5Cbegin%7Bcases%7D%202w%2C%20%26%20j%20%3D%201%7C%7Cm%3B%20%5C%5C%203w%2C%20%26%20%5Cmbox%7Belse%7D%2E%20%5Cend%7Bcases%7D)
	//!
	//! Each ![inline formula](https://latex.codecogs.com/png.latex?BD%5Fj) can be obtained using the standard deviation vector ![inline formula](https://latex.codecogs.com/png.latex?S%5Fj) and mean vector ![inline formula](https://latex.codecogs.com/png.latex?M%5Fj) of
	//! ![inline formula](https://latex.codecogs.com/png.latex?BDM%5FJ). Thus, finally:
	//!
	//! ![block formula](https://latex.codecogs.com/png.latex?LBD%20%3D%20%28M%5F1%5ET%2C%20S%5F1%5ET%2C%20M%5F2%5ET%2C%20S%5F2%5ET%2C%20%5Cldots%2C%20M%5Fm%5ET%2C%20S%5Fm%5ET%29%5ET%20%5Cin%20%5Cmathbb%7BR%7D%5E%7B8m%7D)
	//!
	//! Once the LBD has been obtained, it must be converted into a binary form. For such purpose, we
	//! consider 32 possible pairs of BD inside it; each couple of BD is compared bit by bit and comparison
	//! generates an 8 bit string. Concatenating 32 comparison strings, we get the 256-bit final binary
	//! representation of a single LBD.
	use crate::mod_prelude::*;
	use crate::{core, sys, types};
	pub mod prelude {
		pub use super::{BinaryDescriptorMatcherTrait, BinaryDescriptorMatcherTraitConst, BinaryDescriptorTrait, BinaryDescriptorTraitConst, BinaryDescriptor_ParamsTrait, BinaryDescriptor_ParamsTraitConst, LSDDetectorTrait, LSDDetectorTraitConst};
	}

	/// Output image matrix will be created (Mat::create),
	/// i.e. existing memory of output image may be reused.
	/// Two source images, matches, and single keylines
	/// will be drawn.
	pub const DrawLinesMatchesFlags_DEFAULT: i32 = 0;
	/// Output image matrix will not be
	/// created (using Mat::create). Matches will be drawn
	/// on existing content of output image.
	pub const DrawLinesMatchesFlags_DRAW_OVER_OUTIMG: i32 = 1;
	/// Single keylines will not be drawn.
	pub const DrawLinesMatchesFlags_NOT_DRAW_SINGLE_LINES: i32 = 2;
	pub const MLN10: f64 = 2.30258509299404568402;
	pub const RELATIVE_ERROR_FACTOR: f64 = 100.0;
	#[repr(C)]
	#[derive(Copy, Clone, Debug, PartialEq, Eq)]
	pub enum DrawLinesMatchesFlags {
		/// Output image matrix will be created (Mat::create),
		/// i.e. existing memory of output image may be reused.
		/// Two source images, matches, and single keylines
		/// will be drawn.
		DEFAULT = 0,
		/// Output image matrix will not be
		/// created (using Mat::create). Matches will be drawn
		/// on existing content of output image.
		DRAW_OVER_OUTIMG = 1,
		/// Single keylines will not be drawn.
		NOT_DRAW_SINGLE_LINES = 2,
	}

	impl TryFrom<i32> for DrawLinesMatchesFlags {
		type Error = crate::Error;

		fn try_from(value: i32) -> Result<Self, Self::Error> {
			match value {
				0 => Ok(Self::DEFAULT),
				1 => Ok(Self::DRAW_OVER_OUTIMG),
				2 => Ok(Self::NOT_DRAW_SINGLE_LINES),
				_ => Err(crate::Error::new(crate::core::StsBadArg, format!("Value: {value} is not valid for enum: crate::line_descriptor::DrawLinesMatchesFlags"))),
			}
		}
	}

	opencv_type_enum! { crate::line_descriptor::DrawLinesMatchesFlags }

	pub type UINT16 = u16;
	pub type UINT32 = u32;
	pub type UINT64 = u64;
	pub type UINT8 = u8;
	/// Draws keylines.
	///
	/// ## Parameters
	/// * image: input image
	/// * keylines: keylines to be drawn
	/// * outImage: output image to draw on
	/// * color: color of lines to be drawn (if set to defaul value, color is chosen randomly)
	/// * flags: drawing flags
	///
	/// ## Note
	/// This alternative version of [draw_keylines] function uses the following default values for its arguments:
	/// * color: Scalar::all(-1)
	/// * flags: DrawLinesMatchesFlags::DEFAULT
	#[inline]
	pub fn draw_keylines_def(image: &impl core::MatTraitConst, keylines: &core::Vector<crate::line_descriptor::KeyLine>, out_image: &mut impl core::MatTrait) -> Result<()> {
		return_send!(via ocvrs_return);
		unsafe { sys::cv_line_descriptor_drawKeylines_const_MatR_const_vectorLKeyLineGR_MatR(image.as_raw_Mat(), keylines.as_raw_VectorOfKeyLine(), out_image.as_raw_mut_Mat(), ocvrs_return.as_mut_ptr()) };
		return_receive!(ocvrs_return => ret);
		let ret = ret.into_result()?;
		Ok(ret)
	}

	/// Draws keylines.
	///
	/// ## Parameters
	/// * image: input image
	/// * keylines: keylines to be drawn
	/// * outImage: output image to draw on
	/// * color: color of lines to be drawn (if set to defaul value, color is chosen randomly)
	/// * flags: drawing flags
	///
	/// ## C++ default parameters
	/// * color: Scalar::all(-1)
	/// * flags: DrawLinesMatchesFlags::DEFAULT
	#[inline]
	pub fn draw_keylines(image: &impl core::MatTraitConst, keylines: &core::Vector<crate::line_descriptor::KeyLine>, out_image: &mut impl core::MatTrait, color: core::Scalar, flags: i32) -> Result<()> {
		return_send!(via ocvrs_return);
		unsafe { sys::cv_line_descriptor_drawKeylines_const_MatR_const_vectorLKeyLineGR_MatR_const_ScalarR_int(image.as_raw_Mat(), keylines.as_raw_VectorOfKeyLine(), out_image.as_raw_mut_Mat(), &color, flags, ocvrs_return.as_mut_ptr()) };
		return_receive!(ocvrs_return => ret);
		let ret = ret.into_result()?;
		Ok(ret)
	}

	/// Draws the found matches of keylines from two images.
	///
	/// ## Parameters
	/// * img1: first image
	/// * keylines1: keylines extracted from first image
	/// * img2: second image
	/// * keylines2: keylines extracted from second image
	/// * matches1to2: vector of matches
	/// * outImg: output matrix to draw on
	/// * matchColor: drawing color for matches (chosen randomly in case of default value)
	/// * singleLineColor: drawing color for keylines (chosen randomly in case of default value)
	/// * matchesMask: mask to indicate which matches must be drawn
	/// * flags: drawing flags, see DrawLinesMatchesFlags
	///
	///
	/// Note: If both *matchColor* and *singleLineColor* are set to their default values, function draws
	/// matched lines and line connecting them with same color
	///
	/// ## Note
	/// This alternative version of [draw_line_matches] function uses the following default values for its arguments:
	/// * match_color: Scalar::all(-1)
	/// * single_line_color: Scalar::all(-1)
	/// * matches_mask: std::vector<char>()
	/// * flags: DrawLinesMatchesFlags::DEFAULT
	#[inline]
	pub fn draw_line_matches_def(img1: &impl core::MatTraitConst, keylines1: &core::Vector<crate::line_descriptor::KeyLine>, img2: &impl core::MatTraitConst, keylines2: &core::Vector<crate::line_descriptor::KeyLine>, matches1to2: &core::Vector<core::DMatch>, out_img: &mut impl core::MatTrait) -> Result<()> {
		return_send!(via ocvrs_return);
		unsafe { sys::cv_line_descriptor_drawLineMatches_const_MatR_const_vectorLKeyLineGR_const_MatR_const_vectorLKeyLineGR_const_vectorLDMatchGR_MatR(img1.as_raw_Mat(), keylines1.as_raw_VectorOfKeyLine(), img2.as_raw_Mat(), keylines2.as_raw_VectorOfKeyLine(), matches1to2.as_raw_VectorOfDMatch(), out_img.as_raw_mut_Mat(), ocvrs_return.as_mut_ptr()) };
		return_receive!(ocvrs_return => ret);
		let ret = ret.into_result()?;
		Ok(ret)
	}

	/// Draws the found matches of keylines from two images.
	///
	/// ## Parameters
	/// * img1: first image
	/// * keylines1: keylines extracted from first image
	/// * img2: second image
	/// * keylines2: keylines extracted from second image
	/// * matches1to2: vector of matches
	/// * outImg: output matrix to draw on
	/// * matchColor: drawing color for matches (chosen randomly in case of default value)
	/// * singleLineColor: drawing color for keylines (chosen randomly in case of default value)
	/// * matchesMask: mask to indicate which matches must be drawn
	/// * flags: drawing flags, see DrawLinesMatchesFlags
	///
	///
	/// Note: If both *matchColor* and *singleLineColor* are set to their default values, function draws
	/// matched lines and line connecting them with same color
	///
	/// ## C++ default parameters
	/// * match_color: Scalar::all(-1)
	/// * single_line_color: Scalar::all(-1)
	/// * matches_mask: std::vector<char>()
	/// * flags: DrawLinesMatchesFlags::DEFAULT
	#[inline]
	pub fn draw_line_matches(img1: &impl core::MatTraitConst, keylines1: &core::Vector<crate::line_descriptor::KeyLine>, img2: &impl core::MatTraitConst, keylines2: &core::Vector<crate::line_descriptor::KeyLine>, matches1to2: &core::Vector<core::DMatch>, out_img: &mut impl core::MatTrait, match_color: core::Scalar, single_line_color: core::Scalar, matches_mask: &core::Vector<c_char>, flags: i32) -> Result<()> {
		return_send!(via ocvrs_return);
		unsafe { sys::cv_line_descriptor_drawLineMatches_const_MatR_const_vectorLKeyLineGR_const_MatR_const_vectorLKeyLineGR_const_vectorLDMatchGR_MatR_const_ScalarR_const_ScalarR_const_vectorLcharGR_int(img1.as_raw_Mat(), keylines1.as_raw_VectorOfKeyLine(), img2.as_raw_Mat(), keylines2.as_raw_VectorOfKeyLine(), matches1to2.as_raw_VectorOfDMatch(), out_img.as_raw_mut_Mat(), &match_color, &single_line_color, matches_mask.as_raw_VectorOfc_char(), flags, ocvrs_return.as_mut_ptr()) };
		return_receive!(ocvrs_return => ret);
		let ret = ret.into_result()?;
		Ok(ret)
	}

	/// Class implements both functionalities for detection of lines and computation of their
	/// binary descriptor.
	///
	/// Class' interface is mainly based on the ones of classical detectors and extractors, such as
	/// Feature2d's [features2d_main] and [features2d_match]. Retrieved information about lines is
	/// stored in line_descriptor::KeyLine objects.
	pub struct BinaryDescriptor {
		ptr: *mut c_void,
	}

	opencv_type_boxed! { BinaryDescriptor }

	impl Drop for BinaryDescriptor {
		#[inline]
		fn drop(&mut self) {
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_delete(self.as_raw_mut_BinaryDescriptor()) };
		}
	}

	unsafe impl Send for BinaryDescriptor {}

	impl BinaryDescriptor {
		/// Constructor
		///
		/// ## Parameters
		/// * parameters: configuration parameters BinaryDescriptor::Params
		///
		/// If no argument is provided, constructor sets default values (see comments in the code snippet in
		/// previous section). Default values are strongly recommended.
		///
		/// ## C++ default parameters
		/// * parameters: BinaryDescriptor::Params()
		#[inline]
		pub fn new(parameters: &impl crate::line_descriptor::BinaryDescriptor_ParamsTraitConst) -> Result<crate::line_descriptor::BinaryDescriptor> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_BinaryDescriptor_const_ParamsR(parameters.as_raw_BinaryDescriptor_Params(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			let ret = unsafe { crate::line_descriptor::BinaryDescriptor::opencv_from_extern(ret) };
			Ok(ret)
		}

		/// Constructor
		///
		/// ## Parameters
		/// * parameters: configuration parameters BinaryDescriptor::Params
		///
		/// If no argument is provided, constructor sets default values (see comments in the code snippet in
		/// previous section). Default values are strongly recommended.
		///
		/// ## Note
		/// This alternative version of [new] function uses the following default values for its arguments:
		/// * parameters: BinaryDescriptor::Params()
		#[inline]
		pub fn new_def() -> Result<crate::line_descriptor::BinaryDescriptor> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_BinaryDescriptor(ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			let ret = unsafe { crate::line_descriptor::BinaryDescriptor::opencv_from_extern(ret) };
			Ok(ret)
		}

		/// Create a BinaryDescriptor object with default parameters (or with the ones provided)
		/// and return a smart pointer to it
		#[inline]
		pub fn create_binary_descriptor() -> Result<core::Ptr<crate::line_descriptor::BinaryDescriptor>> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_createBinaryDescriptor(ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			let ret = unsafe { core::Ptr::<crate::line_descriptor::BinaryDescriptor>::opencv_from_extern(ret) };
			Ok(ret)
		}

		#[inline]
		pub fn create_binary_descriptor_1(mut parameters: impl crate::line_descriptor::BinaryDescriptor_ParamsTrait) -> Result<core::Ptr<crate::line_descriptor::BinaryDescriptor>> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_createBinaryDescriptor_Params(parameters.as_raw_mut_BinaryDescriptor_Params(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			let ret = unsafe { core::Ptr::<crate::line_descriptor::BinaryDescriptor>::opencv_from_extern(ret) };
			Ok(ret)
		}

	}

	/// Constant methods for [crate::line_descriptor::BinaryDescriptor]
	pub trait BinaryDescriptorTraitConst: core::AlgorithmTraitConst {
		fn as_raw_BinaryDescriptor(&self) -> *const c_void;

		/// Store parameters to a FileStorage object
		///
		/// ## Parameters
		/// * fs: output FileStorage file
		#[inline]
		fn write(&self, fs: &mut impl core::FileStorageTrait) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_write_const_FileStorageR(self.as_raw_BinaryDescriptor(), fs.as_raw_mut_FileStorage(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// Requires line detection
		///
		/// ## Parameters
		/// * image: input image
		/// * keypoints: vector that will store extracted lines for one or more images
		/// * mask: mask matrix to detect only KeyLines of interest
		///
		/// ## Overloaded parameters
		///
		///
		/// * images: input images
		/// * keylines: set of vectors that will store extracted lines for one or more images
		/// * masks: vector of mask matrices to detect only KeyLines of interest from each input image
		///
		/// ## C++ default parameters
		/// * masks: std::vector<Mat>()
		#[inline]
		fn detect(&self, images: &core::Vector<core::Mat>, keylines: &mut core::Vector<core::Vector<crate::line_descriptor::KeyLine>>, masks: &core::Vector<core::Mat>) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_detect_const_const_vectorLMatGR_vectorLvectorLKeyLineGGR_const_vectorLMatGR(self.as_raw_BinaryDescriptor(), images.as_raw_VectorOfMat(), keylines.as_raw_mut_VectorOfVectorOfKeyLine(), masks.as_raw_VectorOfMat(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// @overload
		///
		/// ## Parameters
		/// * images: input images
		/// * keylines: set of vectors that will store extracted lines for one or more images
		/// * masks: vector of mask matrices to detect only KeyLines of interest from each input image
		///
		/// ## Note
		/// This alternative version of [BinaryDescriptorTraitConst::detect] function uses the following default values for its arguments:
		/// * masks: std::vector<Mat>()
		#[inline]
		fn detect_def(&self, images: &core::Vector<core::Mat>, keylines: &mut core::Vector<core::Vector<crate::line_descriptor::KeyLine>>) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_detect_const_const_vectorLMatGR_vectorLvectorLKeyLineGGR(self.as_raw_BinaryDescriptor(), images.as_raw_VectorOfMat(), keylines.as_raw_mut_VectorOfVectorOfKeyLine(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// Requires descriptors computation
		///
		/// ## Parameters
		/// * image: input image
		/// * keylines: vector containing lines for which descriptors must be computed
		/// * descriptors: 
		/// * returnFloatDescr: flag (when set to true, original non-binary descriptors are returned)
		///
		/// ## C++ default parameters
		/// * return_float_descr: false
		#[inline]
		fn compute(&self, image: &impl core::MatTraitConst, keylines: &mut core::Vector<crate::line_descriptor::KeyLine>, descriptors: &mut impl core::MatTrait, return_float_descr: bool) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_compute_const_const_MatR_vectorLKeyLineGR_MatR_bool(self.as_raw_BinaryDescriptor(), image.as_raw_Mat(), keylines.as_raw_mut_VectorOfKeyLine(), descriptors.as_raw_mut_Mat(), return_float_descr, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// Requires descriptors computation
		///
		/// ## Parameters
		/// * image: input image
		/// * keylines: vector containing lines for which descriptors must be computed
		/// * descriptors: 
		/// * returnFloatDescr: flag (when set to true, original non-binary descriptors are returned)
		///
		/// ## Note
		/// This alternative version of [BinaryDescriptorTraitConst::compute] function uses the following default values for its arguments:
		/// * return_float_descr: false
		#[inline]
		fn compute_def(&self, image: &impl core::MatTraitConst, keylines: &mut core::Vector<crate::line_descriptor::KeyLine>, descriptors: &mut impl core::MatTrait) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_compute_const_const_MatR_vectorLKeyLineGR_MatR(self.as_raw_BinaryDescriptor(), image.as_raw_Mat(), keylines.as_raw_mut_VectorOfKeyLine(), descriptors.as_raw_mut_Mat(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// Requires descriptors computation
		///
		/// ## Parameters
		/// * image: input image
		/// * keylines: vector containing lines for which descriptors must be computed
		/// * descriptors: 
		/// * returnFloatDescr: flag (when set to true, original non-binary descriptors are returned)
		///
		/// ## Overloaded parameters
		///
		///
		/// * images: input images
		/// * keylines: set of vectors containing lines for which descriptors must be computed
		/// * descriptors: 
		/// * returnFloatDescr: flag (when set to true, original non-binary descriptors are returned)
		///
		/// ## C++ default parameters
		/// * return_float_descr: false
		#[inline]
		fn compute_1(&self, images: &core::Vector<core::Mat>, keylines: &mut core::Vector<core::Vector<crate::line_descriptor::KeyLine>>, descriptors: &mut core::Vector<core::Mat>, return_float_descr: bool) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_compute_const_const_vectorLMatGR_vectorLvectorLKeyLineGGR_vectorLMatGR_bool(self.as_raw_BinaryDescriptor(), images.as_raw_VectorOfMat(), keylines.as_raw_mut_VectorOfVectorOfKeyLine(), descriptors.as_raw_mut_VectorOfMat(), return_float_descr, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// @overload
		///
		/// ## Parameters
		/// * images: input images
		/// * keylines: set of vectors containing lines for which descriptors must be computed
		/// * descriptors: 
		/// * returnFloatDescr: flag (when set to true, original non-binary descriptors are returned)
		///
		/// ## Note
		/// This alternative version of [BinaryDescriptorTraitConst::compute] function uses the following default values for its arguments:
		/// * return_float_descr: false
		#[inline]
		fn compute_def_1(&self, images: &core::Vector<core::Mat>, keylines: &mut core::Vector<core::Vector<crate::line_descriptor::KeyLine>>, descriptors: &mut core::Vector<core::Mat>) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_compute_const_const_vectorLMatGR_vectorLvectorLKeyLineGGR_vectorLMatGR(self.as_raw_BinaryDescriptor(), images.as_raw_VectorOfMat(), keylines.as_raw_mut_VectorOfVectorOfKeyLine(), descriptors.as_raw_mut_VectorOfMat(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// Return descriptor size
		#[inline]
		fn descriptor_size(&self) -> Result<i32> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_descriptorSize_const(self.as_raw_BinaryDescriptor(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// Return data type
		#[inline]
		fn descriptor_type(&self) -> Result<i32> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_descriptorType_const(self.as_raw_BinaryDescriptor(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// returns norm mode
		#[inline]
		fn default_norm(&self) -> Result<i32> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_defaultNorm_const(self.as_raw_BinaryDescriptor(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// Define operator '()' to perform detection of KeyLines and computation of descriptors in a row.
		///
		/// ## Parameters
		/// * image: input image
		/// * mask: mask matrix to select which lines in KeyLines must be accepted among the ones
		/// extracted (used when *keylines* is not empty)
		/// * keylines: vector that contains input lines (when filled, the detection part will be skipped
		/// and input lines will be passed as input to the algorithm computing descriptors)
		/// * descriptors: matrix that will store final descriptors
		/// * useProvidedKeyLines: flag (when set to true, detection phase will be skipped and only
		/// computation of descriptors will be executed, using lines provided in *keylines*)
		/// * returnFloatDescr: flag (when set to true, original non-binary descriptors are returned)
		///
		/// ## C++ default parameters
		/// * use_provided_key_lines: false
		/// * return_float_descr: false
		#[inline]
		fn apply(&self, image: &impl ToInputArray, mask: &impl ToInputArray, keylines: &mut core::Vector<crate::line_descriptor::KeyLine>, descriptors: &mut impl ToOutputArray, use_provided_key_lines: bool, return_float_descr: bool) -> Result<()> {
			input_array_arg!(image);
			input_array_arg!(mask);
			output_array_arg!(descriptors);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_operator___const_const__InputArrayR_const__InputArrayR_vectorLKeyLineGR_const__OutputArrayR_bool_bool(self.as_raw_BinaryDescriptor(), image.as_raw__InputArray(), mask.as_raw__InputArray(), keylines.as_raw_mut_VectorOfKeyLine(), descriptors.as_raw__OutputArray(), use_provided_key_lines, return_float_descr, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// Define operator '()' to perform detection of KeyLines and computation of descriptors in a row.
		///
		/// ## Parameters
		/// * image: input image
		/// * mask: mask matrix to select which lines in KeyLines must be accepted among the ones
		/// extracted (used when *keylines* is not empty)
		/// * keylines: vector that contains input lines (when filled, the detection part will be skipped
		/// and input lines will be passed as input to the algorithm computing descriptors)
		/// * descriptors: matrix that will store final descriptors
		/// * useProvidedKeyLines: flag (when set to true, detection phase will be skipped and only
		/// computation of descriptors will be executed, using lines provided in *keylines*)
		/// * returnFloatDescr: flag (when set to true, original non-binary descriptors are returned)
		///
		/// ## Note
		/// This alternative version of [BinaryDescriptorTraitConst::apply] function uses the following default values for its arguments:
		/// * use_provided_key_lines: false
		/// * return_float_descr: false
		#[inline]
		fn apply_def(&self, image: &impl ToInputArray, mask: &impl ToInputArray, keylines: &mut core::Vector<crate::line_descriptor::KeyLine>, descriptors: &mut impl ToOutputArray) -> Result<()> {
			input_array_arg!(image);
			input_array_arg!(mask);
			output_array_arg!(descriptors);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_operator___const_const__InputArrayR_const__InputArrayR_vectorLKeyLineGR_const__OutputArrayR(self.as_raw_BinaryDescriptor(), image.as_raw__InputArray(), mask.as_raw__InputArray(), keylines.as_raw_mut_VectorOfKeyLine(), descriptors.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

	}

	/// Mutable methods for [crate::line_descriptor::BinaryDescriptor]
	pub trait BinaryDescriptorTrait: core::AlgorithmTrait + crate::line_descriptor::BinaryDescriptorTraitConst {
		fn as_raw_mut_BinaryDescriptor(&mut self) -> *mut c_void;

		/// Get current number of octaves
		#[inline]
		fn get_num_of_octaves(&mut self) -> Result<i32> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_getNumOfOctaves(self.as_raw_mut_BinaryDescriptor(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// Set number of octaves
		/// ## Parameters
		/// * octaves: number of octaves
		#[inline]
		fn set_num_of_octaves(&mut self, octaves: i32) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_setNumOfOctaves_int(self.as_raw_mut_BinaryDescriptor(), octaves, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// Get current width of bands
		#[inline]
		fn get_width_of_band(&mut self) -> Result<i32> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_getWidthOfBand(self.as_raw_mut_BinaryDescriptor(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// Set width of bands
		/// ## Parameters
		/// * width: width of bands
		#[inline]
		fn set_width_of_band(&mut self, width: i32) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_setWidthOfBand_int(self.as_raw_mut_BinaryDescriptor(), width, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// Get current reduction ratio (used in Gaussian pyramids)
		#[inline]
		fn get_reduction_ratio(&mut self) -> Result<i32> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_getReductionRatio(self.as_raw_mut_BinaryDescriptor(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// Set reduction ratio (used in Gaussian pyramids)
		/// ## Parameters
		/// * rRatio: reduction ratio
		#[inline]
		fn set_reduction_ratio(&mut self, r_ratio: i32) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_setReductionRatio_int(self.as_raw_mut_BinaryDescriptor(), r_ratio, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// Read parameters from a FileNode object and store them
		///
		/// ## Parameters
		/// * fn: source FileNode file
		#[inline]
		fn read(&mut self, fn_: &impl core::FileNodeTraitConst) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_read_const_FileNodeR(self.as_raw_mut_BinaryDescriptor(), fn_.as_raw_FileNode(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// Requires line detection
		///
		/// ## Parameters
		/// * image: input image
		/// * keypoints: vector that will store extracted lines for one or more images
		/// * mask: mask matrix to detect only KeyLines of interest
		///
		/// ## C++ default parameters
		/// * mask: Mat()
		#[inline]
		fn detect_1(&mut self, image: &impl core::MatTraitConst, keypoints: &mut core::Vector<crate::line_descriptor::KeyLine>, mask: &impl core::MatTraitConst) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_detect_const_MatR_vectorLKeyLineGR_const_MatR(self.as_raw_mut_BinaryDescriptor(), image.as_raw_Mat(), keypoints.as_raw_mut_VectorOfKeyLine(), mask.as_raw_Mat(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// Requires line detection
		///
		/// ## Parameters
		/// * image: input image
		/// * keypoints: vector that will store extracted lines for one or more images
		/// * mask: mask matrix to detect only KeyLines of interest
		///
		/// ## Note
		/// This alternative version of [BinaryDescriptorTrait::detect] function uses the following default values for its arguments:
		/// * mask: Mat()
		#[inline]
		fn detect_def_1(&mut self, image: &impl core::MatTraitConst, keypoints: &mut core::Vector<crate::line_descriptor::KeyLine>) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_detect_const_MatR_vectorLKeyLineGR(self.as_raw_mut_BinaryDescriptor(), image.as_raw_Mat(), keypoints.as_raw_mut_VectorOfKeyLine(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

	}

	impl std::fmt::Debug for BinaryDescriptor {
		#[inline]
		fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
			f.debug_struct("BinaryDescriptor")
				.finish()
		}
	}

	boxed_cast_base! { BinaryDescriptor, core::Algorithm, cv_line_descriptor_BinaryDescriptor_to_Algorithm }

	impl core::AlgorithmTraitConst for BinaryDescriptor {
		#[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() }
	}

	impl core::AlgorithmTrait for BinaryDescriptor {
		#[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() }
	}

	boxed_ref! { BinaryDescriptor, core::AlgorithmTraitConst, as_raw_Algorithm, core::AlgorithmTrait, as_raw_mut_Algorithm }

	impl crate::line_descriptor::BinaryDescriptorTraitConst for BinaryDescriptor {
		#[inline] fn as_raw_BinaryDescriptor(&self) -> *const c_void { self.as_raw() }
	}

	impl crate::line_descriptor::BinaryDescriptorTrait for BinaryDescriptor {
		#[inline] fn as_raw_mut_BinaryDescriptor(&mut self) -> *mut c_void { self.as_raw_mut() }
	}

	boxed_ref! { BinaryDescriptor, crate::line_descriptor::BinaryDescriptorTraitConst, as_raw_BinaryDescriptor, crate::line_descriptor::BinaryDescriptorTrait, as_raw_mut_BinaryDescriptor }

	/// List of BinaryDescriptor parameters:
	pub struct BinaryDescriptor_Params {
		ptr: *mut c_void,
	}

	opencv_type_boxed! { BinaryDescriptor_Params }

	impl Drop for BinaryDescriptor_Params {
		#[inline]
		fn drop(&mut self) {
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_Params_delete(self.as_raw_mut_BinaryDescriptor_Params()) };
		}
	}

	unsafe impl Send for BinaryDescriptor_Params {}

	impl BinaryDescriptor_Params {
		#[inline]
		pub fn default() -> Result<crate::line_descriptor::BinaryDescriptor_Params> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_Params_Params(ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			let ret = unsafe { crate::line_descriptor::BinaryDescriptor_Params::opencv_from_extern(ret) };
			Ok(ret)
		}

	}

	/// Constant methods for [crate::line_descriptor::BinaryDescriptor_Params]
	pub trait BinaryDescriptor_ParamsTraitConst {
		fn as_raw_BinaryDescriptor_Params(&self) -> *const c_void;

		/// the number of image octaves (default = 1)
		#[inline]
		fn num_of_octave_(&self) -> i32 {
			let ret = unsafe { sys::cv_line_descriptor_BinaryDescriptor_Params_propNumOfOctave__const(self.as_raw_BinaryDescriptor_Params()) };
			ret
		}

		/// the width of band; (default: 7)
		#[inline]
		fn width_of_band_(&self) -> i32 {
			let ret = unsafe { sys::cv_line_descriptor_BinaryDescriptor_Params_propWidthOfBand__const(self.as_raw_BinaryDescriptor_Params()) };
			ret
		}

		/// image's reduction ratio in construction of Gaussian pyramids
		#[inline]
		fn reduction_ratio(&self) -> i32 {
			let ret = unsafe { sys::cv_line_descriptor_BinaryDescriptor_Params_propReductionRatio_const(self.as_raw_BinaryDescriptor_Params()) };
			ret
		}

		#[inline]
		fn ksize_(&self) -> i32 {
			let ret = unsafe { sys::cv_line_descriptor_BinaryDescriptor_Params_propKsize__const(self.as_raw_BinaryDescriptor_Params()) };
			ret
		}

		/// store parameters to a FileStorage object (struct function)
		#[inline]
		fn write(&self, fs: &mut impl core::FileStorageTrait) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_Params_write_const_FileStorageR(self.as_raw_BinaryDescriptor_Params(), fs.as_raw_mut_FileStorage(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

	}

	/// Mutable methods for [crate::line_descriptor::BinaryDescriptor_Params]
	pub trait BinaryDescriptor_ParamsTrait: crate::line_descriptor::BinaryDescriptor_ParamsTraitConst {
		fn as_raw_mut_BinaryDescriptor_Params(&mut self) -> *mut c_void;

		/// the number of image octaves (default = 1)
		#[inline]
		fn set_num_of_octave_(&mut self, val: i32) {
			let ret = unsafe { sys::cv_line_descriptor_BinaryDescriptor_Params_propNumOfOctave__const_int(self.as_raw_mut_BinaryDescriptor_Params(), val) };
			ret
		}

		/// the width of band; (default: 7)
		#[inline]
		fn set_width_of_band_(&mut self, val: i32) {
			let ret = unsafe { sys::cv_line_descriptor_BinaryDescriptor_Params_propWidthOfBand__const_int(self.as_raw_mut_BinaryDescriptor_Params(), val) };
			ret
		}

		/// image's reduction ratio in construction of Gaussian pyramids
		#[inline]
		fn set_reduction_ratio(&mut self, val: i32) {
			let ret = unsafe { sys::cv_line_descriptor_BinaryDescriptor_Params_propReductionRatio_const_int(self.as_raw_mut_BinaryDescriptor_Params(), val) };
			ret
		}

		#[inline]
		fn set_ksize_(&mut self, val: i32) {
			let ret = unsafe { sys::cv_line_descriptor_BinaryDescriptor_Params_propKsize__const_int(self.as_raw_mut_BinaryDescriptor_Params(), val) };
			ret
		}

		/// read parameters from a FileNode object and store them (struct function)
		#[inline]
		fn read(&mut self, fn_: &impl core::FileNodeTraitConst) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptor_Params_read_const_FileNodeR(self.as_raw_mut_BinaryDescriptor_Params(), fn_.as_raw_FileNode(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

	}

	impl std::fmt::Debug for BinaryDescriptor_Params {
		#[inline]
		fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
			f.debug_struct("BinaryDescriptor_Params")
				.field("num_of_octave_", &crate::line_descriptor::BinaryDescriptor_ParamsTraitConst::num_of_octave_(self))
				.field("width_of_band_", &crate::line_descriptor::BinaryDescriptor_ParamsTraitConst::width_of_band_(self))
				.field("reduction_ratio", &crate::line_descriptor::BinaryDescriptor_ParamsTraitConst::reduction_ratio(self))
				.field("ksize_", &crate::line_descriptor::BinaryDescriptor_ParamsTraitConst::ksize_(self))
				.finish()
		}
	}

	impl crate::line_descriptor::BinaryDescriptor_ParamsTraitConst for BinaryDescriptor_Params {
		#[inline] fn as_raw_BinaryDescriptor_Params(&self) -> *const c_void { self.as_raw() }
	}

	impl crate::line_descriptor::BinaryDescriptor_ParamsTrait for BinaryDescriptor_Params {
		#[inline] fn as_raw_mut_BinaryDescriptor_Params(&mut self) -> *mut c_void { self.as_raw_mut() }
	}

	boxed_ref! { BinaryDescriptor_Params, crate::line_descriptor::BinaryDescriptor_ParamsTraitConst, as_raw_BinaryDescriptor_Params, crate::line_descriptor::BinaryDescriptor_ParamsTrait, as_raw_mut_BinaryDescriptor_Params }

	/// furnishes all functionalities for querying a dataset provided by user or internal to
	/// class (that user must, anyway, populate) on the model of [features2d_match]
	///
	///
	/// Once descriptors have been extracted from an image (both they represent lines and points), it
	/// becomes interesting to be able to match a descriptor with another one extracted from a different
	/// image and representing the same line or point, seen from a differente perspective or on a different
	/// scale. In reaching such goal, the main headache is designing an efficient search algorithm to
	/// associate a query descriptor to one extracted from a dataset. In the following, a matching modality
	/// based on *Multi-Index Hashing (MiHashing)* will be described.
	///
	/// Multi-Index Hashing
	/// -------------------
	///
	/// The theory described in this section is based on [MIH](https://docs.opencv.org/4.11.0/d0/de3/citelist.html#CITEREF_MIH) . Given a dataset populated with binary
	/// codes, each code is indexed *m* times into *m* different hash tables, according to *m* substrings it
	/// has been divided into. Thus, given a query code, all the entries close to it at least in one
	/// substring are returned by search as *neighbor candidates*. Returned entries are then checked for
	/// validity by verifying that their full codes are not distant (in Hamming space) more than *r* bits
	/// from query code. In details, each binary code **h** composed of *b* bits is divided into *m*
	/// disjoint substrings ![inline formula](https://latex.codecogs.com/png.latex?%5Cmathbf%7Bh%7D%5E%7B%281%29%7D%2C%20%2E%2E%2E%2C%20%5Cmathbf%7Bh%7D%5E%7B%28m%29%7D), each with length
	/// ![inline formula](https://latex.codecogs.com/png.latex?%5Clfloor%20b%2Fm%20%5Crfloor) or ![inline formula](https://latex.codecogs.com/png.latex?%5Clceil%20b%2Fm%20%5Crceil) bits. Formally, when two codes **h** and **g** differ
	/// by at the most *r* bits, in at the least one of their *m* substrings they differ by at the most
	/// ![inline formula](https://latex.codecogs.com/png.latex?%5Clfloor%20r%2Fm%20%5Crfloor) bits. In particular, when ![inline formula](https://latex.codecogs.com/png.latex?%7C%7C%5Cmathbf%7Bh%7D%2D%5Cmathbf%7Bg%7D%7C%7C%5FH%20%5Cle%20r) (where ![inline formula](https://latex.codecogs.com/png.latex?%7C%7C%2E%7C%7C%5FH)
	/// is the Hamming norm), there must exist a substring *k* (with ![inline formula](https://latex.codecogs.com/png.latex?1%20%5Cle%20k%20%5Cle%20m)) such that
	///
	/// ![block formula](https://latex.codecogs.com/png.latex?%7C%7C%5Cmathbf%7Bh%7D%5E%7B%28k%29%7D%20%2D%20%5Cmathbf%7Bg%7D%5E%7B%28k%29%7D%7C%7C%5FH%20%5Cle%20%5Cleft%5Clfloor%20%5Cfrac%7Br%7D%7Bm%7D%20%5Cright%5Crfloor%20%2E)
	///
	/// That means that if Hamming distance between each of the *m* substring is strictly greater than
	/// ![inline formula](https://latex.codecogs.com/png.latex?%5Clfloor%20r%2Fm%20%5Crfloor), then ![inline formula](https://latex.codecogs.com/png.latex?%7C%7C%5Cmathbf%7Bh%7D%2D%5Cmathbf%7Bg%7D%7C%7C%5FH) must be larger that *r* and that is a
	/// contradiction. If the codes in dataset are divided into *m* substrings, then *m* tables will be
	/// built. Given a query **q** with substrings ![inline formula](https://latex.codecogs.com/png.latex?%5C%7B%5Cmathbf%7Bq%7D%5E%7B%28i%29%7D%5C%7D%5Em%5F%7Bi%3D1%7D), *i*-th hash table is
	/// searched for entries distant at the most ![inline formula](https://latex.codecogs.com/png.latex?%5Clfloor%20r%2Fm%20%5Crfloor) from ![inline formula](https://latex.codecogs.com/png.latex?%5Cmathbf%7Bq%7D%5E%7B%28i%29%7D) and a set of
	/// candidates ![inline formula](https://latex.codecogs.com/png.latex?%5Cmathcal%7BN%7D%5Fi%28%5Cmathbf%7Bq%7D%29) is obtained. The union of sets
	/// ![inline formula](https://latex.codecogs.com/png.latex?%5Cmathcal%7BN%7D%28%5Cmathbf%7Bq%7D%29%20%3D%20%5Cbigcup%5Fi%20%5Cmathcal%7BN%7D%5Fi%28%5Cmathbf%7Bq%7D%29) is a superset of the *r*-neighbors
	/// of **q**. Then, last step of algorithm is computing the Hamming distance between **q** and each
	/// element in ![inline formula](https://latex.codecogs.com/png.latex?%5Cmathcal%7BN%7D%28%5Cmathbf%7Bq%7D%29), deleting the codes that are distant more that *r* from **q**.
	pub struct BinaryDescriptorMatcher {
		ptr: *mut c_void,
	}

	opencv_type_boxed! { BinaryDescriptorMatcher }

	impl Drop for BinaryDescriptorMatcher {
		#[inline]
		fn drop(&mut self) {
			unsafe { sys::cv_line_descriptor_BinaryDescriptorMatcher_delete(self.as_raw_mut_BinaryDescriptorMatcher()) };
		}
	}

	unsafe impl Send for BinaryDescriptorMatcher {}

	impl BinaryDescriptorMatcher {
		/// Create a BinaryDescriptorMatcher object and return a smart pointer to it.
		#[inline]
		pub fn create_binary_descriptor_matcher() -> Result<core::Ptr<crate::line_descriptor::BinaryDescriptorMatcher>> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptorMatcher_createBinaryDescriptorMatcher(ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			let ret = unsafe { core::Ptr::<crate::line_descriptor::BinaryDescriptorMatcher>::opencv_from_extern(ret) };
			Ok(ret)
		}

		/// Constructor.
		///
		/// The BinaryDescriptorMatcher constructed is able to store and manage 256-bits long entries.
		#[inline]
		pub fn default() -> Result<crate::line_descriptor::BinaryDescriptorMatcher> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptorMatcher_BinaryDescriptorMatcher(ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			let ret = unsafe { crate::line_descriptor::BinaryDescriptorMatcher::opencv_from_extern(ret) };
			Ok(ret)
		}

	}

	/// Constant methods for [crate::line_descriptor::BinaryDescriptorMatcher]
	pub trait BinaryDescriptorMatcherTraitConst: core::AlgorithmTraitConst {
		fn as_raw_BinaryDescriptorMatcher(&self) -> *const c_void;

		/// For every input query descriptor, retrieve the best matching one from a dataset provided from user
		/// or from the one internal to class
		///
		/// ## Parameters
		/// * queryDescriptors: query descriptors
		/// * trainDescriptors: dataset of descriptors furnished by user
		/// * matches: vector to host retrieved matches
		/// * mask: mask to select which input descriptors must be matched to one in dataset
		///
		/// ## C++ default parameters
		/// * mask: Mat()
		#[inline]
		fn match_(&self, query_descriptors: &impl core::MatTraitConst, train_descriptors: &impl core::MatTraitConst, matches: &mut core::Vector<core::DMatch>, mask: &impl core::MatTraitConst) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptorMatcher_match_const_const_MatR_const_MatR_vectorLDMatchGR_const_MatR(self.as_raw_BinaryDescriptorMatcher(), query_descriptors.as_raw_Mat(), train_descriptors.as_raw_Mat(), matches.as_raw_mut_VectorOfDMatch(), mask.as_raw_Mat(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// For every input query descriptor, retrieve the best matching one from a dataset provided from user
		/// or from the one internal to class
		///
		/// ## Parameters
		/// * queryDescriptors: query descriptors
		/// * trainDescriptors: dataset of descriptors furnished by user
		/// * matches: vector to host retrieved matches
		/// * mask: mask to select which input descriptors must be matched to one in dataset
		///
		/// ## Note
		/// This alternative version of [BinaryDescriptorMatcherTraitConst::match_] function uses the following default values for its arguments:
		/// * mask: Mat()
		#[inline]
		fn match__def(&self, query_descriptors: &impl core::MatTraitConst, train_descriptors: &impl core::MatTraitConst, matches: &mut core::Vector<core::DMatch>) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptorMatcher_match_const_const_MatR_const_MatR_vectorLDMatchGR(self.as_raw_BinaryDescriptorMatcher(), query_descriptors.as_raw_Mat(), train_descriptors.as_raw_Mat(), matches.as_raw_mut_VectorOfDMatch(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// For every input query descriptor, retrieve the best *k* matching ones from a dataset provided from
		/// user or from the one internal to class
		///
		/// ## Parameters
		/// * queryDescriptors: query descriptors
		/// * trainDescriptors: dataset of descriptors furnished by user
		/// * matches: vector to host retrieved matches
		/// * k: number of the closest descriptors to be returned for every input query
		/// * mask: mask to select which input descriptors must be matched to ones in dataset
		/// * compactResult: flag to obtain a compact result (if true, a vector that doesn't contain any
		/// matches for a given query is not inserted in final result)
		///
		/// ## C++ default parameters
		/// * mask: Mat()
		/// * compact_result: false
		#[inline]
		fn knn_match(&self, query_descriptors: &impl core::MatTraitConst, train_descriptors: &impl core::MatTraitConst, matches: &mut core::Vector<core::Vector<core::DMatch>>, k: i32, mask: &impl core::MatTraitConst, compact_result: bool) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptorMatcher_knnMatch_const_const_MatR_const_MatR_vectorLvectorLDMatchGGR_int_const_MatR_bool(self.as_raw_BinaryDescriptorMatcher(), query_descriptors.as_raw_Mat(), train_descriptors.as_raw_Mat(), matches.as_raw_mut_VectorOfVectorOfDMatch(), k, mask.as_raw_Mat(), compact_result, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// For every input query descriptor, retrieve the best *k* matching ones from a dataset provided from
		/// user or from the one internal to class
		///
		/// ## Parameters
		/// * queryDescriptors: query descriptors
		/// * trainDescriptors: dataset of descriptors furnished by user
		/// * matches: vector to host retrieved matches
		/// * k: number of the closest descriptors to be returned for every input query
		/// * mask: mask to select which input descriptors must be matched to ones in dataset
		/// * compactResult: flag to obtain a compact result (if true, a vector that doesn't contain any
		/// matches for a given query is not inserted in final result)
		///
		/// ## Note
		/// This alternative version of [BinaryDescriptorMatcherTraitConst::knn_match] function uses the following default values for its arguments:
		/// * mask: Mat()
		/// * compact_result: false
		#[inline]
		fn knn_match_def(&self, query_descriptors: &impl core::MatTraitConst, train_descriptors: &impl core::MatTraitConst, matches: &mut core::Vector<core::Vector<core::DMatch>>, k: i32) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptorMatcher_knnMatch_const_const_MatR_const_MatR_vectorLvectorLDMatchGGR_int(self.as_raw_BinaryDescriptorMatcher(), query_descriptors.as_raw_Mat(), train_descriptors.as_raw_Mat(), matches.as_raw_mut_VectorOfVectorOfDMatch(), k, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// For every input query descriptor, retrieve, from a dataset provided from user or from the one
		/// internal to class, all the descriptors that are not further than *maxDist* from input query
		///
		/// ## Parameters
		/// * queryDescriptors: query descriptors
		/// * trainDescriptors: dataset of descriptors furnished by user
		/// * matches: vector to host retrieved matches
		/// * maxDistance: search radius
		/// * mask: mask to select which input descriptors must be matched to ones in dataset
		/// * compactResult: flag to obtain a compact result (if true, a vector that doesn't contain any
		/// matches for a given query is not inserted in final result)
		///
		/// ## C++ default parameters
		/// * mask: Mat()
		/// * compact_result: false
		#[inline]
		fn radius_match(&self, query_descriptors: &impl core::MatTraitConst, train_descriptors: &impl core::MatTraitConst, matches: &mut core::Vector<core::Vector<core::DMatch>>, max_distance: f32, mask: &impl core::MatTraitConst, compact_result: bool) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptorMatcher_radiusMatch_const_const_MatR_const_MatR_vectorLvectorLDMatchGGR_float_const_MatR_bool(self.as_raw_BinaryDescriptorMatcher(), query_descriptors.as_raw_Mat(), train_descriptors.as_raw_Mat(), matches.as_raw_mut_VectorOfVectorOfDMatch(), max_distance, mask.as_raw_Mat(), compact_result, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// For every input query descriptor, retrieve, from a dataset provided from user or from the one
		/// internal to class, all the descriptors that are not further than *maxDist* from input query
		///
		/// ## Parameters
		/// * queryDescriptors: query descriptors
		/// * trainDescriptors: dataset of descriptors furnished by user
		/// * matches: vector to host retrieved matches
		/// * maxDistance: search radius
		/// * mask: mask to select which input descriptors must be matched to ones in dataset
		/// * compactResult: flag to obtain a compact result (if true, a vector that doesn't contain any
		/// matches for a given query is not inserted in final result)
		///
		/// ## Note
		/// This alternative version of [BinaryDescriptorMatcherTraitConst::radius_match] function uses the following default values for its arguments:
		/// * mask: Mat()
		/// * compact_result: false
		#[inline]
		fn radius_match_def(&self, query_descriptors: &impl core::MatTraitConst, train_descriptors: &impl core::MatTraitConst, matches: &mut core::Vector<core::Vector<core::DMatch>>, max_distance: f32) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptorMatcher_radiusMatch_const_const_MatR_const_MatR_vectorLvectorLDMatchGGR_float(self.as_raw_BinaryDescriptorMatcher(), query_descriptors.as_raw_Mat(), train_descriptors.as_raw_Mat(), matches.as_raw_mut_VectorOfVectorOfDMatch(), max_distance, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

	}

	/// Mutable methods for [crate::line_descriptor::BinaryDescriptorMatcher]
	pub trait BinaryDescriptorMatcherTrait: core::AlgorithmTrait + crate::line_descriptor::BinaryDescriptorMatcherTraitConst {
		fn as_raw_mut_BinaryDescriptorMatcher(&mut self) -> *mut c_void;

		/// For every input query descriptor, retrieve the best matching one from a dataset provided from user
		/// or from the one internal to class
		///
		/// ## Parameters
		/// * queryDescriptors: query descriptors
		/// * trainDescriptors: dataset of descriptors furnished by user
		/// * matches: vector to host retrieved matches
		/// * mask: mask to select which input descriptors must be matched to one in dataset
		///
		/// ## Overloaded parameters
		///
		/// * queryDescriptors: query descriptors
		/// * matches: vector to host retrieved matches
		/// * masks: vector of masks to select which input descriptors must be matched to one in dataset
		/// (the *i*-th mask in vector indicates whether each input query can be matched with descriptors in
		/// dataset relative to *i*-th image)
		///
		/// ## C++ default parameters
		/// * masks: std::vector<Mat>()
		#[inline]
		fn match_query(&mut self, query_descriptors: &impl core::MatTraitConst, matches: &mut core::Vector<core::DMatch>, masks: &core::Vector<core::Mat>) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptorMatcher_match_const_MatR_vectorLDMatchGR_const_vectorLMatGR(self.as_raw_mut_BinaryDescriptorMatcher(), query_descriptors.as_raw_Mat(), matches.as_raw_mut_VectorOfDMatch(), masks.as_raw_VectorOfMat(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// @overload
		/// ## Parameters
		/// * queryDescriptors: query descriptors
		/// * matches: vector to host retrieved matches
		/// * masks: vector of masks to select which input descriptors must be matched to one in dataset
		/// (the *i*-th mask in vector indicates whether each input query can be matched with descriptors in
		/// dataset relative to *i*-th image)
		///
		/// ## Note
		/// This alternative version of [BinaryDescriptorMatcherTrait::match_query] function uses the following default values for its arguments:
		/// * masks: std::vector<Mat>()
		#[inline]
		fn match_query_def(&mut self, query_descriptors: &impl core::MatTraitConst, matches: &mut core::Vector<core::DMatch>) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptorMatcher_match_const_MatR_vectorLDMatchGR(self.as_raw_mut_BinaryDescriptorMatcher(), query_descriptors.as_raw_Mat(), matches.as_raw_mut_VectorOfDMatch(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// For every input query descriptor, retrieve the best *k* matching ones from a dataset provided from
		/// user or from the one internal to class
		///
		/// ## Parameters
		/// * queryDescriptors: query descriptors
		/// * trainDescriptors: dataset of descriptors furnished by user
		/// * matches: vector to host retrieved matches
		/// * k: number of the closest descriptors to be returned for every input query
		/// * mask: mask to select which input descriptors must be matched to ones in dataset
		/// * compactResult: flag to obtain a compact result (if true, a vector that doesn't contain any
		/// matches for a given query is not inserted in final result)
		///
		/// ## Overloaded parameters
		///
		/// * queryDescriptors: query descriptors
		/// * matches: vector to host retrieved matches
		/// * k: number of the closest descriptors to be returned for every input query
		/// * masks: vector of masks to select which input descriptors must be matched to ones in dataset
		/// (the *i*-th mask in vector indicates whether each input query can be matched with descriptors in
		/// dataset relative to *i*-th image)
		/// * compactResult: flag to obtain a compact result (if true, a vector that doesn't contain any
		/// matches for a given query is not inserted in final result)
		///
		/// ## C++ default parameters
		/// * masks: std::vector<Mat>()
		/// * compact_result: false
		#[inline]
		fn knn_match_query(&mut self, query_descriptors: &impl core::MatTraitConst, matches: &mut core::Vector<core::Vector<core::DMatch>>, k: i32, masks: &core::Vector<core::Mat>, compact_result: bool) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptorMatcher_knnMatch_const_MatR_vectorLvectorLDMatchGGR_int_const_vectorLMatGR_bool(self.as_raw_mut_BinaryDescriptorMatcher(), query_descriptors.as_raw_Mat(), matches.as_raw_mut_VectorOfVectorOfDMatch(), k, masks.as_raw_VectorOfMat(), compact_result, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// @overload
		/// ## Parameters
		/// * queryDescriptors: query descriptors
		/// * matches: vector to host retrieved matches
		/// * k: number of the closest descriptors to be returned for every input query
		/// * masks: vector of masks to select which input descriptors must be matched to ones in dataset
		/// (the *i*-th mask in vector indicates whether each input query can be matched with descriptors in
		/// dataset relative to *i*-th image)
		/// * compactResult: flag to obtain a compact result (if true, a vector that doesn't contain any
		/// matches for a given query is not inserted in final result)
		///
		/// ## Note
		/// This alternative version of [BinaryDescriptorMatcherTrait::knn_match_query] function uses the following default values for its arguments:
		/// * masks: std::vector<Mat>()
		/// * compact_result: false
		#[inline]
		fn knn_match_query_def(&mut self, query_descriptors: &impl core::MatTraitConst, matches: &mut core::Vector<core::Vector<core::DMatch>>, k: i32) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptorMatcher_knnMatch_const_MatR_vectorLvectorLDMatchGGR_int(self.as_raw_mut_BinaryDescriptorMatcher(), query_descriptors.as_raw_Mat(), matches.as_raw_mut_VectorOfVectorOfDMatch(), k, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// For every input query descriptor, retrieve, from a dataset provided from user or from the one
		/// internal to class, all the descriptors that are not further than *maxDist* from input query
		///
		/// ## Parameters
		/// * queryDescriptors: query descriptors
		/// * trainDescriptors: dataset of descriptors furnished by user
		/// * matches: vector to host retrieved matches
		/// * maxDistance: search radius
		/// * mask: mask to select which input descriptors must be matched to ones in dataset
		/// * compactResult: flag to obtain a compact result (if true, a vector that doesn't contain any
		/// matches for a given query is not inserted in final result)
		///
		/// ## Overloaded parameters
		///
		/// * queryDescriptors: query descriptors
		/// * matches: vector to host retrieved matches
		/// * maxDistance: search radius
		/// * masks: vector of masks to select which input descriptors must be matched to ones in dataset
		/// (the *i*-th mask in vector indicates whether each input query can be matched with descriptors in
		/// dataset relative to *i*-th image)
		/// * compactResult: flag to obtain a compact result (if true, a vector that doesn't contain any
		/// matches for a given query is not inserted in final result)
		///
		/// ## C++ default parameters
		/// * masks: std::vector<Mat>()
		/// * compact_result: false
		#[inline]
		fn radius_match_1(&mut self, query_descriptors: &impl core::MatTraitConst, matches: &mut core::Vector<core::Vector<core::DMatch>>, max_distance: f32, masks: &core::Vector<core::Mat>, compact_result: bool) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptorMatcher_radiusMatch_const_MatR_vectorLvectorLDMatchGGR_float_const_vectorLMatGR_bool(self.as_raw_mut_BinaryDescriptorMatcher(), query_descriptors.as_raw_Mat(), matches.as_raw_mut_VectorOfVectorOfDMatch(), max_distance, masks.as_raw_VectorOfMat(), compact_result, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// @overload
		/// ## Parameters
		/// * queryDescriptors: query descriptors
		/// * matches: vector to host retrieved matches
		/// * maxDistance: search radius
		/// * masks: vector of masks to select which input descriptors must be matched to ones in dataset
		/// (the *i*-th mask in vector indicates whether each input query can be matched with descriptors in
		/// dataset relative to *i*-th image)
		/// * compactResult: flag to obtain a compact result (if true, a vector that doesn't contain any
		/// matches for a given query is not inserted in final result)
		///
		/// ## Note
		/// This alternative version of [BinaryDescriptorMatcherTrait::radius_match] function uses the following default values for its arguments:
		/// * masks: std::vector<Mat>()
		/// * compact_result: false
		#[inline]
		fn radius_match_def_1(&mut self, query_descriptors: &impl core::MatTraitConst, matches: &mut core::Vector<core::Vector<core::DMatch>>, max_distance: f32) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptorMatcher_radiusMatch_const_MatR_vectorLvectorLDMatchGGR_float(self.as_raw_mut_BinaryDescriptorMatcher(), query_descriptors.as_raw_Mat(), matches.as_raw_mut_VectorOfVectorOfDMatch(), max_distance, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// Store locally new descriptors to be inserted in dataset, without updating dataset.
		///
		/// ## Parameters
		/// * descriptors: matrices containing descriptors to be inserted into dataset
		///
		///
		/// Note: Each matrix *i* in **descriptors** should contain descriptors relative to lines extracted from
		/// *i*-th image.
		#[inline]
		fn add(&mut self, descriptors: &core::Vector<core::Mat>) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptorMatcher_add_const_vectorLMatGR(self.as_raw_mut_BinaryDescriptorMatcher(), descriptors.as_raw_VectorOfMat(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// Update dataset by inserting into it all descriptors that were stored locally by *add* function.
		///
		///
		/// Note: Every time this function is invoked, current dataset is deleted and locally stored descriptors
		/// are inserted into dataset. The locally stored copy of just inserted descriptors is then removed.
		#[inline]
		fn train(&mut self) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptorMatcher_train(self.as_raw_mut_BinaryDescriptorMatcher(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// Clear dataset and internal data
		#[inline]
		fn clear(&mut self) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_BinaryDescriptorMatcher_clear(self.as_raw_mut_BinaryDescriptorMatcher(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

	}

	impl std::fmt::Debug for BinaryDescriptorMatcher {
		#[inline]
		fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
			f.debug_struct("BinaryDescriptorMatcher")
				.finish()
		}
	}

	boxed_cast_base! { BinaryDescriptorMatcher, core::Algorithm, cv_line_descriptor_BinaryDescriptorMatcher_to_Algorithm }

	impl core::AlgorithmTraitConst for BinaryDescriptorMatcher {
		#[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() }
	}

	impl core::AlgorithmTrait for BinaryDescriptorMatcher {
		#[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() }
	}

	boxed_ref! { BinaryDescriptorMatcher, core::AlgorithmTraitConst, as_raw_Algorithm, core::AlgorithmTrait, as_raw_mut_Algorithm }

	impl crate::line_descriptor::BinaryDescriptorMatcherTraitConst for BinaryDescriptorMatcher {
		#[inline] fn as_raw_BinaryDescriptorMatcher(&self) -> *const c_void { self.as_raw() }
	}

	impl crate::line_descriptor::BinaryDescriptorMatcherTrait for BinaryDescriptorMatcher {
		#[inline] fn as_raw_mut_BinaryDescriptorMatcher(&mut self) -> *mut c_void { self.as_raw_mut() }
	}

	boxed_ref! { BinaryDescriptorMatcher, crate::line_descriptor::BinaryDescriptorMatcherTraitConst, as_raw_BinaryDescriptorMatcher, crate::line_descriptor::BinaryDescriptorMatcherTrait, as_raw_mut_BinaryDescriptorMatcher }

	/// A class to represent a line
	///
	/// As aformentioned, it is been necessary to design a class that fully stores the information needed to
	/// characterize completely a line and plot it on image it was extracted from, when required.
	///
	/// *KeyLine* class has been created for such goal; it is mainly inspired to Feature2d's KeyPoint class,
	/// since KeyLine shares some of *KeyPoint*'s fields, even if a part of them assumes a different
	/// meaning, when speaking about lines. In particular:
	///
	/// *   the *class_id* field is used to gather lines extracted from different octaves which refer to
	///    same line inside original image (such lines and the one they represent in original image share
	///    the same *class_id* value)
	/// *   the *angle* field represents line's slope with respect to (positive) X axis
	/// *   the *pt* field represents line's midpoint
	/// *   the *response* field is computed as the ratio between the line's length and maximum between
	///    image's width and height
	/// *   the *size* field is the area of the smallest rectangle containing line
	///
	/// Apart from fields inspired to KeyPoint class, KeyLines stores information about extremes of line in
	/// original image and in octave it was extracted from, about line's length and number of pixels it
	/// covers.
	#[repr(C)]
	#[derive(Copy, Clone, Debug, PartialEq)]
	pub struct KeyLine {
		/// orientation of the line
		pub angle: f32,
		/// object ID, that can be used to cluster keylines by the line they represent
		pub class_id: i32,
		/// octave (pyramid layer), from which the keyline has been extracted
		pub octave: i32,
		/// coordinates of the middlepoint
		pub pt: core::Point2f,
		/// the response, by which the strongest keylines have been selected.
		/// It's represented by the ratio between line's length and maximum between
		/// image's width and height
		pub response: f32,
		/// minimum area containing line
		pub size: f32,
		/// lines's extremes in original image
		pub start_point_x: f32,
		pub start_point_y: f32,
		pub end_point_x: f32,
		pub end_point_y: f32,
		/// line's extremes in image it was extracted from
		pub s_point_in_octave_x: f32,
		pub s_point_in_octave_y: f32,
		pub e_point_in_octave_x: f32,
		pub e_point_in_octave_y: f32,
		/// the length of line
		pub line_length: f32,
		/// number of pixels covered by the line
		pub num_of_pixels: i32,
	}

	opencv_type_simple! { crate::line_descriptor::KeyLine }

	impl KeyLine {
		/// Returns the start point of the line in the original image
		#[inline]
		pub fn get_start_point(self) -> Result<core::Point2f> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_KeyLine_getStartPoint_const(&self, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// Returns the end point of the line in the original image
		#[inline]
		pub fn get_end_point(self) -> Result<core::Point2f> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_KeyLine_getEndPoint_const(&self, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// Returns the start point of the line in the octave it was extracted from
		#[inline]
		pub fn get_start_point_in_octave(self) -> Result<core::Point2f> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_KeyLine_getStartPointInOctave_const(&self, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// Returns the end point of the line in the octave it was extracted from
		#[inline]
		pub fn get_end_point_in_octave(self) -> Result<core::Point2f> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_KeyLine_getEndPointInOctave_const(&self, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// constructor
		#[inline]
		pub fn default() -> Result<crate::line_descriptor::KeyLine> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_KeyLine_KeyLine(ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

	}

	pub struct LSDDetector {
		ptr: *mut c_void,
	}

	opencv_type_boxed! { LSDDetector }

	impl Drop for LSDDetector {
		#[inline]
		fn drop(&mut self) {
			unsafe { sys::cv_line_descriptor_LSDDetector_delete(self.as_raw_mut_LSDDetector()) };
		}
	}

	unsafe impl Send for LSDDetector {}

	impl LSDDetector {
		#[inline]
		pub fn default() -> Result<crate::line_descriptor::LSDDetector> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_LSDDetector_LSDDetector(ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			let ret = unsafe { crate::line_descriptor::LSDDetector::opencv_from_extern(ret) };
			Ok(ret)
		}

		#[inline]
		pub fn new(_params: crate::line_descriptor::LSDParam) -> Result<crate::line_descriptor::LSDDetector> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_LSDDetector_LSDDetector_LSDParam(&_params, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			let ret = unsafe { crate::line_descriptor::LSDDetector::opencv_from_extern(ret) };
			Ok(ret)
		}

		/// Creates ad LSDDetector object, using smart pointers.
		#[inline]
		pub fn create_lsd_detector() -> Result<core::Ptr<crate::line_descriptor::LSDDetector>> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_LSDDetector_createLSDDetector(ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			let ret = unsafe { core::Ptr::<crate::line_descriptor::LSDDetector>::opencv_from_extern(ret) };
			Ok(ret)
		}

		#[inline]
		pub fn create_lsd_detector_with_params(params: crate::line_descriptor::LSDParam) -> Result<core::Ptr<crate::line_descriptor::LSDDetector>> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_LSDDetector_createLSDDetector_LSDParam(&params, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			let ret = unsafe { core::Ptr::<crate::line_descriptor::LSDDetector>::opencv_from_extern(ret) };
			Ok(ret)
		}

	}

	/// Constant methods for [crate::line_descriptor::LSDDetector]
	pub trait LSDDetectorTraitConst: core::AlgorithmTraitConst {
		fn as_raw_LSDDetector(&self) -> *const c_void;

		/// Detect lines inside an image.
		///
		/// ## Parameters
		/// * image: input image
		/// * keypoints: vector that will store extracted lines for one or more images
		/// * scale: scale factor used in pyramids generation
		/// * numOctaves: number of octaves inside pyramid
		/// * mask: mask matrix to detect only KeyLines of interest
		///
		/// ## Overloaded parameters
		///
		/// * images: input images
		/// * keylines: set of vectors that will store extracted lines for one or more images
		/// * scale: scale factor used in pyramids generation
		/// * numOctaves: number of octaves inside pyramid
		/// * masks: vector of mask matrices to detect only KeyLines of interest from each input image
		///
		/// ## C++ default parameters
		/// * masks: std::vector<Mat>()
		#[inline]
		fn detect_multiple(&self, images: &core::Vector<core::Mat>, keylines: &mut core::Vector<core::Vector<crate::line_descriptor::KeyLine>>, scale: i32, num_octaves: i32, masks: &core::Vector<core::Mat>) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_LSDDetector_detect_const_const_vectorLMatGR_vectorLvectorLKeyLineGGR_int_int_const_vectorLMatGR(self.as_raw_LSDDetector(), images.as_raw_VectorOfMat(), keylines.as_raw_mut_VectorOfVectorOfKeyLine(), scale, num_octaves, masks.as_raw_VectorOfMat(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// @overload
		/// ## Parameters
		/// * images: input images
		/// * keylines: set of vectors that will store extracted lines for one or more images
		/// * scale: scale factor used in pyramids generation
		/// * numOctaves: number of octaves inside pyramid
		/// * masks: vector of mask matrices to detect only KeyLines of interest from each input image
		///
		/// ## Note
		/// This alternative version of [LSDDetectorTraitConst::detect_multiple] function uses the following default values for its arguments:
		/// * masks: std::vector<Mat>()
		#[inline]
		fn detect_multiple_def(&self, images: &core::Vector<core::Mat>, keylines: &mut core::Vector<core::Vector<crate::line_descriptor::KeyLine>>, scale: i32, num_octaves: i32) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_LSDDetector_detect_const_const_vectorLMatGR_vectorLvectorLKeyLineGGR_int_int(self.as_raw_LSDDetector(), images.as_raw_VectorOfMat(), keylines.as_raw_mut_VectorOfVectorOfKeyLine(), scale, num_octaves, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

	}

	/// Mutable methods for [crate::line_descriptor::LSDDetector]
	pub trait LSDDetectorTrait: core::AlgorithmTrait + crate::line_descriptor::LSDDetectorTraitConst {
		fn as_raw_mut_LSDDetector(&mut self) -> *mut c_void;

		/// Detect lines inside an image.
		///
		/// ## Parameters
		/// * image: input image
		/// * keypoints: vector that will store extracted lines for one or more images
		/// * scale: scale factor used in pyramids generation
		/// * numOctaves: number of octaves inside pyramid
		/// * mask: mask matrix to detect only KeyLines of interest
		///
		/// ## C++ default parameters
		/// * mask: Mat()
		#[inline]
		fn detect(&mut self, image: &impl core::MatTraitConst, keypoints: &mut core::Vector<crate::line_descriptor::KeyLine>, scale: i32, num_octaves: i32, mask: &impl core::MatTraitConst) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_LSDDetector_detect_const_MatR_vectorLKeyLineGR_int_int_const_MatR(self.as_raw_mut_LSDDetector(), image.as_raw_Mat(), keypoints.as_raw_mut_VectorOfKeyLine(), scale, num_octaves, mask.as_raw_Mat(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// Detect lines inside an image.
		///
		/// ## Parameters
		/// * image: input image
		/// * keypoints: vector that will store extracted lines for one or more images
		/// * scale: scale factor used in pyramids generation
		/// * numOctaves: number of octaves inside pyramid
		/// * mask: mask matrix to detect only KeyLines of interest
		///
		/// ## Note
		/// This alternative version of [LSDDetectorTrait::detect] function uses the following default values for its arguments:
		/// * mask: Mat()
		#[inline]
		fn detect_def(&mut self, image: &impl core::MatTraitConst, keypoints: &mut core::Vector<crate::line_descriptor::KeyLine>, scale: i32, num_octaves: i32) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_LSDDetector_detect_const_MatR_vectorLKeyLineGR_int_int(self.as_raw_mut_LSDDetector(), image.as_raw_Mat(), keypoints.as_raw_mut_VectorOfKeyLine(), scale, num_octaves, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

	}

	impl std::fmt::Debug for LSDDetector {
		#[inline]
		fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
			f.debug_struct("LSDDetector")
				.finish()
		}
	}

	boxed_cast_base! { LSDDetector, core::Algorithm, cv_line_descriptor_LSDDetector_to_Algorithm }

	impl core::AlgorithmTraitConst for LSDDetector {
		#[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() }
	}

	impl core::AlgorithmTrait for LSDDetector {
		#[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() }
	}

	boxed_ref! { LSDDetector, core::AlgorithmTraitConst, as_raw_Algorithm, core::AlgorithmTrait, as_raw_mut_Algorithm }

	impl crate::line_descriptor::LSDDetectorTraitConst for LSDDetector {
		#[inline] fn as_raw_LSDDetector(&self) -> *const c_void { self.as_raw() }
	}

	impl crate::line_descriptor::LSDDetectorTrait for LSDDetector {
		#[inline] fn as_raw_mut_LSDDetector(&mut self) -> *mut c_void { self.as_raw_mut() }
	}

	boxed_ref! { LSDDetector, crate::line_descriptor::LSDDetectorTraitConst, as_raw_LSDDetector, crate::line_descriptor::LSDDetectorTrait, as_raw_mut_LSDDetector }

	/// Lines extraction methodology
	/// ----------------------------
	///
	/// The lines extraction methodology described in the following is mainly based on [EDL](https://docs.opencv.org/4.11.0/d0/de3/citelist.html#CITEREF_EDL) . The
	/// extraction starts with a Gaussian pyramid generated from an original image, downsampled N-1 times,
	/// blurred N times, to obtain N layers (one for each octave), with layer 0 corresponding to input
	/// image. Then, from each layer (octave) in the pyramid, lines are extracted using LSD algorithm.
	///
	/// Differently from EDLine lines extractor used in original article, LSD furnishes information only
	/// about lines extremes; thus, additional information regarding slope and equation of line are computed
	/// via analytic methods. The number of pixels is obtained using *LineIterator*. Extracted lines are
	/// returned in the form of KeyLine objects, but since extraction is based on a method different from
	/// the one used in *BinaryDescriptor* class, data associated to a line's extremes in original image and
	/// in octave it was extracted from, coincide. KeyLine's field *class_id* is used as an index to
	/// indicate the order of extraction of a line inside a single octave.
	#[repr(C)]
	#[derive(Copy, Clone, Debug, PartialEq)]
	pub struct LSDParam {
		pub scale: f64,
		pub sigma_scale: f64,
		pub quant: f64,
		pub ang_th: f64,
		pub log_eps: f64,
		pub density_th: f64,
		pub n_bins: i32,
	}

	opencv_type_simple! { crate::line_descriptor::LSDParam }

	impl LSDParam {
		#[inline]
		pub fn default() -> Result<crate::line_descriptor::LSDParam> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_line_descriptor_LSDParam_LSDParam(ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

	}

}