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
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271

use libc::{ c_void, c_char, size_t };
use std::ffi::{ CStr, CString };
pub const ADAPTIVE_THRESH_GAUSSIAN_C:i32 = 1;
pub const ADAPTIVE_THRESH_MEAN_C:i32 = 0;
pub const BORDER_ISOLATED:i32 = 16;
pub const COLOR_BGR2BGR555:i32 = 22;
pub const COLOR_BGR2BGR565:i32 = 12;
pub const COLOR_BGR2BGRA:i32 = 0;
pub const COLOR_BGR2GRAY:i32 = 6;
pub const COLOR_BGR2HLS:i32 = 52;
pub const COLOR_BGR2HLS_FULL:i32 = 68;
pub const COLOR_BGR2HSV:i32 = 40;
pub const COLOR_BGR2HSV_FULL:i32 = 66;
pub const COLOR_BGR2Lab:i32 = 44;
pub const COLOR_BGR2Luv:i32 = 50;
pub const COLOR_BGR2RGB:i32 = 4;
pub const COLOR_BGR2RGBA:i32 = 2;
pub const COLOR_BGR2XYZ:i32 = 32;
pub const COLOR_BGR2YCrCb:i32 = 36;
pub const COLOR_BGR2YUV:i32 = 82;
pub const COLOR_BGR2YUV_I420:i32 = 128;
pub const COLOR_BGR2YUV_YV12:i32 = 132;
pub const COLOR_BGR5552BGR:i32 = 24;
pub const COLOR_BGR5552BGRA:i32 = 28;
pub const COLOR_BGR5552GRAY:i32 = 31;
pub const COLOR_BGR5552RGB:i32 = 25;
pub const COLOR_BGR5552RGBA:i32 = 29;
pub const COLOR_BGR5652BGR:i32 = 14;
pub const COLOR_BGR5652BGRA:i32 = 18;
pub const COLOR_BGR5652GRAY:i32 = 21;
pub const COLOR_BGR5652RGB:i32 = 15;
pub const COLOR_BGR5652RGBA:i32 = 19;
pub const COLOR_BGRA2BGR:i32 = 1;
pub const COLOR_BGRA2BGR555:i32 = 26;
pub const COLOR_BGRA2BGR565:i32 = 16;
pub const COLOR_BGRA2GRAY:i32 = 10;
pub const COLOR_BGRA2RGBA:i32 = 5;
pub const COLOR_BGRA2YUV_I420:i32 = 130;
pub const COLOR_BGRA2YUV_YV12:i32 = 134;
pub const COLOR_BayerBG2BGR:i32 = 46;
pub const COLOR_BayerBG2BGR_VNG:i32 = 62;
pub const COLOR_BayerBG2GRAY:i32 = 86;
pub const COLOR_BayerGB2BGR:i32 = 47;
pub const COLOR_BayerGB2BGR_VNG:i32 = 63;
pub const COLOR_BayerGB2GRAY:i32 = 87;
pub const COLOR_BayerGR2BGR:i32 = 49;
pub const COLOR_BayerGR2BGR_VNG:i32 = 65;
pub const COLOR_BayerGR2GRAY:i32 = 89;
pub const COLOR_BayerRG2BGR:i32 = 48;
pub const COLOR_BayerRG2BGR_VNG:i32 = 64;
pub const COLOR_BayerRG2GRAY:i32 = 88;
pub const COLOR_COLORCVT_MAX:i32 = 135;
pub const COLOR_GRAY2BGR:i32 = 8;
pub const COLOR_GRAY2BGR555:i32 = 30;
pub const COLOR_GRAY2BGR565:i32 = 20;
pub const COLOR_GRAY2BGRA:i32 = 9;
pub const COLOR_HLS2BGR:i32 = 60;
pub const COLOR_HLS2BGR_FULL:i32 = 72;
pub const COLOR_HLS2RGB:i32 = 61;
pub const COLOR_HLS2RGB_FULL:i32 = 73;
pub const COLOR_HSV2BGR:i32 = 54;
pub const COLOR_HSV2BGR_FULL:i32 = 70;
pub const COLOR_HSV2RGB:i32 = 55;
pub const COLOR_HSV2RGB_FULL:i32 = 71;
pub const COLOR_LBGR2Lab:i32 = 74;
pub const COLOR_LBGR2Luv:i32 = 76;
pub const COLOR_LRGB2Lab:i32 = 75;
pub const COLOR_LRGB2Luv:i32 = 77;
pub const COLOR_Lab2BGR:i32 = 56;
pub const COLOR_Lab2LBGR:i32 = 78;
pub const COLOR_Lab2LRGB:i32 = 79;
pub const COLOR_Lab2RGB:i32 = 57;
pub const COLOR_Luv2BGR:i32 = 58;
pub const COLOR_Luv2LBGR:i32 = 80;
pub const COLOR_Luv2LRGB:i32 = 81;
pub const COLOR_Luv2RGB:i32 = 59;
pub const COLOR_RGB2BGR555:i32 = 23;
pub const COLOR_RGB2BGR565:i32 = 13;
pub const COLOR_RGB2GRAY:i32 = 7;
pub const COLOR_RGB2HLS:i32 = 53;
pub const COLOR_RGB2HLS_FULL:i32 = 69;
pub const COLOR_RGB2HSV:i32 = 41;
pub const COLOR_RGB2HSV_FULL:i32 = 67;
pub const COLOR_RGB2Lab:i32 = 45;
pub const COLOR_RGB2Luv:i32 = 51;
pub const COLOR_RGB2XYZ:i32 = 33;
pub const COLOR_RGB2YCrCb:i32 = 37;
pub const COLOR_RGB2YUV:i32 = 83;
pub const COLOR_RGB2YUV_I420:i32 = 127;
pub const COLOR_RGB2YUV_YV12:i32 = 131;
pub const COLOR_RGBA2BGR:i32 = 3;
pub const COLOR_RGBA2BGR555:i32 = 27;
pub const COLOR_RGBA2BGR565:i32 = 17;
pub const COLOR_RGBA2GRAY:i32 = 11;
pub const COLOR_RGBA2YUV_I420:i32 = 129;
pub const COLOR_RGBA2YUV_YV12:i32 = 133;
pub const COLOR_RGBA2mRGBA:i32 = 125;
pub const COLOR_XYZ2BGR:i32 = 34;
pub const COLOR_XYZ2RGB:i32 = 35;
pub const COLOR_YCrCb2BGR:i32 = 38;
pub const COLOR_YCrCb2RGB:i32 = 39;
pub const COLOR_YUV2BGR:i32 = 84;
pub const COLOR_YUV2BGRA_IYUV:i32 = 105;
pub const COLOR_YUV2BGRA_NV12:i32 = 95;
pub const COLOR_YUV2BGRA_NV21:i32 = 97;
pub const COLOR_YUV2BGRA_UYVY:i32 = 112;
pub const COLOR_YUV2BGRA_YUY2:i32 = 120;
pub const COLOR_YUV2BGRA_YV12:i32 = 103;
pub const COLOR_YUV2BGRA_YVYU:i32 = 122;
pub const COLOR_YUV2BGR_IYUV:i32 = 101;
pub const COLOR_YUV2BGR_NV12:i32 = 91;
pub const COLOR_YUV2BGR_NV21:i32 = 93;
pub const COLOR_YUV2BGR_UYVY:i32 = 108;
pub const COLOR_YUV2BGR_YUY2:i32 = 116;
pub const COLOR_YUV2BGR_YV12:i32 = 99;
pub const COLOR_YUV2BGR_YVYU:i32 = 118;
pub const COLOR_YUV2GRAY_420:i32 = 106;
pub const COLOR_YUV2GRAY_UYVY:i32 = 123;
pub const COLOR_YUV2GRAY_YUY2:i32 = 124;
pub const COLOR_YUV2RGB:i32 = 85;
pub const COLOR_YUV2RGBA_IYUV:i32 = 104;
pub const COLOR_YUV2RGBA_NV12:i32 = 94;
pub const COLOR_YUV2RGBA_NV21:i32 = 96;
pub const COLOR_YUV2RGBA_UYVY:i32 = 111;
pub const COLOR_YUV2RGBA_YUY2:i32 = 119;
pub const COLOR_YUV2RGBA_YV12:i32 = 102;
pub const COLOR_YUV2RGBA_YVYU:i32 = 121;
pub const COLOR_YUV2RGB_IYUV:i32 = 100;
pub const COLOR_YUV2RGB_NV12:i32 = 90;
pub const COLOR_YUV2RGB_NV21:i32 = 92;
pub const COLOR_YUV2RGB_UYVY:i32 = 107;
pub const COLOR_YUV2RGB_YUY2:i32 = 115;
pub const COLOR_YUV2RGB_YV12:i32 = 98;
pub const COLOR_YUV2RGB_YVYU:i32 = 117;
pub const COLOR_mRGBA2RGBA:i32 = 126;
pub const CV_ADAPTIVE_THRESH_GAUSSIAN_C:i32 = 1;
pub const CV_ADAPTIVE_THRESH_MEAN_C:i32 = 0;
pub const CV_BGR2BGR555:i32 = 22;
pub const CV_BGR2BGR565:i32 = 12;
pub const CV_BGR2BGRA:i32 = 0;
pub const CV_BGR2GRAY:i32 = 6;
pub const CV_BGR2HLS:i32 = 52;
pub const CV_BGR2HLS_FULL:i32 = 68;
pub const CV_BGR2HSV:i32 = 40;
pub const CV_BGR2HSV_FULL:i32 = 66;
pub const CV_BGR2Lab:i32 = 44;
pub const CV_BGR2Luv:i32 = 50;
pub const CV_BGR2RGB:i32 = 4;
pub const CV_BGR2RGBA:i32 = 2;
pub const CV_BGR2XYZ:i32 = 32;
pub const CV_BGR2YCrCb:i32 = 36;
pub const CV_BGR2YUV:i32 = 82;
pub const CV_BGR2YUV_I420:i32 = 128;
pub const CV_BGR2YUV_YV12:i32 = 132;
pub const CV_BGR5552BGR:i32 = 24;
pub const CV_BGR5552BGRA:i32 = 28;
pub const CV_BGR5552GRAY:i32 = 31;
pub const CV_BGR5552RGB:i32 = 25;
pub const CV_BGR5552RGBA:i32 = 29;
pub const CV_BGR5652BGR:i32 = 14;
pub const CV_BGR5652BGRA:i32 = 18;
pub const CV_BGR5652GRAY:i32 = 21;
pub const CV_BGR5652RGB:i32 = 15;
pub const CV_BGR5652RGBA:i32 = 19;
pub const CV_BGRA2BGR:i32 = 1;
pub const CV_BGRA2BGR555:i32 = 26;
pub const CV_BGRA2BGR565:i32 = 16;
pub const CV_BGRA2GRAY:i32 = 10;
pub const CV_BGRA2RGBA:i32 = 5;
pub const CV_BGRA2YUV_I420:i32 = 130;
pub const CV_BGRA2YUV_YV12:i32 = 134;
pub const CV_BILATERAL:i32 = 4;
pub const CV_BLUR:i32 = 1;
pub const CV_BLUR_NO_SCALE:i32 = 0;
pub const CV_BayerBG2BGR:i32 = 46;
pub const CV_BayerBG2BGR_VNG:i32 = 62;
pub const CV_BayerBG2GRAY:i32 = 86;
pub const CV_BayerGB2BGR:i32 = 47;
pub const CV_BayerGB2BGR_VNG:i32 = 63;
pub const CV_BayerGB2GRAY:i32 = 87;
pub const CV_BayerGR2BGR:i32 = 49;
pub const CV_BayerGR2BGR_VNG:i32 = 65;
pub const CV_BayerGR2GRAY:i32 = 89;
pub const CV_BayerRG2BGR:i32 = 48;
pub const CV_BayerRG2BGR_VNG:i32 = 64;
pub const CV_BayerRG2GRAY:i32 = 88;
pub const CV_CHAIN_APPROX_NONE:i32 = 1;
pub const CV_CHAIN_APPROX_SIMPLE:i32 = 2;
pub const CV_CHAIN_APPROX_TC89_KCOS:i32 = 4;
pub const CV_CHAIN_APPROX_TC89_L1:i32 = 3;
pub const CV_CHAIN_CODE:i32 = 0;
pub const CV_CLOCKWISE:i32 = 1;
pub const CV_COLORCVT_MAX:i32 = 135;
pub const CV_COMP_BHATTACHARYYA:i32 = 3;
pub const CV_COMP_CHISQR:i32 = 1;
pub const CV_COMP_CORREL:i32 = 0;
pub const CV_COMP_INTERSECT:i32 = 2;
pub const CV_CONTOURS_MATCH_I1:i32 = 1;
pub const CV_CONTOURS_MATCH_I2:i32 = 2;
pub const CV_CONTOURS_MATCH_I3:i32 = 3;
pub const CV_COUNTER_CLOCKWISE:i32 = 2;
pub const CV_DIST_C:i32 = 3;
pub const CV_DIST_FAIR:i32 = 5;
pub const CV_DIST_HUBER:i32 = 7;
pub const CV_DIST_L1:i32 = 1;
pub const CV_DIST_L12:i32 = 4;
pub const CV_DIST_L2:i32 = 2;
pub const CV_DIST_LABEL_CCOMP:i32 = 0;
pub const CV_DIST_LABEL_PIXEL:i32 = 1;
pub const CV_DIST_MASK_3:i32 = 3;
pub const CV_DIST_MASK_5:i32 = 5;
pub const CV_DIST_MASK_PRECISE:i32 = 0;
pub const CV_DIST_USER:i32 = -1;
pub const CV_DIST_WELSCH:i32 = 6;
pub const CV_GAUSSIAN:i32 = 2;
pub const CV_GAUSSIAN_5x5:i32 = 7;
pub const CV_GRAY2BGR:i32 = 8;
pub const CV_GRAY2BGR555:i32 = 30;
pub const CV_GRAY2BGR565:i32 = 20;
pub const CV_GRAY2BGRA:i32 = 9;
pub const CV_HLS2BGR:i32 = 60;
pub const CV_HLS2BGR_FULL:i32 = 72;
pub const CV_HLS2RGB:i32 = 61;
pub const CV_HLS2RGB_FULL:i32 = 73;
pub const CV_HOUGH_GRADIENT:i32 = 3;
pub const CV_HOUGH_MULTI_SCALE:i32 = 2;
pub const CV_HOUGH_PROBABILISTIC:i32 = 1;
pub const CV_HOUGH_STANDARD:i32 = 0;
pub const CV_HSV2BGR:i32 = 54;
pub const CV_HSV2BGR_FULL:i32 = 70;
pub const CV_HSV2RGB:i32 = 55;
pub const CV_HSV2RGB_FULL:i32 = 71;
pub const CV_INTER_AREA:i32 = 3;
pub const CV_INTER_CUBIC:i32 = 2;
pub const CV_INTER_LANCZOS4:i32 = 4;
pub const CV_INTER_LINEAR:i32 = 1;
pub const CV_INTER_NN:i32 = 0;
pub const CV_LBGR2Lab:i32 = 74;
pub const CV_LBGR2Luv:i32 = 76;
pub const CV_LINK_RUNS:i32 = 5;
pub const CV_LRGB2Lab:i32 = 75;
pub const CV_LRGB2Luv:i32 = 77;
pub const CV_Lab2BGR:i32 = 56;
pub const CV_Lab2LBGR:i32 = 78;
pub const CV_Lab2LRGB:i32 = 79;
pub const CV_Lab2RGB:i32 = 57;
pub const CV_Luv2BGR:i32 = 58;
pub const CV_Luv2LBGR:i32 = 80;
pub const CV_Luv2LRGB:i32 = 81;
pub const CV_Luv2RGB:i32 = 59;
pub const CV_MAX_SOBEL_KSIZE:i32 = 7;
pub const CV_MEDIAN:i32 = 3;
pub const CV_MOP_BLACKHAT:i32 = 6;
pub const CV_MOP_CLOSE:i32 = 3;
pub const CV_MOP_DILATE:i32 = 1;
pub const CV_MOP_ERODE:i32 = 0;
pub const CV_MOP_GRADIENT:i32 = 4;
pub const CV_MOP_OPEN:i32 = 2;
pub const CV_MOP_TOPHAT:i32 = 5;
pub const CV_POLY_APPROX_DP:i32 = 0;
pub const CV_RETR_CCOMP:i32 = 2;
pub const CV_RETR_EXTERNAL:i32 = 0;
pub const CV_RETR_FLOODFILL:i32 = 4;
pub const CV_RETR_LIST:i32 = 1;
pub const CV_RETR_TREE:i32 = 3;
pub const CV_RGB2BGR555:i32 = 23;
pub const CV_RGB2BGR565:i32 = 13;
pub const CV_RGB2GRAY:i32 = 7;
pub const CV_RGB2HLS:i32 = 53;
pub const CV_RGB2HLS_FULL:i32 = 69;
pub const CV_RGB2HSV:i32 = 41;
pub const CV_RGB2HSV_FULL:i32 = 67;
pub const CV_RGB2Lab:i32 = 45;
pub const CV_RGB2Luv:i32 = 51;
pub const CV_RGB2XYZ:i32 = 33;
pub const CV_RGB2YCrCb:i32 = 37;
pub const CV_RGB2YUV:i32 = 83;
pub const CV_RGB2YUV_I420:i32 = 127;
pub const CV_RGB2YUV_YV12:i32 = 131;
pub const CV_RGBA2BGR:i32 = 3;
pub const CV_RGBA2BGR555:i32 = 27;
pub const CV_RGBA2BGR565:i32 = 17;
pub const CV_RGBA2GRAY:i32 = 11;
pub const CV_RGBA2YUV_I420:i32 = 129;
pub const CV_RGBA2YUV_YV12:i32 = 133;
pub const CV_RGBA2mRGBA:i32 = 125;
pub const CV_SCHARR:i32 = -1;
pub const CV_SHAPE_CROSS:i32 = 1;
pub const CV_SHAPE_CUSTOM:i32 = 100;
pub const CV_SHAPE_ELLIPSE:i32 = 2;
pub const CV_SHAPE_RECT:i32 = 0;
pub const CV_THRESH_BINARY:i32 = 0;
pub const CV_THRESH_BINARY_INV:i32 = 1;
pub const CV_THRESH_MASK:i32 = 7;
pub const CV_THRESH_OTSU:i32 = 8;
pub const CV_THRESH_TOZERO:i32 = 3;
pub const CV_THRESH_TOZERO_INV:i32 = 4;
pub const CV_THRESH_TRUNC:i32 = 2;
pub const CV_TM_CCOEFF:i32 = 4;
pub const CV_TM_CCOEFF_NORMED:i32 = 5;
pub const CV_TM_CCORR:i32 = 2;
pub const CV_TM_CCORR_NORMED:i32 = 3;
pub const CV_TM_SQDIFF:i32 = 0;
pub const CV_TM_SQDIFF_NORMED:i32 = 1;
pub const CV_WARP_FILL_OUTLIERS:i32 = 8;
pub const CV_WARP_INVERSE_MAP:i32 = 16;
pub const CV_XYZ2BGR:i32 = 34;
pub const CV_XYZ2RGB:i32 = 35;
pub const CV_YCrCb2BGR:i32 = 38;
pub const CV_YCrCb2RGB:i32 = 39;
pub const CV_YUV2BGR:i32 = 84;
pub const CV_YUV2BGRA_IYUV:i32 = 105;
pub const CV_YUV2BGRA_NV12:i32 = 95;
pub const CV_YUV2BGRA_NV21:i32 = 97;
pub const CV_YUV2BGRA_UYVY:i32 = 112;
pub const CV_YUV2BGRA_YUY2:i32 = 120;
pub const CV_YUV2BGRA_YV12:i32 = 103;
pub const CV_YUV2BGRA_YVYU:i32 = 122;
pub const CV_YUV2BGR_IYUV:i32 = 101;
pub const CV_YUV2BGR_NV12:i32 = 91;
pub const CV_YUV2BGR_NV21:i32 = 93;
pub const CV_YUV2BGR_UYVY:i32 = 108;
pub const CV_YUV2BGR_YUY2:i32 = 116;
pub const CV_YUV2BGR_YV12:i32 = 99;
pub const CV_YUV2BGR_YVYU:i32 = 118;
pub const CV_YUV2GRAY_420:i32 = 106;
pub const CV_YUV2GRAY_UYVY:i32 = 123;
pub const CV_YUV2GRAY_YUY2:i32 = 124;
pub const CV_YUV2RGB:i32 = 85;
pub const CV_YUV2RGBA_IYUV:i32 = 104;
pub const CV_YUV2RGBA_NV12:i32 = 94;
pub const CV_YUV2RGBA_NV21:i32 = 96;
pub const CV_YUV2RGBA_UYVY:i32 = 111;
pub const CV_YUV2RGBA_YUY2:i32 = 119;
pub const CV_YUV2RGBA_YV12:i32 = 102;
pub const CV_YUV2RGBA_YVYU:i32 = 121;
pub const CV_YUV2RGB_IYUV:i32 = 100;
pub const CV_YUV2RGB_NV12:i32 = 90;
pub const CV_YUV2RGB_NV21:i32 = 92;
pub const CV_YUV2RGB_UYVY:i32 = 107;
pub const CV_YUV2RGB_YUY2:i32 = 115;
pub const CV_YUV2RGB_YV12:i32 = 98;
pub const CV_YUV2RGB_YVYU:i32 = 117;
pub const CV_mRGBA2RGBA:i32 = 126;
pub const DIST_LABEL_CCOMP:i32 = 0;
pub const DIST_LABEL_PIXEL:i32 = 1;
pub const GC_BGD:i32 = 0;
pub const GC_EVAL:i32 = 2;
pub const GC_FGD:i32 = 1;
pub const GC_INIT_WITH_MASK:i32 = 1;
pub const GC_INIT_WITH_RECT:i32 = 0;
pub const GC_PR_BGD:i32 = 2;
pub const GC_PR_FGD:i32 = 3;
pub const GHT_POSITION:i32 = 0;
pub const GHT_ROTATION:i32 = 2;
pub const GHT_SCALE:i32 = 1;
pub const INTER_BITS:i32 = 5;
pub const INTER_MAX:i32 = 7;
pub const KERNEL_ASYMMETRICAL:i32 = 2;
pub const KERNEL_GENERAL:i32 = 0;
pub const KERNEL_INTEGER:i32 = 8;
pub const KERNEL_SMOOTH:i32 = 4;
pub const KERNEL_SYMMETRICAL:i32 = 1;
pub const MORPH_CROSS:i32 = 1;
pub const MORPH_ELLIPSE:i32 = 2;
pub const MORPH_RECT:i32 = 0;
pub const PROJ_SPHERICAL_EQRECT:i32 = 1;
pub const PROJ_SPHERICAL_ORTHO:i32 = 0;
pub const Subdiv2D_NEXT_AROUND_DST:i32 = 0x22;
pub const Subdiv2D_NEXT_AROUND_LEFT:i32 = 0x13;
pub const Subdiv2D_NEXT_AROUND_ORG:i32 = 0x00;
pub const Subdiv2D_NEXT_AROUND_RIGHT:i32 = 0x31;
pub const Subdiv2D_PREV_AROUND_DST:i32 = 0x33;
pub const Subdiv2D_PREV_AROUND_LEFT:i32 = 0x20;
pub const Subdiv2D_PREV_AROUND_ORG:i32 = 0x11;
pub const Subdiv2D_PREV_AROUND_RIGHT:i32 = 0x02;
pub const Subdiv2D_PTLOC_ERROR:i32 = -2;
pub const Subdiv2D_PTLOC_INSIDE:i32 = 0;
pub const Subdiv2D_PTLOC_ON_EDGE:i32 = 2;
pub const Subdiv2D_PTLOC_OUTSIDE_RECT:i32 = -1;
pub const Subdiv2D_PTLOC_VERTEX:i32 = 1;
pub const TM_CCOEFF:i32 = 4;
pub const TM_CCOEFF_NORMED:i32 = 5;
pub const TM_CCORR:i32 = 2;
pub const TM_CCORR_NORMED:i32 = 3;
pub const TM_SQDIFF:i32 = 0;
pub const TM_SQDIFF_NORMED:i32 = 1;

include!(concat!(env!("OUT_DIR"), "/imgproc.consts.rs"));

/// raster image moments
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Moments {
    pub m00: f64,
    pub m10: f64,
    pub m01: f64,
    pub m20: f64,
    pub m11: f64,
    pub m02: f64,
    pub m30: f64,
    pub m21: f64,
    pub m12: f64,
    pub m03: f64,
    pub mu20: f64,
    pub mu11: f64,
    pub mu02: f64,
    pub mu30: f64,
    pub mu21: f64,
    pub mu12: f64,
    pub mu03: f64,
    pub nu20: f64,
    pub nu11: f64,
    pub nu02: f64,
    pub nu30: f64,
    pub nu21: f64,
    pub nu12: f64,
    pub nu03: f64,
}

// identifier: cv_Canny_InputArray_image_OutputArray_edges_double_threshold1_double_threshold2_int_apertureSize_bool_L2gradient
/// applies Canny edge detector and produces the edge map.
///
/// default value for arguments:
///   - apertureSize: default 3
///   - L2gradient: default false
pub fn canny(image:& ::core::Mat, edges:& ::core::Mat, threshold1: f64, threshold2: f64, apertureSize: i32, L2gradient: bool) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_Canny_InputArray_image_OutputArray_edges_double_threshold1_double_threshold2_int_apertureSize_bool_L2gradient(image.as_raw_Mat(), edges.as_raw_Mat(), threshold1, threshold2, apertureSize, L2gradient);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_GaussianBlur_InputArray_src_OutputArray_dst_Size_ksize_double_sigmaX_double_sigmaY_int_borderType
/// smooths the image using Gaussian filter.
///
/// default value for arguments:
///   - sigmaY: default 0
///   - borderType: default BORDER_DEFAULT
pub fn gaussian_blur(src:& ::core::Mat, dst:& ::core::Mat, ksize: ::core::Size, sigmaX: f64, sigmaY: f64, borderType: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_GaussianBlur_InputArray_src_OutputArray_dst_Size_ksize_double_sigmaX_double_sigmaY_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), ksize, sigmaX, sigmaY, borderType);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_HoughCircles_InputArray_image_OutputArray_circles_int_method_double_dp_double_minDist_double_param1_double_param2_int_minRadius_int_maxRadius
/// finds circles in the grayscale image using 2+1 gradient Hough transform
///
/// default value for arguments:
///   - param1: default 100
///   - param2: default 100
///   - minRadius: default 0
///   - maxRadius: default 0
pub fn hough_circles(image:& ::core::Mat, circles:& ::core::Mat, method: i32, dp: f64, minDist: f64, param1: f64, param2: f64, minRadius: i32, maxRadius: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_HoughCircles_InputArray_image_OutputArray_circles_int_method_double_dp_double_minDist_double_param1_double_param2_int_minRadius_int_maxRadius(image.as_raw_Mat(), circles.as_raw_Mat(), method, dp, minDist, param1, param2, minRadius, maxRadius);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_HoughLinesP_InputArray_image_OutputArray_lines_double_rho_double_theta_int_threshold_double_minLineLength_double_maxLineGap
/// finds line segments in the black-n-white image using probabilistic Hough transform
///
/// default value for arguments:
///   - minLineLength: default 0
///   - maxLineGap: default 0
pub fn hough_lines_p(image:& ::core::Mat, lines:& ::core::Mat, rho: f64, theta: f64, threshold: i32, minLineLength: f64, maxLineGap: f64) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_HoughLinesP_InputArray_image_OutputArray_lines_double_rho_double_theta_int_threshold_double_minLineLength_double_maxLineGap(image.as_raw_Mat(), lines.as_raw_Mat(), rho, theta, threshold, minLineLength, maxLineGap);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_HoughLines_InputArray_image_OutputArray_lines_double_rho_double_theta_int_threshold_double_srn_double_stn
/// finds lines in the black-n-white image using the standard or pyramid Hough transform
///
/// default value for arguments:
///   - srn: default 0
///   - stn: default 0
pub fn hough_lines(image:& ::core::Mat, lines:& ::core::Mat, rho: f64, theta: f64, threshold: i32, srn: f64, stn: f64) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_HoughLines_InputArray_image_OutputArray_lines_double_rho_double_theta_int_threshold_double_srn_double_stn(image.as_raw_Mat(), lines.as_raw_Mat(), rho, theta, threshold, srn, stn);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_HuMoments_Moments_m_OutputArray_hu
pub fn hu_moments(m: ::imgproc::Moments, hu:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_HuMoments_Moments_m_OutputArray_hu(m, hu.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_Laplacian_InputArray_src_OutputArray_dst_int_ddepth_int_ksize_double_scale_double_delta_int_borderType
/// applies Laplacian operator to the image
///
/// default value for arguments:
///   - ksize: default 1
///   - scale: default 1
///   - delta: default 0
///   - borderType: default BORDER_DEFAULT
pub fn laplacian(src:& ::core::Mat, dst:& ::core::Mat, ddepth: i32, ksize: i32, scale: f64, delta: f64, borderType: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_Laplacian_InputArray_src_OutputArray_dst_int_ddepth_int_ksize_double_scale_double_delta_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), ddepth, ksize, scale, delta, borderType);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_PSNR_InputArray_src1_InputArray_src2
/// computes PSNR image/video quality metric
pub fn psnr(src1:& ::core::Mat, src2:& ::core::Mat) -> Result<f64,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_PSNR_InputArray_src1_InputArray_src2(src1.as_raw_Mat(), src2.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_Scharr_InputArray_src_OutputArray_dst_int_ddepth_int_dx_int_dy_double_scale_double_delta_int_borderType
/// applies the vertical or horizontal Scharr operator to the image
///
/// default value for arguments:
///   - scale: default 1
///   - delta: default 0
///   - borderType: default BORDER_DEFAULT
pub fn scharr(src:& ::core::Mat, dst:& ::core::Mat, ddepth: i32, dx: i32, dy: i32, scale: f64, delta: f64, borderType: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_Scharr_InputArray_src_OutputArray_dst_int_ddepth_int_dx_int_dy_double_scale_double_delta_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), ddepth, dx, dy, scale, delta, borderType);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_Sobel_InputArray_src_OutputArray_dst_int_ddepth_int_dx_int_dy_int_ksize_double_scale_double_delta_int_borderType
/// applies generalized Sobel operator to the image
///
/// default value for arguments:
///   - ksize: default 3
///   - scale: default 1
///   - delta: default 0
///   - borderType: default BORDER_DEFAULT
pub fn sobel(src:& ::core::Mat, dst:& ::core::Mat, ddepth: i32, dx: i32, dy: i32, ksize: i32, scale: f64, delta: f64, borderType: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_Sobel_InputArray_src_OutputArray_dst_int_ddepth_int_dx_int_dy_int_ksize_double_scale_double_delta_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), ddepth, dx, dy, ksize, scale, delta, borderType);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_adaptiveBilateralFilter_InputArray_src_OutputArray_dst_Size_ksize_double_sigmaSpace_double_maxSigmaColor_Point_anchor_int_borderType
/// smooths the image using adaptive bilateral filter
///
/// default value for arguments:
///   - maxSigmaColor: default 20.0
///   - anchor: default Point(-1, -1)
///   - borderType: default BORDER_DEFAULT
pub fn adaptive_bilateral_filter(src:& ::core::Mat, dst:& ::core::Mat, ksize: ::core::Size, sigmaSpace: f64, maxSigmaColor: f64, anchor: ::core::Point, borderType: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_adaptiveBilateralFilter_InputArray_src_OutputArray_dst_Size_ksize_double_sigmaSpace_double_maxSigmaColor_Point_anchor_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), ksize, sigmaSpace, maxSigmaColor, anchor, borderType);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_adaptiveThreshold_InputArray_src_OutputArray_dst_double_maxValue_int_adaptiveMethod_int_thresholdType_int_blockSize_double_C
/// applies variable (adaptive) threshold to the image
pub fn adaptive_threshold(src:& ::core::Mat, dst:& ::core::Mat, maxValue: f64, adaptiveMethod: i32, thresholdType: i32, blockSize: i32, C: f64) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_adaptiveThreshold_InputArray_src_OutputArray_dst_double_maxValue_int_adaptiveMethod_int_thresholdType_int_blockSize_double_C(src.as_raw_Mat(), dst.as_raw_Mat(), maxValue, adaptiveMethod, thresholdType, blockSize, C);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_approxPolyDP_InputArray_curve_OutputArray_approxCurve_double_epsilon_bool_closed
/// approximates contour or a curve using Douglas-Peucker algorithm
pub fn approx_poly_dp(curve:& ::core::Mat, approxCurve:& ::core::Mat, epsilon: f64, closed: bool) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_approxPolyDP_InputArray_curve_OutputArray_approxCurve_double_epsilon_bool_closed(curve.as_raw_Mat(), approxCurve.as_raw_Mat(), epsilon, closed);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_arcLength_InputArray_curve_bool_closed
/// computes the contour perimeter (closed=true) or a curve length
pub fn arc_length(curve:& ::core::Mat, closed: bool) -> Result<f64,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_arcLength_InputArray_curve_bool_closed(curve.as_raw_Mat(), closed);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_bilateralFilter_InputArray_src_OutputArray_dst_int_d_double_sigmaColor_double_sigmaSpace_int_borderType
/// smooths the image using bilateral filter
///
/// default value for arguments:
///   - borderType: default BORDER_DEFAULT
pub fn bilateral_filter(src:& ::core::Mat, dst:& ::core::Mat, d: i32, sigmaColor: f64, sigmaSpace: f64, borderType: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_bilateralFilter_InputArray_src_OutputArray_dst_int_d_double_sigmaColor_double_sigmaSpace_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), d, sigmaColor, sigmaSpace, borderType);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_blur_InputArray_src_OutputArray_dst_Size_ksize_Point_anchor_int_borderType
/// a synonym for normalized box filter
///
/// default value for arguments:
///   - anchor: default Point(-1,-1)
///   - borderType: default BORDER_DEFAULT
pub fn blur(src:& ::core::Mat, dst:& ::core::Mat, ksize: ::core::Size, anchor: ::core::Point, borderType: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_blur_InputArray_src_OutputArray_dst_Size_ksize_Point_anchor_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), ksize, anchor, borderType);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_borderInterpolate_int_p_int_len_int_borderType
/// 1D interpolation function: returns coordinate of the "donor" pixel for the specified location p.
pub fn border_interpolate(p: i32, len: i32, borderType: i32) -> Result<i32,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_borderInterpolate_int_p_int_len_int_borderType(p, len, borderType);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_boundingRect_InputArray_points
/// computes the bounding rectangle for a contour
pub fn bounding_rect(points:& ::core::Mat) -> Result<::core::Rect,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_boundingRect_InputArray_points(points.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_boxFilter_InputArray_src_OutputArray_dst_int_ddepth_Size_ksize_Point_anchor_bool_normalize_int_borderType
/// smooths the image using the box filter. Each pixel is processed in O(1) time
///
/// default value for arguments:
///   - anchor: default Point(-1,-1)
///   - normalize: default true
///   - borderType: default BORDER_DEFAULT
pub fn box_filter(src:& ::core::Mat, dst:& ::core::Mat, ddepth: i32, ksize: ::core::Size, anchor: ::core::Point, normalize: bool, borderType: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_boxFilter_InputArray_src_OutputArray_dst_int_ddepth_Size_ksize_Point_anchor_bool_normalize_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), ddepth, ksize, anchor, normalize, borderType);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_compareHist_InputArray_H1_InputArray_H2_int_method
/// compares two histograms stored in dense arrays
pub fn compare_hist(H1:& ::core::Mat, H2:& ::core::Mat, method: i32) -> Result<f64,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_compareHist_InputArray_H1_InputArray_H2_int_method(H1.as_raw_Mat(), H2.as_raw_Mat(), method);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_contourArea_InputArray_contour_bool_oriented
/// computes the contour area
///
/// default value for arguments:
///   - oriented: default false
pub fn contour_area(contour:& ::core::Mat, oriented: bool) -> Result<f64,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_contourArea_InputArray_contour_bool_oriented(contour.as_raw_Mat(), oriented);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_convertMaps_InputArray_map1_InputArray_map2_OutputArray_dstmap1_OutputArray_dstmap2_int_dstmap1type_bool_nninterpolation
/// converts maps for remap from floating-point to fixed-point format or backwards
///
/// default value for arguments:
///   - nninterpolation: default false
pub fn convert_maps(map1:& ::core::Mat, map2:& ::core::Mat, dstmap1:& ::core::Mat, dstmap2:& ::core::Mat, dstmap1type: i32, nninterpolation: bool) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_convertMaps_InputArray_map1_InputArray_map2_OutputArray_dstmap1_OutputArray_dstmap2_int_dstmap1type_bool_nninterpolation(map1.as_raw_Mat(), map2.as_raw_Mat(), dstmap1.as_raw_Mat(), dstmap2.as_raw_Mat(), dstmap1type, nninterpolation);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_convexHull_InputArray_points_OutputArray_hull_bool_clockwise_bool_returnPoints
/// computes convex hull for a set of 2D points.
///
/// default value for arguments:
///   - clockwise: default false
///   - returnPoints: default true
pub fn convex_hull(points:& ::core::Mat, hull:& ::core::Mat, clockwise: bool, returnPoints: bool) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_convexHull_InputArray_points_OutputArray_hull_bool_clockwise_bool_returnPoints(points.as_raw_Mat(), hull.as_raw_Mat(), clockwise, returnPoints);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_convexityDefects_InputArray_contour_InputArray_convexhull_OutputArray_convexityDefects
/// computes the contour convexity defects
pub fn convexity_defects(contour:& ::core::Mat, convexhull:& ::core::Mat, convexityDefects:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_convexityDefects_InputArray_contour_InputArray_convexhull_OutputArray_convexityDefects(contour.as_raw_Mat(), convexhull.as_raw_Mat(), convexityDefects.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_copyMakeBorder_InputArray_src_OutputArray_dst_int_top_int_bottom_int_left_int_right_int_borderType_Scalar_value
/// copies 2D array to a larger destination array with extrapolation of the outer part of src using the specified border mode
///
/// default value for arguments:
///   - value: default Scalar()
pub fn copy_make_border(src:& ::core::Mat, dst:& ::core::Mat, top: i32, bottom: i32, left: i32, right: i32, borderType: i32, value: ::core::Scalar) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_copyMakeBorder_InputArray_src_OutputArray_dst_int_top_int_bottom_int_left_int_right_int_borderType_Scalar_value(src.as_raw_Mat(), dst.as_raw_Mat(), top, bottom, left, right, borderType, value);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_cornerEigenValsAndVecs_InputArray_src_OutputArray_dst_int_blockSize_int_ksize_int_borderType
/// computes both eigenvalues and the eigenvectors of 2x2 derivative covariation matrix  at each pixel. The output is stored as 6-channel matrix.
///
/// default value for arguments:
///   - borderType: default BORDER_DEFAULT
pub fn corner_eigen_vals_and_vecs(src:& ::core::Mat, dst:& ::core::Mat, blockSize: i32, ksize: i32, borderType: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_cornerEigenValsAndVecs_InputArray_src_OutputArray_dst_int_blockSize_int_ksize_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), blockSize, ksize, borderType);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_cornerHarris_InputArray_src_OutputArray_dst_int_blockSize_int_ksize_double_k_int_borderType
/// computes Harris cornerness criteria at each image pixel
///
/// default value for arguments:
///   - borderType: default BORDER_DEFAULT
pub fn corner_harris(src:& ::core::Mat, dst:& ::core::Mat, blockSize: i32, ksize: i32, k: f64, borderType: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_cornerHarris_InputArray_src_OutputArray_dst_int_blockSize_int_ksize_double_k_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), blockSize, ksize, k, borderType);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_cornerMinEigenVal_InputArray_src_OutputArray_dst_int_blockSize_int_ksize_int_borderType
/// computes minimum eigen value of 2x2 derivative covariation matrix at each pixel - the cornerness criteria
///
/// default value for arguments:
///   - ksize: default 3
///   - borderType: default BORDER_DEFAULT
pub fn corner_min_eigen_val(src:& ::core::Mat, dst:& ::core::Mat, blockSize: i32, ksize: i32, borderType: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_cornerMinEigenVal_InputArray_src_OutputArray_dst_int_blockSize_int_ksize_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), blockSize, ksize, borderType);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_createBoxFilter_int_srcType_int_dstType_Size_ksize_Point_anchor_bool_normalize_int_borderType
/// returns box filter engine
///
/// default value for arguments:
///   - anchor: default Point(-1,-1)
///   - normalize: default true
///   - borderType: default BORDER_DEFAULT
pub fn create_box_filter(srcType: i32, dstType: i32, ksize: ::core::Size, anchor: ::core::Point, normalize: bool, borderType: i32) -> Result<::types::PtrOfFilterEngine,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_createBoxFilter_int_srcType_int_dstType_Size_ksize_Point_anchor_bool_normalize_int_borderType(srcType, dstType, ksize, anchor, normalize, borderType);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(::types::PtrOfFilterEngine{ ptr: rv.result })
  }
}

// identifier: cv_createDerivFilter_int_srcType_int_dstType_int_dx_int_dy_int_ksize_int_borderType
/// returns filter engine for the generalized Sobel operator
///
/// default value for arguments:
///   - borderType: default BORDER_DEFAULT
pub fn create_deriv_filter(srcType: i32, dstType: i32, dx: i32, dy: i32, ksize: i32, borderType: i32) -> Result<::types::PtrOfFilterEngine,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_createDerivFilter_int_srcType_int_dstType_int_dx_int_dy_int_ksize_int_borderType(srcType, dstType, dx, dy, ksize, borderType);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(::types::PtrOfFilterEngine{ ptr: rv.result })
  }
}

// identifier: cv_createGaussianFilter_int_type_Size_ksize_double_sigma1_double_sigma2_int_borderType
/// returns the Gaussian filter engine
///
/// default value for arguments:
///   - sigma2: default 0
///   - borderType: default BORDER_DEFAULT
pub fn create_gaussian_filter(_type: i32, ksize: ::core::Size, sigma1: f64, sigma2: f64, borderType: i32) -> Result<::types::PtrOfFilterEngine,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_createGaussianFilter_int_type_Size_ksize_double_sigma1_double_sigma2_int_borderType(_type, ksize, sigma1, sigma2, borderType);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(::types::PtrOfFilterEngine{ ptr: rv.result })
  }
}

// identifier: cv_createHanningWindow_OutputArray_dst_Size_winSize_int_type
pub fn create_hanning_window(dst:& ::core::Mat, winSize: ::core::Size, _type: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_createHanningWindow_OutputArray_dst_Size_winSize_int_type(dst.as_raw_Mat(), winSize, _type);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_createLinearFilter_int_srcType_int_dstType_InputArray_kernel_Point__anchor_double_delta_int_rowBorderType_int_columnBorderType_Scalar_borderValue
/// returns the non-separable linear filter engine
///
/// default value for arguments:
///   - _anchor: default Point(-1,-1)
///   - delta: default 0
///   - rowBorderType: default BORDER_DEFAULT
///   - columnBorderType: default -1
///   - borderValue: default Scalar()
pub fn create_linear_filter(srcType: i32, dstType: i32, kernel:& ::core::Mat, _anchor: ::core::Point, delta: f64, rowBorderType: i32, columnBorderType: i32, borderValue: ::core::Scalar) -> Result<::types::PtrOfFilterEngine,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_createLinearFilter_int_srcType_int_dstType_InputArray_kernel_Point__anchor_double_delta_int_rowBorderType_int_columnBorderType_Scalar_borderValue(srcType, dstType, kernel.as_raw_Mat(), _anchor, delta, rowBorderType, columnBorderType, borderValue);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(::types::PtrOfFilterEngine{ ptr: rv.result })
  }
}

// identifier: cv_createMorphologyFilter_int_op_int_type_InputArray_kernel_Point_anchor_int_rowBorderType_int_columnBorderType_Scalar_borderValue
/// returns morphological filter engine. Only MORPH_ERODE and MORPH_DILATE are supported.
///
/// default value for arguments:
///   - anchor: default Point(-1,-1)
///   - rowBorderType: default BORDER_CONSTANT
///   - columnBorderType: default -1
///   - borderValue: default morphologyDefaultBorderValue()
pub fn create_morphology_filter(op: i32, _type: i32, kernel:& ::core::Mat, anchor: ::core::Point, rowBorderType: i32, columnBorderType: i32, borderValue: ::core::Scalar) -> Result<::types::PtrOfFilterEngine,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_createMorphologyFilter_int_op_int_type_InputArray_kernel_Point_anchor_int_rowBorderType_int_columnBorderType_Scalar_borderValue(op, _type, kernel.as_raw_Mat(), anchor, rowBorderType, columnBorderType, borderValue);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(::types::PtrOfFilterEngine{ ptr: rv.result })
  }
}

// identifier: cv_createSeparableLinearFilter_int_srcType_int_dstType_InputArray_rowKernel_InputArray_columnKernel_Point_anchor_double_delta_int_rowBorderType_int_columnBorderType_Scalar_borderValue
/// returns the separable linear filter engine
///
/// default value for arguments:
///   - anchor: default Point(-1,-1)
///   - delta: default 0
///   - rowBorderType: default BORDER_DEFAULT
///   - columnBorderType: default -1
///   - borderValue: default Scalar()
pub fn create_separable_linear_filter(srcType: i32, dstType: i32, rowKernel:& ::core::Mat, columnKernel:& ::core::Mat, anchor: ::core::Point, delta: f64, rowBorderType: i32, columnBorderType: i32, borderValue: ::core::Scalar) -> Result<::types::PtrOfFilterEngine,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_createSeparableLinearFilter_int_srcType_int_dstType_InputArray_rowKernel_InputArray_columnKernel_Point_anchor_double_delta_int_rowBorderType_int_columnBorderType_Scalar_borderValue(srcType, dstType, rowKernel.as_raw_Mat(), columnKernel.as_raw_Mat(), anchor, delta, rowBorderType, columnBorderType, borderValue);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(::types::PtrOfFilterEngine{ ptr: rv.result })
  }
}

// identifier: cv_cvtColor_InputArray_src_OutputArray_dst_int_code_int_dstCn
/// converts image from one color space to another
///
/// default value for arguments:
///   - dstCn: default 0
pub fn cvt_color(src:& ::core::Mat, dst:& ::core::Mat, code: i32, dstCn: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_cvtColor_InputArray_src_OutputArray_dst_int_code_int_dstCn(src.as_raw_Mat(), dst.as_raw_Mat(), code, dstCn);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_dilate_InputArray_src_OutputArray_dst_InputArray_kernel_Point_anchor_int_iterations_int_borderType_Scalar_borderValue
/// dilates the image (applies the local maximum operator)
///
/// default value for arguments:
///   - anchor: default Point(-1,-1)
///   - iterations: default 1
///   - borderType: default BORDER_CONSTANT
///   - borderValue: default morphologyDefaultBorderValue()
pub fn dilate(src:& ::core::Mat, dst:& ::core::Mat, kernel:& ::core::Mat, anchor: ::core::Point, iterations: i32, borderType: i32, borderValue: ::core::Scalar) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_dilate_InputArray_src_OutputArray_dst_InputArray_kernel_Point_anchor_int_iterations_int_borderType_Scalar_borderValue(src.as_raw_Mat(), dst.as_raw_Mat(), kernel.as_raw_Mat(), anchor, iterations, borderType, borderValue);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_distanceTransform_InputArray_src_OutputArray_dst_OutputArray_labels_int_distanceType_int_maskSize_int_labelType
/// builds the discrete Voronoi diagram
///
/// default value for arguments:
///   - labelType: default DIST_LABEL_CCOMP
pub fn distance_transform_labels(src:& ::core::Mat, dst:& ::core::Mat, labels:& ::core::Mat, distanceType: i32, maskSize: i32, labelType: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_distanceTransform_InputArray_src_OutputArray_dst_OutputArray_labels_int_distanceType_int_maskSize_int_labelType(src.as_raw_Mat(), dst.as_raw_Mat(), labels.as_raw_Mat(), distanceType, maskSize, labelType);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_distanceTransform_InputArray_src_OutputArray_dst_int_distanceType_int_maskSize
/// computes the distance transform map
pub fn distance_transform(src:& ::core::Mat, dst:& ::core::Mat, distanceType: i32, maskSize: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_distanceTransform_InputArray_src_OutputArray_dst_int_distanceType_int_maskSize(src.as_raw_Mat(), dst.as_raw_Mat(), distanceType, maskSize);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_equalizeHist_InputArray_src_OutputArray_dst
/// normalizes the grayscale image brightness and contrast by normalizing its histogram
pub fn equalize_hist(src:& ::core::Mat, dst:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_equalizeHist_InputArray_src_OutputArray_dst(src.as_raw_Mat(), dst.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_erode_InputArray_src_OutputArray_dst_InputArray_kernel_Point_anchor_int_iterations_int_borderType_Scalar_borderValue
/// erodes the image (applies the local minimum operator)
///
/// default value for arguments:
///   - anchor: default Point(-1,-1)
///   - iterations: default 1
///   - borderType: default BORDER_CONSTANT
///   - borderValue: default morphologyDefaultBorderValue()
pub fn erode(src:& ::core::Mat, dst:& ::core::Mat, kernel:& ::core::Mat, anchor: ::core::Point, iterations: i32, borderType: i32, borderValue: ::core::Scalar) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_erode_InputArray_src_OutputArray_dst_InputArray_kernel_Point_anchor_int_iterations_int_borderType_Scalar_borderValue(src.as_raw_Mat(), dst.as_raw_Mat(), kernel.as_raw_Mat(), anchor, iterations, borderType, borderValue);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_filter2D_InputArray_src_OutputArray_dst_int_ddepth_InputArray_kernel_Point_anchor_double_delta_int_borderType
/// applies non-separable 2D linear filter to the image
///
/// default value for arguments:
///   - anchor: default Point(-1,-1)
///   - delta: default 0
///   - borderType: default BORDER_DEFAULT
pub fn filter2_d(src:& ::core::Mat, dst:& ::core::Mat, ddepth: i32, kernel:& ::core::Mat, anchor: ::core::Point, delta: f64, borderType: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_filter2D_InputArray_src_OutputArray_dst_int_ddepth_InputArray_kernel_Point_anchor_double_delta_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), ddepth, kernel.as_raw_Mat(), anchor, delta, borderType);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_fitEllipse_InputArray_points
/// fits ellipse to the set of 2D points
pub fn fit_ellipse(points:& ::core::Mat) -> Result<::core::RotatedRect,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_fitEllipse_InputArray_points(points.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(::core::RotatedRect{ ptr: rv.result })
  }
}

// identifier: cv_fitLine_InputArray_points_OutputArray_line_int_distType_double_param_double_reps_double_aeps
/// fits line to the set of 2D points using M-estimator algorithm
pub fn fit_line(points:& ::core::Mat, line:& ::core::Mat, distType: i32, param: f64, reps: f64, aeps: f64) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_fitLine_InputArray_points_OutputArray_line_int_distType_double_param_double_reps_double_aeps(points.as_raw_Mat(), line.as_raw_Mat(), distType, param, reps, aeps);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_getAffineTransform_InputArray_src_InputArray_dst
pub fn get_affine_transform(src:& ::core::Mat, dst:& ::core::Mat) -> Result<::core::Mat,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_getAffineTransform_InputArray_src_InputArray_dst(src.as_raw_Mat(), dst.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(::core::Mat{ ptr: rv.result })
  }
}

// identifier: cv_getDefaultNewCameraMatrix_InputArray_cameraMatrix_Size_imgsize_bool_centerPrincipalPoint
/// returns the default new camera matrix (by default it is the same as cameraMatrix unless centerPricipalPoint=true)
///
/// default value for arguments:
///   - imgsize: default Size()
///   - centerPrincipalPoint: default false
pub fn get_default_new_camera_matrix(cameraMatrix:& ::core::Mat, imgsize: ::core::Size, centerPrincipalPoint: bool) -> Result<::core::Mat,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_getDefaultNewCameraMatrix_InputArray_cameraMatrix_Size_imgsize_bool_centerPrincipalPoint(cameraMatrix.as_raw_Mat(), imgsize, centerPrincipalPoint);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(::core::Mat{ ptr: rv.result })
  }
}

// identifier: cv_getDerivKernels_OutputArray_kx_OutputArray_ky_int_dx_int_dy_int_ksize_bool_normalize_int_ktype
/// initializes kernels of the generalized Sobel operator
///
/// default value for arguments:
///   - normalize: default false
///   - ktype: default CV_32F
pub fn get_deriv_kernels(kx:& ::core::Mat, ky:& ::core::Mat, dx: i32, dy: i32, ksize: i32, normalize: bool, ktype: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_getDerivKernels_OutputArray_kx_OutputArray_ky_int_dx_int_dy_int_ksize_bool_normalize_int_ktype(kx.as_raw_Mat(), ky.as_raw_Mat(), dx, dy, ksize, normalize, ktype);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_getGaborKernel_Size_ksize_double_sigma_double_theta_double_lambd_double_gamma_double_psi_int_ktype
/// returns the Gabor kernel with the specified parameters
///
/// default value for arguments:
///   - psi: default CV_PI*0.5
///   - ktype: default CV_64F
pub fn get_gabor_kernel(ksize: ::core::Size, sigma: f64, theta: f64, lambd: f64, gamma: f64, psi: f64, ktype: i32) -> Result<::core::Mat,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_getGaborKernel_Size_ksize_double_sigma_double_theta_double_lambd_double_gamma_double_psi_int_ktype(ksize, sigma, theta, lambd, gamma, psi, ktype);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(::core::Mat{ ptr: rv.result })
  }
}

// identifier: cv_getGaussianKernel_int_ksize_double_sigma_int_ktype
/// returns the Gaussian kernel with the specified parameters
///
/// default value for arguments:
///   - ktype: default CV_64F
pub fn get_gaussian_kernel(ksize: i32, sigma: f64, ktype: i32) -> Result<::core::Mat,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_getGaussianKernel_int_ksize_double_sigma_int_ktype(ksize, sigma, ktype);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(::core::Mat{ ptr: rv.result })
  }
}

// identifier: cv_getKernelType_InputArray_kernel_Point_anchor
/// returns type (one of KERNEL_*) of 1D or 2D kernel specified by its coefficients.
pub fn get_kernel_type(kernel:& ::core::Mat, anchor: ::core::Point) -> Result<i32,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_getKernelType_InputArray_kernel_Point_anchor(kernel.as_raw_Mat(), anchor);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_getPerspectiveTransform_InputArray_src_InputArray_dst
pub fn get_perspective_transform(src:& ::core::Mat, dst:& ::core::Mat) -> Result<::core::Mat,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_getPerspectiveTransform_InputArray_src_InputArray_dst(src.as_raw_Mat(), dst.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(::core::Mat{ ptr: rv.result })
  }
}

// identifier: cv_getRectSubPix_InputArray_image_Size_patchSize_Point2f_center_OutputArray_patch_int_patchType
/// extracts rectangle from the image at sub-pixel location
///
/// default value for arguments:
///   - patchType: default -1
pub fn get_rect_sub_pix(image:& ::core::Mat, patchSize: ::core::Size, center: ::core::Point2f, patch:& ::core::Mat, patchType: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_getRectSubPix_InputArray_image_Size_patchSize_Point2f_center_OutputArray_patch_int_patchType(image.as_raw_Mat(), patchSize, center, patch.as_raw_Mat(), patchType);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_getRotationMatrix2D_Point2f_center_double_angle_double_scale
/// returns 2x3 affine transformation matrix for the planar rotation.
pub fn get_rotation_matrix2_d(center: ::core::Point2f, angle: f64, scale: f64) -> Result<::core::Mat,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_getRotationMatrix2D_Point2f_center_double_angle_double_scale(center, angle, scale);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(::core::Mat{ ptr: rv.result })
  }
}

// identifier: cv_getStructuringElement_int_shape_Size_ksize_Point_anchor
/// returns structuring element of the specified shape and size
///
/// default value for arguments:
///   - anchor: default Point(-1,-1)
pub fn get_structuring_element(shape: i32, ksize: ::core::Size, anchor: ::core::Point) -> Result<::core::Mat,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_getStructuringElement_int_shape_Size_ksize_Point_anchor(shape, ksize, anchor);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(::core::Mat{ ptr: rv.result })
  }
}

// identifier: cv_goodFeaturesToTrack_InputArray_image_OutputArray_corners_int_maxCorners_double_qualityLevel_double_minDistance_InputArray_mask_int_blockSize_bool_useHarrisDetector_double_k
/// finds the strong enough corners where the cornerMinEigenVal() or cornerHarris() report the local maxima
///
/// default value for arguments:
///   - mask: default noArray()
///   - blockSize: default 3
///   - useHarrisDetector: default false
///   - k: default 0.04
pub fn good_features_to_track(image:& ::core::Mat, corners:& ::core::Mat, maxCorners: i32, qualityLevel: f64, minDistance: f64, mask:& ::core::Mat, blockSize: i32, useHarrisDetector: bool, k: f64) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_goodFeaturesToTrack_InputArray_image_OutputArray_corners_int_maxCorners_double_qualityLevel_double_minDistance_InputArray_mask_int_blockSize_bool_useHarrisDetector_double_k(image.as_raw_Mat(), corners.as_raw_Mat(), maxCorners, qualityLevel, minDistance, mask.as_raw_Mat(), blockSize, useHarrisDetector, k);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_initUndistortRectifyMap_InputArray_cameraMatrix_InputArray_distCoeffs_InputArray_R_InputArray_newCameraMatrix_Size_size_int_m1type_OutputArray_map1_OutputArray_map2
/// initializes maps for cv::remap() to correct lens distortion and optionally rectify the image
pub fn init_undistort_rectify_map(cameraMatrix:& ::core::Mat, distCoeffs:& ::core::Mat, R:& ::core::Mat, newCameraMatrix:& ::core::Mat, size: ::core::Size, m1type: i32, map1:& ::core::Mat, map2:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_initUndistortRectifyMap_InputArray_cameraMatrix_InputArray_distCoeffs_InputArray_R_InputArray_newCameraMatrix_Size_size_int_m1type_OutputArray_map1_OutputArray_map2(cameraMatrix.as_raw_Mat(), distCoeffs.as_raw_Mat(), R.as_raw_Mat(), newCameraMatrix.as_raw_Mat(), size, m1type, map1.as_raw_Mat(), map2.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_initWideAngleProjMap_InputArray_cameraMatrix_InputArray_distCoeffs_Size_imageSize_int_destImageWidth_int_m1type_OutputArray_map1_OutputArray_map2_int_projType_double_alpha
/// initializes maps for cv::remap() for wide-angle
///
/// default value for arguments:
///   - projType: default PROJ_SPHERICAL_EQRECT
///   - alpha: default 0
pub fn init_wide_angle_proj_map(cameraMatrix:& ::core::Mat, distCoeffs:& ::core::Mat, imageSize: ::core::Size, destImageWidth: i32, m1type: i32, map1:& ::core::Mat, map2:& ::core::Mat, projType: i32, alpha: f64) -> Result<f32,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_initWideAngleProjMap_InputArray_cameraMatrix_InputArray_distCoeffs_Size_imageSize_int_destImageWidth_int_m1type_OutputArray_map1_OutputArray_map2_int_projType_double_alpha(cameraMatrix.as_raw_Mat(), distCoeffs.as_raw_Mat(), imageSize, destImageWidth, m1type, map1.as_raw_Mat(), map2.as_raw_Mat(), projType, alpha);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_integral_InputArray_src_OutputArray_sum_OutputArray_sqsum_OutputArray_tilted_int_sdepth
/// computes the integral image, integral for the squared image and the tilted integral image
///
/// default value for arguments:
///   - sdepth: default -1
pub fn integral_tilted(src:& ::core::Mat, sum:& ::core::Mat, sqsum:& ::core::Mat, tilted:& ::core::Mat, sdepth: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_integral_InputArray_src_OutputArray_sum_OutputArray_sqsum_OutputArray_tilted_int_sdepth(src.as_raw_Mat(), sum.as_raw_Mat(), sqsum.as_raw_Mat(), tilted.as_raw_Mat(), sdepth);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_integral_InputArray_src_OutputArray_sum_OutputArray_sqsum_int_sdepth
/// computes the integral image and integral for the squared image
///
/// default value for arguments:
///   - sdepth: default -1
pub fn integral_sq(src:& ::core::Mat, sum:& ::core::Mat, sqsum:& ::core::Mat, sdepth: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_integral_InputArray_src_OutputArray_sum_OutputArray_sqsum_int_sdepth(src.as_raw_Mat(), sum.as_raw_Mat(), sqsum.as_raw_Mat(), sdepth);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_integral_InputArray_src_OutputArray_sum_int_sdepth
/// computes the integral image
///
/// default value for arguments:
///   - sdepth: default -1
pub fn integral(src:& ::core::Mat, sum:& ::core::Mat, sdepth: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_integral_InputArray_src_OutputArray_sum_int_sdepth(src.as_raw_Mat(), sum.as_raw_Mat(), sdepth);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_intersectConvexConvex_InputArray__p1_InputArray__p2_OutputArray__p12_bool_handleNested
/// finds intersection of two convex polygons
///
/// default value for arguments:
///   - handleNested: default true
pub fn intersect_convex_convex(_p1:& ::core::Mat, _p2:& ::core::Mat, _p12:& ::core::Mat, handleNested: bool) -> Result<f32,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_intersectConvexConvex_InputArray__p1_InputArray__p2_OutputArray__p12_bool_handleNested(_p1.as_raw_Mat(), _p2.as_raw_Mat(), _p12.as_raw_Mat(), handleNested);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_invertAffineTransform_InputArray_M_OutputArray_iM
/// computes 2x3 affine transformation matrix that is inverse to the specified 2x3 affine transformation.
pub fn invert_affine_transform(M:& ::core::Mat, iM:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_invertAffineTransform_InputArray_M_OutputArray_iM(M.as_raw_Mat(), iM.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_isContourConvex_InputArray_contour
/// returns true if the contour is convex. Does not support contours with self-intersection
pub fn is_contour_convex(contour:& ::core::Mat) -> Result<bool,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_isContourConvex_InputArray_contour(contour.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_matchShapes_InputArray_contour1_InputArray_contour2_int_method_double_parameter
/// matches two contours using one of the available algorithms
pub fn match_shapes(contour1:& ::core::Mat, contour2:& ::core::Mat, method: i32, parameter: f64) -> Result<f64,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_matchShapes_InputArray_contour1_InputArray_contour2_int_method_double_parameter(contour1.as_raw_Mat(), contour2.as_raw_Mat(), method, parameter);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_matchTemplate_InputArray_image_InputArray_templ_OutputArray_result_int_method
/// computes the proximity map for the raster template and the image where the template is searched for
pub fn match_template(image:& ::core::Mat, templ:& ::core::Mat, result:& ::core::Mat, method: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_matchTemplate_InputArray_image_InputArray_templ_OutputArray_result_int_method(image.as_raw_Mat(), templ.as_raw_Mat(), result.as_raw_Mat(), method);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_medianBlur_InputArray_src_OutputArray_dst_int_ksize
/// smooths the image using median filter.
pub fn median_blur(src:& ::core::Mat, dst:& ::core::Mat, ksize: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_medianBlur_InputArray_src_OutputArray_dst_int_ksize(src.as_raw_Mat(), dst.as_raw_Mat(), ksize);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_minAreaRect_InputArray_points
/// computes the minimal rotated rectangle for a set of points
pub fn min_area_rect(points:& ::core::Mat) -> Result<::core::RotatedRect,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_minAreaRect_InputArray_points(points.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(::core::RotatedRect{ ptr: rv.result })
  }
}

// identifier: cv_minEnclosingCircle_InputArray_points_Point2f_center_float_radius
/// computes the minimal enclosing circle for a set of points
pub fn min_enclosing_circle(points:& ::core::Mat, center: ::core::Point2f, radius: f32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_minEnclosingCircle_InputArray_points_Point2f_center_float_radius(points.as_raw_Mat(), center, radius);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_moments_InputArray_array_bool_binaryImage
/// computes moments of the rasterized shape or a vector of points
///
/// default value for arguments:
///   - binaryImage: default false
pub fn moments(array:& ::core::Mat, binaryImage: bool) -> Result<::imgproc::Moments,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_moments_InputArray_array_bool_binaryImage(array.as_raw_Mat(), binaryImage);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_morphologyDefaultBorderValue
/// returns "magic" border value for erosion and dilation. It is automatically transformed to Scalar::all(-DBL_MAX) for dilation.
pub fn morphology_default_border_value() -> Result<::core::Scalar,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_morphologyDefaultBorderValue();
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_morphologyEx_InputArray_src_OutputArray_dst_int_op_InputArray_kernel_Point_anchor_int_iterations_int_borderType_Scalar_borderValue
/// applies an advanced morphological operation to the image
///
/// default value for arguments:
///   - anchor: default Point(-1,-1)
///   - iterations: default 1
///   - borderType: default BORDER_CONSTANT
///   - borderValue: default morphologyDefaultBorderValue()
pub fn morphology_ex(src:& ::core::Mat, dst:& ::core::Mat, op: i32, kernel:& ::core::Mat, anchor: ::core::Point, iterations: i32, borderType: i32, borderValue: ::core::Scalar) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_morphologyEx_InputArray_src_OutputArray_dst_int_op_InputArray_kernel_Point_anchor_int_iterations_int_borderType_Scalar_borderValue(src.as_raw_Mat(), dst.as_raw_Mat(), op, kernel.as_raw_Mat(), anchor, iterations, borderType, borderValue);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_phaseCorrelate_InputArray_src1_InputArray_src2_InputArray_window
///
/// default value for arguments:
///   - window: default noArray()
pub fn phase_correlate(src1:& ::core::Mat, src2:& ::core::Mat, window:& ::core::Mat) -> Result<::core::Point2d,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_phaseCorrelate_InputArray_src1_InputArray_src2_InputArray_window(src1.as_raw_Mat(), src2.as_raw_Mat(), window.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_pointPolygonTest_InputArray_contour_Point2f_pt_bool_measureDist
/// checks if the point is inside the contour. Optionally computes the signed distance from the point to the contour boundary
pub fn point_polygon_test(contour:& ::core::Mat, pt: ::core::Point2f, measureDist: bool) -> Result<f64,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_pointPolygonTest_InputArray_contour_Point2f_pt_bool_measureDist(contour.as_raw_Mat(), pt, measureDist);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_preCornerDetect_InputArray_src_OutputArray_dst_int_ksize_int_borderType
/// computes another complex cornerness criteria at each pixel
///
/// default value for arguments:
///   - borderType: default BORDER_DEFAULT
pub fn pre_corner_detect(src:& ::core::Mat, dst:& ::core::Mat, ksize: i32, borderType: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_preCornerDetect_InputArray_src_OutputArray_dst_int_ksize_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), ksize, borderType);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_pyrDown_InputArray_src_OutputArray_dst_Size_dstsize_int_borderType
/// smooths and downsamples the image
///
/// default value for arguments:
///   - dstsize: default Size()
///   - borderType: default BORDER_DEFAULT
pub fn pyr_down(src:& ::core::Mat, dst:& ::core::Mat, dstsize: ::core::Size, borderType: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_pyrDown_InputArray_src_OutputArray_dst_Size_dstsize_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), dstsize, borderType);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_pyrMeanShiftFiltering_InputArray_src_OutputArray_dst_double_sp_double_sr_int_maxLevel_TermCriteria_termcrit
/// filters image using meanshift algorithm
///
/// default value for arguments:
///   - maxLevel: default 1
///   - termcrit: default TermCriteria( TermCriteria::MAX_ITER+TermCriteria::EPS,5,1)
pub fn pyr_mean_shift_filtering(src:& ::core::Mat, dst:& ::core::Mat, sp: f64, sr: f64, maxLevel: i32, termcrit:& ::core::TermCriteria) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_pyrMeanShiftFiltering_InputArray_src_OutputArray_dst_double_sp_double_sr_int_maxLevel_TermCriteria_termcrit(src.as_raw_Mat(), dst.as_raw_Mat(), sp, sr, maxLevel, termcrit.as_raw_TermCriteria());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_pyrUp_InputArray_src_OutputArray_dst_Size_dstsize_int_borderType
/// upsamples and smoothes the image
///
/// default value for arguments:
///   - dstsize: default Size()
///   - borderType: default BORDER_DEFAULT
pub fn pyr_up(src:& ::core::Mat, dst:& ::core::Mat, dstsize: ::core::Size, borderType: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_pyrUp_InputArray_src_OutputArray_dst_Size_dstsize_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), dstsize, borderType);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_remap_InputArray_src_OutputArray_dst_InputArray_map1_InputArray_map2_int_interpolation_int_borderMode_Scalar_borderValue
/// warps the image using the precomputed maps. The maps are stored in either floating-point or integer fixed-point format
///
/// default value for arguments:
///   - borderMode: default BORDER_CONSTANT
///   - borderValue: default Scalar()
pub fn remap(src:& ::core::Mat, dst:& ::core::Mat, map1:& ::core::Mat, map2:& ::core::Mat, interpolation: i32, borderMode: i32, borderValue: ::core::Scalar) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_remap_InputArray_src_OutputArray_dst_InputArray_map1_InputArray_map2_int_interpolation_int_borderMode_Scalar_borderValue(src.as_raw_Mat(), dst.as_raw_Mat(), map1.as_raw_Mat(), map2.as_raw_Mat(), interpolation, borderMode, borderValue);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_resize_InputArray_src_OutputArray_dst_Size_dsize_double_fx_double_fy_int_interpolation
/// resizes the image
///
/// default value for arguments:
///   - fx: default 0
///   - fy: default 0
///   - interpolation: default INTER_LINEAR
pub fn resize(src:& ::core::Mat, dst:& ::core::Mat, dsize: ::core::Size, fx: f64, fy: f64, interpolation: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_resize_InputArray_src_OutputArray_dst_Size_dsize_double_fx_double_fy_int_interpolation(src.as_raw_Mat(), dst.as_raw_Mat(), dsize, fx, fy, interpolation);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_sepFilter2D_InputArray_src_OutputArray_dst_int_ddepth_InputArray_kernelX_InputArray_kernelY_Point_anchor_double_delta_int_borderType
/// applies separable 2D linear filter to the image
///
/// default value for arguments:
///   - anchor: default Point(-1,-1)
///   - delta: default 0
///   - borderType: default BORDER_DEFAULT
pub fn sep_filter2_d(src:& ::core::Mat, dst:& ::core::Mat, ddepth: i32, kernelX:& ::core::Mat, kernelY:& ::core::Mat, anchor: ::core::Point, delta: f64, borderType: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_sepFilter2D_InputArray_src_OutputArray_dst_int_ddepth_InputArray_kernelX_InputArray_kernelY_Point_anchor_double_delta_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), ddepth, kernelX.as_raw_Mat(), kernelY.as_raw_Mat(), anchor, delta, borderType);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_threshold_InputArray_src_OutputArray_dst_double_thresh_double_maxval_int_type
/// applies fixed threshold to the image
pub fn threshold(src:& ::core::Mat, dst:& ::core::Mat, thresh: f64, maxval: f64, _type: i32) -> Result<f64,String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_threshold_InputArray_src_OutputArray_dst_double_thresh_double_maxval_int_type(src.as_raw_Mat(), dst.as_raw_Mat(), thresh, maxval, _type);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_undistortPoints_InputArray_src_OutputArray_dst_InputArray_cameraMatrix_InputArray_distCoeffs_InputArray_R_InputArray_P
/// returns points' coordinates after lens distortion correction
///
/// default value for arguments:
///   - R: default noArray()
///   - P: default noArray()
pub fn undistort_points(src:& ::core::Mat, dst:& ::core::Mat, cameraMatrix:& ::core::Mat, distCoeffs:& ::core::Mat, R:& ::core::Mat, P:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_undistortPoints_InputArray_src_OutputArray_dst_InputArray_cameraMatrix_InputArray_distCoeffs_InputArray_R_InputArray_P(src.as_raw_Mat(), dst.as_raw_Mat(), cameraMatrix.as_raw_Mat(), distCoeffs.as_raw_Mat(), R.as_raw_Mat(), P.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_undistort_InputArray_src_OutputArray_dst_InputArray_cameraMatrix_InputArray_distCoeffs_InputArray_newCameraMatrix
/// corrects lens distortion for the given camera matrix and distortion coefficients
///
/// default value for arguments:
///   - newCameraMatrix: default noArray()
pub fn undistort(src:& ::core::Mat, dst:& ::core::Mat, cameraMatrix:& ::core::Mat, distCoeffs:& ::core::Mat, newCameraMatrix:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_undistort_InputArray_src_OutputArray_dst_InputArray_cameraMatrix_InputArray_distCoeffs_InputArray_newCameraMatrix(src.as_raw_Mat(), dst.as_raw_Mat(), cameraMatrix.as_raw_Mat(), distCoeffs.as_raw_Mat(), newCameraMatrix.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_warpAffine_InputArray_src_OutputArray_dst_InputArray_M_Size_dsize_int_flags_int_borderMode_Scalar_borderValue
/// warps the image using affine transformation
///
/// default value for arguments:
///   - flags: default INTER_LINEAR
///   - borderMode: default BORDER_CONSTANT
///   - borderValue: default Scalar()
pub fn warp_affine(src:& ::core::Mat, dst:& ::core::Mat, M:& ::core::Mat, dsize: ::core::Size, flags: i32, borderMode: i32, borderValue: ::core::Scalar) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_warpAffine_InputArray_src_OutputArray_dst_InputArray_M_Size_dsize_int_flags_int_borderMode_Scalar_borderValue(src.as_raw_Mat(), dst.as_raw_Mat(), M.as_raw_Mat(), dsize, flags, borderMode, borderValue);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_warpPerspective_InputArray_src_OutputArray_dst_InputArray_M_Size_dsize_int_flags_int_borderMode_Scalar_borderValue
/// warps the image using perspective transformation
///
/// default value for arguments:
///   - flags: default INTER_LINEAR
///   - borderMode: default BORDER_CONSTANT
///   - borderValue: default Scalar()
pub fn warp_perspective(src:& ::core::Mat, dst:& ::core::Mat, M:& ::core::Mat, dsize: ::core::Size, flags: i32, borderMode: i32, borderValue: ::core::Scalar) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_imgproc_cv_warpPerspective_InputArray_src_OutputArray_dst_InputArray_M_Size_dsize_int_flags_int_borderMode_Scalar_borderValue(src.as_raw_Mat(), dst.as_raw_Mat(), M.as_raw_Mat(), dsize, flags, borderMode, borderValue);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// Generating impl for trait cv::CLAHE
pub trait CLAHE : ::core::Algorithm {
  fn as_raw_CLAHE(&self) -> *mut c_void;
}


// boxed class cv::FilterEngine
#[allow(dead_code)]
pub struct FilterEngine {
    pub ptr: *mut c_void
}
impl Drop for ::imgproc::FilterEngine {
    fn drop(&mut self) {
        unsafe { ::sys::cv_delete_FilterEngine(self.ptr) };
    }
}
impl ::imgproc::FilterEngine {
    pub fn as_raw_FilterEngine(&self) -> *mut c_void { self.ptr }
}
impl FilterEngine {

  // identifier: cv_FilterEngine_FilterEngine
  /// the default constructor
  pub fn new() -> Result<::imgproc::FilterEngine,String> {
    unsafe {
      let rv = ::sys::cv_imgproc_cv_FilterEngine_FilterEngine();
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::imgproc::FilterEngine{ ptr: rv.result })
    }
  }

  // identifier: cv_FilterEngine_start_Size_wholeSize_Rect_roi_int_maxBufRows
  /// starts filtering of the specified ROI of an image of size wholeSize.
  ///
  /// default value for arguments:
  ///   - maxBufRows: default -1
  pub fn start_size(&mut self, wholeSize: ::core::Size, roi: ::core::Rect, maxBufRows: i32) -> Result<i32,String> {
    unsafe {
      let rv = ::sys::cv_imgproc_cv_FilterEngine_start_Size_wholeSize_Rect_roi_int_maxBufRows(self.as_raw_FilterEngine(), wholeSize, roi, maxBufRows);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_FilterEngine_start_Mat_src_Rect_srcRoi_bool_isolated_int_maxBufRows
  /// starts filtering of the specified ROI of the specified image.
  ///
  /// default value for arguments:
  ///   - srcRoi: default Rect(0,0,-1,-1)
  ///   - isolated: default false
  ///   - maxBufRows: default -1
  pub fn start_mat(&mut self, src:& ::core::Mat, srcRoi: ::core::Rect, isolated: bool, maxBufRows: i32) -> Result<i32,String> {
    unsafe {
      let rv = ::sys::cv_imgproc_cv_FilterEngine_start_Mat_src_Rect_srcRoi_bool_isolated_int_maxBufRows(self.as_raw_FilterEngine(), src.as_raw_Mat(), srcRoi, isolated, maxBufRows);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_FilterEngine_apply_Mat_src_Mat_dst_Rect_srcRoi_Point_dstOfs_bool_isolated
  /// applies filter to the specified ROI of the image. if srcRoi=(0,0,-1,-1), the whole image is filtered.
  ///
  /// default value for arguments:
  ///   - srcRoi: default Rect(0,0,-1,-1)
  ///   - dstOfs: default Point(0,0)
  ///   - isolated: default false
  pub fn apply(&mut self, src:& ::core::Mat, dst:& ::core::Mat, srcRoi: ::core::Rect, dstOfs: ::core::Point, isolated: bool) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_imgproc_cv_FilterEngine_apply_Mat_src_Mat_dst_Rect_srcRoi_Point_dstOfs_bool_isolated(self.as_raw_FilterEngine(), src.as_raw_Mat(), dst.as_raw_Mat(), srcRoi, dstOfs, isolated);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_FilterEngine_isSeparable
  /// returns true if the filter is separable
  pub fn is_separable(&self) -> Result<bool,String> {
    unsafe {
      let rv = ::sys::cv_imgproc_cv_FilterEngine_isSeparable(self.as_raw_FilterEngine());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_FilterEngine_remainingInputRows
  /// returns the number
  pub fn remaining_input_rows(&self) -> Result<i32,String> {
    unsafe {
      let rv = ::sys::cv_imgproc_cv_FilterEngine_remainingInputRows(self.as_raw_FilterEngine());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_FilterEngine_remainingOutputRows
  pub fn remaining_output_rows(&self) -> Result<i32,String> {
    unsafe {
      let rv = ::sys::cv_imgproc_cv_FilterEngine_remainingOutputRows(self.as_raw_FilterEngine());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

}
// Generating impl for trait cv::GeneralizedHough
pub trait GeneralizedHough : ::core::Algorithm {
  fn as_raw_GeneralizedHough(&self) -> *mut c_void;
  // identifier: cv_GeneralizedHough_create_int_method
  fn create(&mut self, method: i32) -> Result<::types::PtrOfGeneralizedHough,String> {
    unsafe {
      let rv = ::sys::cv_imgproc_cv_GeneralizedHough_create_int_method(self.as_raw_GeneralizedHough(), method);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::types::PtrOfGeneralizedHough{ ptr: rv.result })
    }
  }

  // identifier: cv_GeneralizedHough_setTemplate_InputArray_edges_InputArray_dx_InputArray_dy_Point_templCenter
  ///
  /// default value for arguments:
  ///   - templCenter: default Point(-1, -1)
  fn set_template(&mut self, edges:& ::core::Mat, dx:& ::core::Mat, dy:& ::core::Mat, templCenter: ::core::Point) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_imgproc_cv_GeneralizedHough_setTemplate_InputArray_edges_InputArray_dx_InputArray_dy_Point_templCenter(self.as_raw_GeneralizedHough(), edges.as_raw_Mat(), dx.as_raw_Mat(), dy.as_raw_Mat(), templCenter);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_GeneralizedHough_detect_InputArray_image_OutputArray_positions_OutputArray_votes_int_cannyThreshold
  /// find template on image
  ///
  /// default value for arguments:
  ///   - votes: default cv::noArray()
  ///   - cannyThreshold: default 100
  fn detect(&mut self, image:& ::core::Mat, positions:& ::core::Mat, votes:& ::core::Mat, cannyThreshold: i32) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_imgproc_cv_GeneralizedHough_detect_InputArray_image_OutputArray_positions_OutputArray_votes_int_cannyThreshold(self.as_raw_GeneralizedHough(), image.as_raw_Mat(), positions.as_raw_Mat(), votes.as_raw_Mat(), cannyThreshold);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_GeneralizedHough_detect_InputArray_edges_InputArray_dx_InputArray_dy_OutputArray_positions_OutputArray_votes
  ///
  /// default value for arguments:
  ///   - votes: default cv::noArray()
  fn detect_edges(&mut self, edges:& ::core::Mat, dx:& ::core::Mat, dy:& ::core::Mat, positions:& ::core::Mat, votes:& ::core::Mat) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_imgproc_cv_GeneralizedHough_detect_InputArray_edges_InputArray_dx_InputArray_dy_OutputArray_positions_OutputArray_votes(self.as_raw_GeneralizedHough(), edges.as_raw_Mat(), dx.as_raw_Mat(), dy.as_raw_Mat(), positions.as_raw_Mat(), votes.as_raw_Mat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_GeneralizedHough_release
  fn release(&mut self) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_imgproc_cv_GeneralizedHough_release(self.as_raw_GeneralizedHough());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

}

impl Moments {

  // identifier: cv_Moments_Moments
  /// the default constructor
  pub fn default() -> Result<::imgproc::Moments,String> {
    unsafe {
      let rv = ::sys::cv_imgproc_cv_Moments_Moments();
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_Moments_Moments_double_m00_double_m10_double_m01_double_m20_double_m11_double_m02_double_m30_double_m21_double_m12_double_m03
  /// the full constructor
  pub fn new(m00: f64, m10: f64, m01: f64, m20: f64, m11: f64, m02: f64, m30: f64, m21: f64, m12: f64, m03: f64) -> Result<::imgproc::Moments,String> {
    unsafe {
      let rv = ::sys::cv_imgproc_cv_Moments_Moments_double_m00_double_m10_double_m01_double_m20_double_m11_double_m02_double_m30_double_m21_double_m12_double_m03(m00, m10, m01, m20, m11, m02, m30, m21, m12, m03);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

}

// boxed class cv::Subdiv2D
#[allow(dead_code)]
pub struct Subdiv2D {
    pub ptr: *mut c_void
}
impl Drop for ::imgproc::Subdiv2D {
    fn drop(&mut self) {
        unsafe { ::sys::cv_delete_Subdiv2D(self.ptr) };
    }
}
impl ::imgproc::Subdiv2D {
    pub fn as_raw_Subdiv2D(&self) -> *mut c_void { self.ptr }
}
impl Subdiv2D {

  // identifier: cv_Subdiv2D_Subdiv2D
  pub fn default() -> Result<::imgproc::Subdiv2D,String> {
    unsafe {
      let rv = ::sys::cv_imgproc_cv_Subdiv2D_Subdiv2D();
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::imgproc::Subdiv2D{ ptr: rv.result })
    }
  }

  // identifier: cv_Subdiv2D_Subdiv2D_Rect_rect
  pub fn new(rect: ::core::Rect) -> Result<::imgproc::Subdiv2D,String> {
    unsafe {
      let rv = ::sys::cv_imgproc_cv_Subdiv2D_Subdiv2D_Rect_rect(rect);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::imgproc::Subdiv2D{ ptr: rv.result })
    }
  }

  // identifier: cv_Subdiv2D_initDelaunay_Rect_rect
  pub fn init_delaunay(&mut self, rect: ::core::Rect) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_imgproc_cv_Subdiv2D_initDelaunay_Rect_rect(self.as_raw_Subdiv2D(), rect);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_Subdiv2D_insert_Point2f_pt
  pub fn insert(&mut self, pt: ::core::Point2f) -> Result<i32,String> {
    unsafe {
      let rv = ::sys::cv_imgproc_cv_Subdiv2D_insert_Point2f_pt(self.as_raw_Subdiv2D(), pt);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_Subdiv2D_insert_VectorOfPoint2f_ptvec
  pub fn insert_n(&mut self, ptvec:& ::types::VectorOfPoint2f) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_imgproc_cv_Subdiv2D_insert_VectorOfPoint2f_ptvec(self.as_raw_Subdiv2D(), ptvec.as_raw_VectorOfPoint2f());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_Subdiv2D_locate_Point2f_pt_int_edge_int_vertex
  pub fn locate(&mut self, pt: ::core::Point2f, edge: i32, vertex: i32) -> Result<i32,String> {
    unsafe {
      let rv = ::sys::cv_imgproc_cv_Subdiv2D_locate_Point2f_pt_int_edge_int_vertex(self.as_raw_Subdiv2D(), pt, edge, vertex);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_Subdiv2D_getEdgeList_VectorOfVec4f_edgeList
  pub fn get_edge_list(&self, edgeList:& ::types::VectorOfVec4f) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_imgproc_cv_Subdiv2D_getEdgeList_VectorOfVec4f_edgeList(self.as_raw_Subdiv2D(), edgeList.as_raw_VectorOfVec4f());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_Subdiv2D_getTriangleList_VectorOfVec6f_triangleList
  pub fn get_triangle_list(&self, triangleList:& ::types::VectorOfVec6f) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_imgproc_cv_Subdiv2D_getTriangleList_VectorOfVec6f_triangleList(self.as_raw_Subdiv2D(), triangleList.as_raw_VectorOfVec6f());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_Subdiv2D_getVoronoiFacetList_VectorOfint_idx_VectorOfVectorOfPoint2f_facetList_VectorOfPoint2f_facetCenters
  pub fn get_voronoi_facet_list(&mut self, idx:& ::types::VectorOfint, facetList:& ::types::VectorOfVectorOfPoint2f, facetCenters:& ::types::VectorOfPoint2f) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_imgproc_cv_Subdiv2D_getVoronoiFacetList_VectorOfint_idx_VectorOfVectorOfPoint2f_facetList_VectorOfPoint2f_facetCenters(self.as_raw_Subdiv2D(), idx.as_raw_VectorOfint(), facetList.as_raw_VectorOfVectorOfPoint2f(), facetCenters.as_raw_VectorOfPoint2f());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_Subdiv2D_getEdge_int_edge_int_nextEdgeType
  pub fn get_edge(&self, edge: i32, nextEdgeType: i32) -> Result<i32,String> {
    unsafe {
      let rv = ::sys::cv_imgproc_cv_Subdiv2D_getEdge_int_edge_int_nextEdgeType(self.as_raw_Subdiv2D(), edge, nextEdgeType);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_Subdiv2D_nextEdge_int_edge
  pub fn next_edge(&self, edge: i32) -> Result<i32,String> {
    unsafe {
      let rv = ::sys::cv_imgproc_cv_Subdiv2D_nextEdge_int_edge(self.as_raw_Subdiv2D(), edge);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_Subdiv2D_rotateEdge_int_edge_int_rotate
  pub fn rotate_edge(&self, edge: i32, rotate: i32) -> Result<i32,String> {
    unsafe {
      let rv = ::sys::cv_imgproc_cv_Subdiv2D_rotateEdge_int_edge_int_rotate(self.as_raw_Subdiv2D(), edge, rotate);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_Subdiv2D_symEdge_int_edge
  pub fn sym_edge(&self, edge: i32) -> Result<i32,String> {
    unsafe {
      let rv = ::sys::cv_imgproc_cv_Subdiv2D_symEdge_int_edge(self.as_raw_Subdiv2D(), edge);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

}