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 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068
|
# -*- coding: utf-8 -*-
from libc.stddef cimport size_t
from libcpp.vector cimport vector
from libcpp.string cimport string
from libcpp cimport bool
from boost_shared_ptr cimport shared_ptr
# main
# cimport pcl_defs as cpp
from pcl_defs cimport PointIndices
from pcl_defs cimport ModelCoefficients
from pcl_defs cimport PointCloud
from pcl_defs cimport PointXYZ
from pcl_defs cimport PointXYZI
from pcl_defs cimport PointXYZRGB
from pcl_defs cimport PointXYZRGBA
from pcl_defs cimport Normal
from pcl_defs cimport PCLBase
from pcl_sample_consensus_172 cimport SacModel
cimport pcl_surface_172 as pclsf
cimport pcl_kdtree_172 as pclkdt
##
cimport eigen as eigen3
from vector cimport vector as vector2
###############################################################################
# Types
###############################################################################
### base class ###
cdef extern from "pcl/segmentation/sac_segmentation.h" namespace "pcl":
cdef cppclass SACSegmentation[T](PCLBase[T]):
SACSegmentation()
void setModelType (SacModel)
# /** \brief Empty constructor. */
# SACSegmentation () : model_ (), sac_ (), model_type_ (-1), method_type_ (0),
# threshold_ (0), optimize_coefficients_ (true),
# radius_min_ (-std::numeric_limits<double>::max()), radius_max_ (std::numeric_limits<double>::max()), samples_radius_ (0.0), eps_angle_ (0.0),
# axis_ (Eigen::Vector3f::Zero ()), max_iterations_ (50), probability_ (0.99)
#
# /** \brief Get the type of SAC model used.
# inline int getModelType () const { return (model_type_); }
int getModelType ()
# \brief Get a pointer to the SAC method used.
# inline SampleConsensusPtr getMethod () const { return (sac_); }
#
# \brief Get a pointer to the SAC model used.
# inline SampleConsensusModelPtr getModel () const { return (model_); }
void setMethodType (int)
# brief Get the type of sample consensus method used.
# inline int getMethodType () const { return (method_type_); }
int getMethodType ()
void setDistanceThreshold (float)
# brief Get the distance to the model threshold.
# inline double getDistanceThreshold () const { return (threshold_); }
double getDistanceThreshold ()
# use PCLBase class function
# void setInputCloud (shared_ptr[PointCloud[T]])
void setMaxIterations (int)
# \brief Get maximum number of iterations before giving up.
# inline int getMaxIterations () const { return (max_iterations_); }
int getMaxIterations ()
# \brief Set the probability of choosing at least one sample free from outliers.
# \param[in] probability the model fitting probability
# inline void setProbability (double probability) { probability_ = probability; }
void setProbability (double probability)
# \brief Get the probability of choosing at least one sample free from outliers.
# inline double getProbability () const { return (probability_); }
double getProbability ()
void setOptimizeCoefficients (bool)
# \brief Get the coefficient refinement internal flag.
# inline bool getOptimizeCoefficients () const { return (optimize_coefficients_); }
bool getOptimizeCoefficients ()
# \brief Set the minimum and maximum allowable radius limits for the model (applicable to models that estimate a radius)
# \param[in] min_radius the minimum radius model
# \param[in] max_radius the maximum radius model
# inline void setRadiusLimits (const double &min_radius, const double &max_radius)
void setRadiusLimits (const double &min_radius, const double &max_radius)
# \brief Get the minimum and maximum allowable radius limits for the model as set by the user.
# \param[out] min_radius the resultant minimum radius model
# \param[out] max_radius the resultant maximum radius model
# inline void getRadiusLimits (double &min_radius, double &max_radius)
void getRadiusLimits (double &min_radius, double &max_radius)
# \brief Set the maximum distance allowed when drawing random samples
# \param[in] radius the maximum distance (L2 norm)
# inline void setSamplesMaxDist (const double &radius, SearchPtr search)
# void setSamplesMaxDist (const double &radius, SearchPtr search)
# \brief Get maximum distance allowed when drawing random samples
# \param[out] radius the maximum distance (L2 norm)
# inline void getSamplesMaxDist (double &radius)
void getSamplesMaxDist (double &radius)
# \brief Set the axis along which we need to search for a model perpendicular to.
# \param[in] ax the axis along which we need to search for a model perpendicular to
# inline void setAxis (const Eigen::Vector3f &ax) { axis_ = ax; }
void setAxis (const eigen3.Vector3f &ax)
# \brief Get the axis along which we need to search for a model perpendicular to.
# inline Eigen::Vector3f getAxis () const { return (axis_); }
eigen3.Vector3f getAxis ()
# \brief Set the angle epsilon (delta) threshold.
# \param[in] ea the maximum allowed difference between the model normal and the given axis in radians.
# inline void setEpsAngle (double ea) { eps_angle_ = ea; }
void setEpsAngle (double ea)
# /** \brief Get the epsilon (delta) model angle threshold in radians. */
# inline double getEpsAngle () const { return (eps_angle_); }
double getEpsAngle ()
void segment (PointIndices, ModelCoefficients)
ctypedef SACSegmentation[PointXYZ] SACSegmentation_t
ctypedef SACSegmentation[PointXYZI] SACSegmentation_PointXYZI_t
ctypedef SACSegmentation[PointXYZRGB] SACSegmentation_PointXYZRGB_t
ctypedef SACSegmentation[PointXYZRGBA] SACSegmentation_PointXYZRGBA_t
###
# \brief @b SACSegmentationFromNormals represents the PCL nodelet segmentation class for Sample Consensus methods and
# models that require the use of surface normals for estimation.
# \ingroup segmentation
cdef extern from "pcl/segmentation/sac_segmentation.h" namespace "pcl":
# cdef cppclass SACSegmentationFromNormals[T, N](SACSegmentation[T])
cdef cppclass SACSegmentationFromNormals[T, N]:
SACSegmentationFromNormals()
void setOptimizeCoefficients (bool)
void setModelType (SacModel)
void setMethodType (int)
void setNormalDistanceWeight (float)
void setMaxIterations (int)
void setDistanceThreshold (float)
void setRadiusLimits (float, float)
void setInputCloud (shared_ptr[PointCloud[T]])
void setInputNormals (shared_ptr[PointCloud[N]])
void setEpsAngle (double ea)
void segment (PointIndices, ModelCoefficients)
void setMinMaxOpeningAngle(double, double)
void getMinMaxOpeningAngle(double, double)
# Add
# /** \brief Empty constructor. */
# SACSegmentationFromNormals () :
# normals_ (),
# distance_weight_ (0.1),
# distance_from_origin_ (0),
# min_angle_ (),
# max_angle_ ()
# {};
#
# /** \brief Provide a pointer to the input dataset that contains the point normals of
# * the XYZ dataset.
# * \param[in] normals the const boost shared pointer to a PointCloud message
# */
# inline void setInputNormals (const PointCloudNConstPtr &normals) { normals_ = normals; }
#
# /** \brief Get a pointer to the normals of the input XYZ point cloud dataset. */
# inline PointCloudNConstPtr getInputNormals () const { return (normals_); }
#
# /** \brief Set the relative weight (between 0 and 1) to give to the angular
# * distance (0 to pi/2) between point normals and the plane normal.
# * \param[in] distance_weight the distance/angular weight
# */
# inline void setNormalDistanceWeight (double distance_weight) { distance_weight_ = distance_weight; }
#
# /** \brief Get the relative weight (between 0 and 1) to give to the angular distance (0 to pi/2) between point
# * normals and the plane normal. */
# inline double getNormalDistanceWeight () const { return (distance_weight_); }
#
# /** \brief Set the minimum opning angle for a cone model.
# * \param oa the opening angle which we need minumum to validate a cone model.
# */
# inline void setMinMaxOpeningAngle (const double &min_angle, const double &max_angle)
#
# /** \brief Get the opening angle which we need minumum to validate a cone model. */
# inline void getMinMaxOpeningAngle (double &min_angle, double &max_angle)
#
# /** \brief Set the distance we expect a plane model to be from the origin
# * \param[in] d distance from the template plane modl to the origin
# */
# inline void setDistanceFromOrigin (const double d) { distance_from_origin_ = d; }
#
# /** \brief Get the distance of a plane model from the origin. */
# inline double getDistanceFromOrigin () const { return (distance_from_origin_); }
ctypedef SACSegmentationFromNormals[PointXYZ,Normal] SACSegmentationFromNormals_t
ctypedef SACSegmentationFromNormals[PointXYZI,Normal] SACSegmentationFromNormals_PointXYZI_t
ctypedef SACSegmentationFromNormals[PointXYZRGB,Normal] SACSegmentationFromNormals_PointXYZRGB_t
ctypedef SACSegmentationFromNormals[PointXYZRGBA,Normal] SACSegmentationFromNormals_PointXYZRGBA_t
###
# comparator.h
# namespace pcl
# brief Comparator is the base class for comparators that compare two points given some function.
# Currently intended for use with OrganizedConnectedComponentSegmentation
# author Alex Trevor
# template <typename PointT> class Comparator
cdef extern from "pcl/segmentation/comparator.h" namespace "pcl":
cdef cppclass Comparator[T]:
Comparator()
# public:
# typedef pcl::PointCloud<PointT> PointCloud;
# typedef typename PointCloud::Ptr PointCloudPtr;
# typedef typename PointCloud::ConstPtr PointCloudConstPtr;
# typedef boost::shared_ptr<Comparator<PointT> > Ptr;
# typedef boost::shared_ptr<const Comparator<PointT> > ConstPtr;
#
# /** \brief Set the input cloud for the comparator.
# * \param[in] cloud the point cloud this comparator will operate on
# */
# virtual void setInputCloud (const PointCloudConstPtr& cloud)
#
# /** \brief Get the input cloud this comparator operates on. */
# virtual PointCloudConstPtr getInputCloud () const
#
# /** \brief Compares the two points in the input cloud designated by these two indices.
# * This is pure virtual and must be implemented by subclasses with some comparison function.
# * \param[in] idx1 the index of the first point.
# * \param[in] idx2 the index of the second point.
# */
# virtual bool compare (int idx1, int idx2) const = 0;
###
# plane_coefficient_comparator.h
# namespace pcl
# brief PlaneCoefficientComparator is a Comparator that operates on plane coefficients, for use in planar segmentation.
# In conjunction with OrganizedConnectedComponentSegmentation, this allows planes to be segmented from organized data.
# author Alex Trevor
# template<typename PointT, typename PointNT> class PlaneCoefficientComparator: public Comparator<PointT>
cdef extern from "pcl/segmentation/plane_coefficient_comparator.h" namespace "pcl":
cdef cppclass PlaneCoefficientComparator[T, NT](Comparator[T]):
PlaneCoefficientComparator()
# PlaneCoefficientComparator (boost::shared_ptr<std::vector<float> >& plane_coeff_d)
# public:
# typedef typename Comparator<PointT>::PointCloud PointCloud;
# typedef typename Comparator<PointT>::PointCloudConstPtr PointCloudConstPtr;
# typedef typename pcl::PointCloud<PointNT> PointCloudN;
# typedef typename PointCloudN::Ptr PointCloudNPtr;
# typedef typename PointCloudN::ConstPtr PointCloudNConstPtr;
# typedef boost::shared_ptr<PlaneCoefficientComparator<PointT, PointNT> > Ptr;
# typedef boost::shared_ptr<const PlaneCoefficientComparator<PointT, PointNT> > ConstPtr;
# using pcl::Comparator<PointT>::input_;
#
# virtual void setInputCloud (const PointCloudConstPtr& cloud)
# /** \brief Provide a pointer to the input normals.
# * \param[in] normals the input normal cloud
# inline void setInputNormals (const PointCloudNConstPtr &normals)
# /** \brief Get the input normals. */
# inline PointCloudNConstPtr getInputNormals () const
# /** \brief Provide a pointer to a vector of the d-coefficient of the planes' hessian normal form. a, b, and c are provided by the normal cloud.
# * \param[in] plane_coeff_d a pointer to the plane coefficients.
# void setPlaneCoeffD (boost::shared_ptr<std::vector<float> >& plane_coeff_d)
# /** \brief Provide a pointer to a vector of the d-coefficient of the planes' hessian normal form. a, b, and c are provided by the normal cloud.
# * \param[in] plane_coeff_d a pointer to the plane coefficients.
# void setPlaneCoeffD (std::vector<float>& plane_coeff_d)
# /** \brief Get a pointer to the vector of the d-coefficient of the planes' hessian normal form. */
# const std::vector<float>& getPlaneCoeffD () const
# /** \brief Set the tolerance in radians for difference in normal direction between neighboring points, to be considered part of the same plane.
# * \param[in] angular_threshold the tolerance in radians
# virtual void setAngularThreshold (float angular_threshold)
# /** \brief Get the angular threshold in radians for difference in normal direction between neighboring points, to be considered part of the same plane. */
# inline float getAngularThreshold () const
float getAngularThreshold ()
# /** \brief Set the tolerance in meters for difference in perpendicular distance (d component of plane equation) to the plane between neighboring points, to be considered part of the same plane.
# * \param[in] distance_threshold the tolerance in meters (at 1m)
# * \param[in] depth_dependent whether to scale the threshold based on range from the sensor (default: false)
# void setDistanceThreshold (float distance_threshold, bool depth_dependent = false)
void setDistanceThreshold (float distance_threshold, bool depth_dependent)
# /** \brief Get the distance threshold in meters (d component of plane equation) between neighboring points, to be considered part of the same plane. */
# inline float getDistanceThreshold () const
float getDistanceThreshold ()
# /** \brief Compare points at two indices by their plane equations. True if the angle between the normals is less than the angular threshold,
# * and the difference between the d component of the normals is less than distance threshold, else false
# * \param idx1 The first index for the comparison
# * \param idx2 The second index for the comparison
# virtual bool compare (int idx1, int idx2) const
###
### Inheritance class ###
# edge_aware_plane_comparator.h
# namespace pcl
# /** \brief EdgeAwarePlaneComparator is a Comparator that operates on plane coefficients,
# * for use in planar segmentation.
# * In conjunction with OrganizedConnectedComponentSegmentation, this allows planes to be segmented from organized data.
# * \author Stefan Holzer, Alex Trevor
# */
# template<typename PointT, typename PointNT>
# class EdgeAwarePlaneComparator: public PlaneCoefficientComparator<PointT, PointNT>
cdef extern from "pcl/segmentation/edge_aware_plane_comparator.h" namespace "pcl":
cdef cppclass EdgeAwarePlaneComparator[T, NT](PlaneCoefficientComparator[T, NT]):
EdgeAwarePlaneComparator()
# EdgeAwarePlaneComparator (const float *distance_map)
# public:
# typedef typename Comparator<PointT>::PointCloud PointCloud;
# typedef typename Comparator<PointT>::PointCloudConstPtr PointCloudConstPtr;
# typedef typename pcl::PointCloud<PointNT> PointCloudN;
# typedef typename PointCloudN::Ptr PointCloudNPtr;
# typedef typename PointCloudN::ConstPtr PointCloudNConstPtr;
# typedef boost::shared_ptr<EdgeAwarePlaneComparator<PointT, PointNT> > Ptr;
# typedef boost::shared_ptr<const EdgeAwarePlaneComparator<PointT, PointNT> > ConstPtr;
# using pcl::PlaneCoefficientComparator<PointT, PointNT>::input_;
# using pcl::PlaneCoefficientComparator<PointT, PointNT>::normals_;
# using pcl::PlaneCoefficientComparator<PointT, PointNT>::plane_coeff_d_;
# using pcl::PlaneCoefficientComparator<PointT, PointNT>::angular_threshold_;
# using pcl::PlaneCoefficientComparator<PointT, PointNT>::distance_threshold_;
#
# /** \brief Set a distance map to use. For an example of a valid distance map see
# * \ref OrganizedIntegralImageNormalEstimation
# * \param[in] distance_map the distance map to use
# */
# inline void setDistanceMap (const float *distance_map)
# /** \brief Return the distance map used. */
# const float* getDistanceMap () const
###
# euclidean_cluster_comparator.h
# namespace pcl
# /** \brief EuclideanClusterComparator is a comparator used for finding clusters supported by planar surfaces.
# * This needs to be run as a second pass after extracting planar surfaces, using MultiPlaneSegmentation for example.
# * \author Alex Trevor
# template<typename PointT, typename PointNT, typename PointLT>
# class EuclideanClusterComparator: public Comparator<PointT>
cdef extern from "pcl/segmentation/euclidean_cluster_comparator.h" namespace "pcl":
cdef cppclass EuclideanClusterComparator[T, NT, LT](Comparator[T]):
EuclideanClusterComparator()
# public:
# typedef typename Comparator<PointT>::PointCloud PointCloud;
# typedef typename Comparator<PointT>::PointCloudConstPtr PointCloudConstPtr;
# typedef typename pcl::PointCloud<PointNT> PointCloudN;
# typedef typename PointCloudN::Ptr PointCloudNPtr;
# typedef typename PointCloudN::ConstPtr PointCloudNConstPtr;
# typedef typename pcl::PointCloud<PointLT> PointCloudL;
# typedef typename PointCloudL::Ptr PointCloudLPtr;
# typedef typename PointCloudL::ConstPtr PointCloudLConstPtr;
# typedef boost::shared_ptr<EuclideanClusterComparator<PointT, PointNT, PointLT> > Ptr;
# typedef boost::shared_ptr<const EuclideanClusterComparator<PointT, PointNT, PointLT> > ConstPtr;
# using pcl::Comparator<PointT>::input_;
#
# virtual void setInputCloud (const PointCloudConstPtr& cloud)
# /** \brief Provide a pointer to the input normals.
# * \param[in] normals the input normal cloud
# inline void setInputNormals (const PointCloudNConstPtr &normals)
void setInputNormals (const shared_ptr[PointCloud[NT]] &normals)
# /** \brief Get the input normals. */
# inline PointCloudNConstPtr getInputNormals () const
const shared_ptr[PointCloud[NT]] getInputNormals ()
# /** \brief Set the tolerance in radians for difference in normal direction between neighboring points, to be considered part of the same plane.
# * \param[in] angular_threshold the tolerance in radians
# virtual inline void setAngularThreshold (float angular_threshold)
#
# /** \brief Get the angular threshold in radians for difference in normal direction between neighboring points, to be considered part of the same plane. */
# inline float getAngularThreshold () const
float getAngularThreshold ()
# /** \brief Set the tolerance in meters for difference in perpendicular distance (d component of plane equation) to the plane between neighboring points, to be considered part of the same plane.
# * \param[in] distance_threshold the tolerance in meters
# inline void setDistanceThreshold (float distance_threshold, bool depth_dependent)
void setDistanceThreshold (float distance_threshold, bool depth_dependent)
# /** \brief Get the distance threshold in meters (d component of plane equation) between neighboring points, to be considered part of the same plane. */
# inline float getDistanceThreshold () const
float getDistanceThreshold ()
# /** \brief Set label cloud
# * \param[in] labels The label cloud
# void setLabels (PointCloudLPtr& labels)
void setLabels (shared_ptr[PointCloud[LT]] &labels)
#
# /** \brief Set labels in the label cloud to exclude.
# * \param exclude_labels a vector of bools corresponding to whether or not a given label should be considered
# void setExcludeLabels (std::vector<bool>& exclude_labels)
void setExcludeLabels (vector[bool]& exclude_labels)
# /** \brief Compare points at two indices by their plane equations. True if the angle between the normals is less than the angular threshold,
# * and the difference between the d component of the normals is less than distance threshold, else false
# * \param idx1 The first index for the comparison
# * \param idx2 The second index for the comparison
# virtual bool compare (int idx1, int idx2) const
ctypedef EuclideanClusterComparator[PointXYZ, Normal, PointXYZ] EuclideanClusterComparator_t
ctypedef EuclideanClusterComparator[PointXYZI, Normal, PointXYZ] EuclideanClusterComparator_PointXYZI_t
ctypedef EuclideanClusterComparator[PointXYZRGB, Normal, PointXYZ] EuclideanClusterComparator_PointXYZRGB_t
ctypedef EuclideanClusterComparator[PointXYZRGBA, Normal, PointXYZ] EuclideanClusterComparator_PointXYZRGBA_t
ctypedef shared_ptr[EuclideanClusterComparator[PointXYZ, Normal, PointXYZ]] EuclideanClusterComparatorPtr_t
ctypedef shared_ptr[EuclideanClusterComparator[PointXYZI, Normal, PointXYZ]] EuclideanClusterComparator_PointXYZI_Ptr_t
ctypedef shared_ptr[EuclideanClusterComparator[PointXYZRGB, Normal, PointXYZ]] EuclideanClusterComparator_PointXYZRGB_Ptr_t
ctypedef shared_ptr[EuclideanClusterComparator[PointXYZRGBA, Normal, PointXYZ]] EuclideanClusterComparator_PointXYZRGBA_Ptr_t
###
# euclidean_plane_coefficient_comparator.h
# namespace pcl
# /** \brief EuclideanPlaneCoefficientComparator is a Comparator that operates on plane coefficients,
# * for use in planar segmentation.
# * In conjunction with OrganizedConnectedComponentSegmentation, this allows planes to be segmented from organized data.
# * \author Alex Trevor
# template<typename PointT, typename PointNT>
# class EuclideanPlaneCoefficientComparator: public PlaneCoefficientComparator<PointT, PointNT>
cdef extern from "pcl/segmentation/euclidean_plane_coefficient_comparator.h" namespace "pcl":
cdef cppclass EuclideanPlaneCoefficientComparator[T, NT](PlaneCoefficientComparator[T, NT]):
EuclideanPlaneCoefficientComparator()
# public:
# typedef typename Comparator<PointT>::PointCloud PointCloud;
# typedef typename Comparator<PointT>::PointCloudConstPtr PointCloudConstPtr;
# typedef typename pcl::PointCloud<PointNT> PointCloudN;
# typedef typename PointCloudN::Ptr PointCloudNPtr;
# typedef typename PointCloudN::ConstPtr PointCloudNConstPtr;
# typedef boost::shared_ptr<EuclideanPlaneCoefficientComparator<PointT, PointNT> > Ptr;
# typedef boost::shared_ptr<const EuclideanPlaneCoefficientComparator<PointT, PointNT> > ConstPtr;
# using pcl::Comparator<PointT>::input_;
# using pcl::PlaneCoefficientComparator<PointT, PointNT>::normals_;
# using pcl::PlaneCoefficientComparator<PointT, PointNT>::angular_threshold_;
# using pcl::PlaneCoefficientComparator<PointT, PointNT>::distance_threshold_;
#
# /** \brief Compare two neighboring points, by using normal information, and euclidean distance information.
# * \param[in] idx1 The index of the first point.
# * \param[in] idx2 The index of the second point.
# */
# virtual bool compare (int idx1, int idx2) const
###
# extract_clusters.h
# namespace pcl
# brief Decompose a region of space into clusters based on the Euclidean distance between points
# param cloud the point cloud message
# param tree the spatial locator (e.g., kd-tree) used for nearest neighbors searching
# note the tree has to be created as a spatial locator on \a cloud
# param tolerance the spatial cluster tolerance as a measure in L2 Euclidean space
# param clusters the resultant clusters containing point indices (as a vector of PointIndices)
# param min_pts_per_cluster minimum number of points that a cluster may contain (default: 1)
# param max_pts_per_cluster maximum number of points that a cluster may contain (default: max int)
# ingroup segmentation
# template <typename PointT> void extractEuclideanClusters (
# const PointCloud<PointT> &cloud, const boost::shared_ptr<search::Search<PointT> > &tree,
# float tolerance, std::vector<PointIndices> &clusters,
# unsigned int min_pts_per_cluster = 1, unsigned int max_pts_per_cluster = (std::numeric_limits<int>::max) ());
###
# extract_clusters.h
# namespace pcl
# /** \brief Decompose a region of space into clusters based on the Euclidean distance between points
# * \param cloud the point cloud message
# * \param indices a list of point indices to use from \a cloud
# * \param tree the spatial locator (e.g., kd-tree) used for nearest neighbors searching
# * \note the tree has to be created as a spatial locator on \a cloud and \a indices
# * \param tolerance the spatial cluster tolerance as a measure in L2 Euclidean space
# * \param clusters the resultant clusters containing point indices (as a vector of PointIndices)
# * \param min_pts_per_cluster minimum number of points that a cluster may contain (default: 1)
# * \param max_pts_per_cluster maximum number of points that a cluster may contain (default: max int)
# * \ingroup segmentation
# */
# template <typename PointT> void
# extractEuclideanClusters (
# const PointCloud<PointT> &cloud, const std::vector<int> &indices,
# const boost::shared_ptr<search::Search<PointT> > &tree, float tolerance, std::vector<PointIndices> &clusters,
# unsigned int min_pts_per_cluster = 1, unsigned int max_pts_per_cluster = (std::numeric_limits<int>::max) ());
###
# extract_clusters.h
# namespace pcl
# /** \brief Decompose a region of space into clusters based on the euclidean distance between points, and the normal
# * angular deviation
# * \param cloud the point cloud message
# * \param normals the point cloud message containing normal information
# * \param tree the spatial locator (e.g., kd-tree) used for nearest neighbors searching
# * \note the tree has to be created as a spatial locator on \a cloud
# * \param tolerance the spatial cluster tolerance as a measure in the L2 Euclidean space
# * \param clusters the resultant clusters containing point indices (as a vector of PointIndices)
# * \param eps_angle the maximum allowed difference between normals in radians for cluster/region growing
# * \param min_pts_per_cluster minimum number of points that a cluster may contain (default: 1)
# * \param max_pts_per_cluster maximum number of points that a cluster may contain (default: max int)
# * \ingroup segmentation
# */
# template <typename PointT, typename Normal> void
# extractEuclideanClusters (
# const PointCloud<PointT> &cloud, const PointCloud<Normal> &normals,
# float tolerance, const boost::shared_ptr<KdTree<PointT> > &tree,
# std::vector<PointIndices> &clusters, double eps_angle,
# unsigned int min_pts_per_cluster = 1,
# unsigned int max_pts_per_cluster = (std::numeric_limits<int>::max) ())
###
# extract_clusters.h
# namespace pcl
# /** \brief Decompose a region of space into clusters based on the euclidean distance between points, and the normal
# * angular deviation
# * \param cloud the point cloud message
# * \param normals the point cloud message containing normal information
# * \param indices a list of point indices to use from \a cloud
# * \param tree the spatial locator (e.g., kd-tree) used for nearest neighbors searching
# * \note the tree has to be created as a spatial locator on \a cloud
# * \param tolerance the spatial cluster tolerance as a measure in the L2 Euclidean space
# * \param clusters the resultant clusters containing point indices (as PointIndices)
# * \param eps_angle the maximum allowed difference between normals in degrees for cluster/region growing
# * \param min_pts_per_cluster minimum number of points that a cluster may contain (default: 1)
# * \param max_pts_per_cluster maximum number of points that a cluster may contain (default: max int)
# * \ingroup segmentation
# */
# template <typename PointT, typename Normal>
# void extractEuclideanClusters (
# const PointCloud<PointT> &cloud, const PointCloud<Normal> &normals,
# const std::vector<int> &indices, const boost::shared_ptr<KdTree<PointT> > &tree,
# float tolerance, std::vector<PointIndices> &clusters, double eps_angle,
# unsigned int min_pts_per_cluster = 1,
# unsigned int max_pts_per_cluster = (std::numeric_limits<int>::max) ())
###
# extract_clusters.h
# namespace pcl
# EuclideanClusterExtraction represents a segmentation class for cluster extraction in an Euclidean sense.
# author Radu Bogdan Rusu
# ingroup segmentation
# template <typename PointT>
# class EuclideanClusterExtraction: public PCLBase<PointT>
cdef extern from "pcl/segmentation/extract_clusters.h" namespace "pcl":
cdef cppclass EuclideanClusterExtraction[T](PCLBase[T]):
EuclideanClusterExtraction()
# public:
# EuclideanClusterExtraction () : tree_ (),
# cluster_tolerance_ (0),
# min_pts_per_cluster_ (1),
# max_pts_per_cluster_ (std::numeric_limits<int>::max ())
# brief Provide a pointer to the search object.
# param[in] tree a pointer to the spatial search object.
# inline void setSearchMethod (const KdTreePtr &tree)
void setSearchMethod (const pclkdt.KdTreePtr_t &tree)
# brief Get a pointer to the search method used.
# @todo fix this for a generic search tree
# inline KdTreePtr getSearchMethod () const
pclkdt.KdTreePtr_t getSearchMethod ()
# brief Set the spatial cluster tolerance as a measure in the L2 Euclidean space
# param[in] tolerance the spatial cluster tolerance as a measure in the L2 Euclidean space
# inline void setClusterTolerance (double tolerance)
void setClusterTolerance (double tolerance)
# brief Get the spatial cluster tolerance as a measure in the L2 Euclidean space.
# inline double getClusterTolerance () const
double getClusterTolerance ()
# brief Set the minimum number of points that a cluster needs to contain in order to be considered valid.
# param[in] min_cluster_size the minimum cluster size
# inline void setMinClusterSize (int min_cluster_size)
void setMinClusterSize (int min_cluster_size)
# brief Get the minimum number of points that a cluster needs to contain in order to be considered valid.
# inline int getMinClusterSize () const
int getMinClusterSize ()
# brief Set the maximum number of points that a cluster needs to contain in order to be considered valid.
# param[in] max_cluster_size the maximum cluster size
# inline void setMaxClusterSize (int max_cluster_size)
void setMaxClusterSize (int max_cluster_size)
# brief Get the maximum number of points that a cluster needs to contain in order to be considered valid.
# inline int getMaxClusterSize () const
int getMaxClusterSize ()
# brief Cluster extraction in a PointCloud given by <setInputCloud (), setIndices ()>
# param[out] clusters the resultant point clusters
# void extract (std::vector<PointIndices> &clusters);
void extract (vector[PointIndices] &clusters)
ctypedef EuclideanClusterExtraction[PointXYZ] EuclideanClusterExtraction_t
ctypedef EuclideanClusterExtraction[PointXYZI] EuclideanClusterExtraction_PointXYZI_t
ctypedef EuclideanClusterExtraction[PointXYZRGB] EuclideanClusterExtraction_PointXYZRGB_t
ctypedef EuclideanClusterExtraction[PointXYZRGBA] EuclideanClusterExtraction_PointXYZRGBA_t
###
# extract_labeled_clusters.h
# namespace pcl
# /** \brief Decompose a region of space into clusters based on the Euclidean distance between points
# * \param[in] cloud the point cloud message
# * \param[in] tree the spatial locator (e.g., kd-tree) used for nearest neighbors searching
# * \note the tree has to be created as a spatial locator on \a cloud
# * \param[in] tolerance the spatial cluster tolerance as a measure in L2 Euclidean space
# * \param[out] labeled_clusters the resultant clusters containing point indices (as a vector of PointIndices)
# * \param[in] min_pts_per_cluster minimum number of points that a cluster may contain (default: 1)
# * \param[in] max_pts_per_cluster maximum number of points that a cluster may contain (default: max int)
# * \param[in] max_label
# * \ingroup segmentation
# */
# template <typename PointT> void
# extractLabeledEuclideanClusters (
# const PointCloud<PointT> &cloud, const boost::shared_ptr<search::Search<PointT> > &tree,
# float tolerance, std::vector<std::vector<PointIndices> > &labeled_clusters,
# unsigned int min_pts_per_cluster = 1, unsigned int max_pts_per_cluster = (std::numeric_limits<int>::max) (),
# unsigned int max_label = (std::numeric_limits<int>::max));
# extract_labeled_clusters.h
# namespace pcl
# brief @b LabeledEuclideanClusterExtraction represents a segmentation class for cluster extraction in an Euclidean sense, with label info.
# author Koen Buys
# ingroup segmentation
# template <typename PointT>
# class LabeledEuclideanClusterExtraction: public PCLBase<PointT>
cdef extern from "pcl/segmentation/extract_labeled_clusters.h" namespace "pcl":
cdef cppclass LabeledEuclideanClusterExtraction[T](PCLBase[T]):
LabeledEuclideanClusterExtraction()
# typedef PCLBase<PointT> BasePCLBase;
#
# public:
# typedef pcl::PointCloud<PointT> PointCloud;
# typedef typename PointCloud::Ptr PointCloudPtr;
# typedef typename PointCloud::ConstPtr PointCloudConstPtr;
# typedef typename pcl::search::Search<PointT> KdTree;
# typedef typename pcl::search::Search<PointT>::Ptr KdTreePtr;
# typedef PointIndices::Ptr PointIndicesPtr;
# typedef PointIndices::ConstPtr PointIndicesConstPtr;
#
# /** \brief Empty constructor. */
# LabeledEuclideanClusterExtraction () :
# tree_ (),
# cluster_tolerance_ (0),
# min_pts_per_cluster_ (1),
# max_pts_per_cluster_ (std::numeric_limits<int>::max ()),
# max_label_ (std::numeric_limits<int>::max ())
# {};
#
# /** \brief Provide a pointer to the search object.
# * \param[in] tree a pointer to the spatial search object.
# */
# inline void setSearchMethod (const KdTreePtr &tree) { tree_ = tree; }
#
# /** \brief Get a pointer to the search method used. */
# inline KdTreePtr getSearchMethod () const { return (tree_); }
#
# /** \brief Set the spatial cluster tolerance as a measure in the L2 Euclidean space
# * \param[in] tolerance the spatial cluster tolerance as a measure in the L2 Euclidean space
# */
# inline void setClusterTolerance (double tolerance) { cluster_tolerance_ = tolerance; }
#
# /** \brief Get the spatial cluster tolerance as a measure in the L2 Euclidean space. */
# inline double getClusterTolerance () const { return (cluster_tolerance_); }
#
# /** \brief Set the minimum number of points that a cluster needs to contain in order to be considered valid.
# * \param[in] min_cluster_size the minimum cluster size
# */
# inline void setMinClusterSize (int min_cluster_size) { min_pts_per_cluster_ = min_cluster_size; }
#
# /** \brief Get the minimum number of points that a cluster needs to contain in order to be considered valid. */
# inline int getMinClusterSize () const { return (min_pts_per_cluster_); }
#
# /** \brief Set the maximum number of points that a cluster needs to contain in order to be considered valid.
# * \param[in] max_cluster_size the maximum cluster size
# */
# inline void setMaxClusterSize (int max_cluster_size) { max_pts_per_cluster_ = max_cluster_size; }
#
# /** \brief Get the maximum number of points that a cluster needs to contain in order to be considered valid. */
# inline int getMaxClusterSize () const { return (max_pts_per_cluster_); }
#
# /** \brief Set the maximum number of labels in the cloud.
# * \param[in] max_label the maximum
# */
# inline void setMaxLabels (unsigned int max_label) { max_label_ = max_label; }
#
# /** \brief Get the maximum number of labels */
# inline unsigned int getMaxLabels () const { return (max_label_); }
#
# /** \brief Cluster extraction in a PointCloud given by <setInputCloud (), setIndices ()>
# * \param[out] labeled_clusters the resultant point clusters
# */
# void extract (std::vector<std::vector<PointIndices> > &labeled_clusters);
#
# protected:
# // Members derived from the base class
# using BasePCLBase::input_;
# using BasePCLBase::indices_;
# using BasePCLBase::initCompute;
# using BasePCLBase::deinitCompute;
#
# /** \brief A pointer to the spatial search object. */
# KdTreePtr tree_;
# /** \brief The spatial cluster tolerance as a measure in the L2 Euclidean space. */
# double cluster_tolerance_;
# /** \brief The minimum number of points that a cluster needs to contain in order to be considered valid (default = 1). */
# int min_pts_per_cluster_;
# /** \brief The maximum number of points that a cluster needs to contain in order to be considered valid (default = MAXINT). */
# int max_pts_per_cluster_;
# /** \brief The maximum number of labels we can find in this pointcloud (default = MAXINT)*/
# unsigned int max_label_;
# /** \brief Class getName method. */
# virtual std::string getClassName () const { return ("LabeledEuclideanClusterExtraction"); }
#
# brief Sort clusters method (for std::sort).
# ingroup segmentation
# inline bool compareLabeledPointClusters (const pcl::PointIndices &a, const pcl::PointIndices &b)
# {
# return (a.indices.size () < b.indices.size ());
# }
###
# extract_polygonal_prism_data.h
# namespace pcl
# /** \brief General purpose method for checking if a 3D point is inside or
# * outside a given 2D polygon.
# * \note this method accepts any general 3D point that is projected onto the
# * 2D polygon, but performs an internal XY projection of both the polygon and the point.
# * \param point a 3D point projected onto the same plane as the polygon
# * \param polygon a polygon
# * \ingroup segmentation
# */
# template <typename PointT> bool isPointIn2DPolygon (const PointT &point, const pcl::PointCloud<PointT> &polygon);
###
# extract_polygonal_prism_data.h
# namespace pcl
# /** \brief Check if a 2d point (X and Y coordinates considered only!) is
# * inside or outside a given polygon. This method assumes that both the point
# * and the polygon are projected onto the XY plane.
# *
# * \note (This is highly optimized code taken from http://www.visibone.com/inpoly/)
# * Copyright (c) 1995-1996 Galacticomm, Inc. Freeware source code.
# * \param point a 3D point projected onto the same plane as the polygon
# * \param polygon a polygon
# * \ingroup segmentation
# */
# template <typename PointT> bool
# isXYPointIn2DXYPolygon (const PointT &point, const pcl::PointCloud<PointT> &polygon);
###
# extract_polygonal_prism_data.h
# namespace pcl
# /** \brief @b ExtractPolygonalPrismData uses a set of point indices that
# * represent a planar model, and together with a given height, generates a 3D
# * polygonal prism. The polygonal prism is then used to segment all points
# * lying inside it.
# * An example of its usage is to extract the data lying within a set of 3D
# * boundaries (e.g., objects supported by a plane).
# * \author Radu Bogdan Rusu
# * \ingroup segmentation
# */
# template <typename PointT>
# class ExtractPolygonalPrismData : public PCLBase<PointT>
cdef extern from "pcl/segmentation/extract_polygonal_prism_data.h" namespace "pcl":
cdef cppclass ExtractPolygonalPrismData[T](PCLBase[T]):
ExtractPolygonalPrismData()
# public:
# typedef pcl::PointCloud<PointT> PointCloud;
# typedef typename PointCloud::Ptr PointCloudPtr;
# typedef typename PointCloud::ConstPtr PointCloudConstPtr;
# typedef PointIndices::Ptr PointIndicesPtr;
# typedef PointIndices::ConstPtr PointIndicesConstPtr;
#
# brief Empty constructor.
# ExtractPolygonalPrismData () : planar_hull_ (), min_pts_hull_ (3),
# height_limit_min_ (0), height_limit_max_ (FLT_MAX),
# vpx_ (0), vpy_ (0), vpz_ (0)
# {};
#
# brief Provide a pointer to the input planar hull dataset.
# param[in] hull the input planar hull dataset
# inline void setInputPlanarHull (const PointCloudConstPtr &hull) { planar_hull_ = hull; }
#
# brief Get a pointer the input planar hull dataset.
# inline PointCloudConstPtr getInputPlanarHull () const { return (planar_hull_); }
#
# brief Set the height limits. All points having distances to the
# model outside this interval will be discarded.
# param[in] height_min the minimum allowed distance to the plane model value
# param[in] height_max the maximum allowed distance to the plane model value
# inline void setHeightLimits (double height_min, double height_max)
#
# brief Get the height limits (min/max) as set by the user. The
# default values are -FLT_MAX, FLT_MAX.
# param[out] height_min the resultant min height limit
# param[out] height_max the resultant max height limit
# inline void getHeightLimits (double &height_min, double &height_max) const
#
# brief Set the viewpoint.
# param[in] vpx the X coordinate of the viewpoint
# param[in] vpy the Y coordinate of the viewpoint
# param[in] vpz the Z coordinate of the viewpoint
# inline void setViewPoint (float vpx, float vpy, float vpz)
#
# brief Get the viewpoint.
# inline void getViewPoint (float &vpx, float &vpy, float &vpz) const
#
# /** \brief Cluster extraction in a PointCloud given by <setInputCloud (), setIndices ()>
# * \param[out] output the resultant point indices that support the model found (inliers)
# void segment (PointIndices &output);
#
# protected:
# brief A pointer to the input planar hull dataset.
# PointCloudConstPtr planar_hull_;
#
# brief The minimum number of points needed on the convex hull.
# int min_pts_hull_;
#
# brief The minimum allowed height (distance to the model) a point
# will be considered from.
# double height_limit_min_;
#
# brief The maximum allowed height (distance to the model) a point will be considered from.
# double height_limit_max_;
#
# brief Values describing the data acquisition viewpoint. Default: 0,0,0.
# float vpx_, vpy_, vpz_;
#
# brief Class getName method.
# virtual std::string getClassName () const { return ("ExtractPolygonalPrismData"); }
###
# organized_connected_component_segmentation.h
# namespace pcl
# /** \brief OrganizedConnectedComponentSegmentation allows connected
# * components to be found within organized point cloud data, given a
# * comparison function. Given an input cloud and a comparator, it will
# * output a PointCloud of labels, giving each connected component a unique
# * id, along with a vector of PointIndices corresponding to each component.
# * See OrganizedMultiPlaneSegmentation for an example application.
# *
# * \author Alex Trevor, Suat Gedikli
# */
# template <typename PointT, typename PointLT>
# class OrganizedConnectedComponentSegmentation : public PCLBase<PointT>
# using PCLBase<PointT>::input_;
# using PCLBase<PointT>::indices_;
# using PCLBase<PointT>::initCompute;
# using PCLBase<PointT>::deinitCompute;
#
# public:
# typedef typename pcl::PointCloud<PointT> PointCloud;
# typedef typename PointCloud::Ptr PointCloudPtr;
# typedef typename PointCloud::ConstPtr PointCloudConstPtr;
#
# typedef typename pcl::PointCloud<PointLT> PointCloudL;
# typedef typename PointCloudL::Ptr PointCloudLPtr;
# typedef typename PointCloudL::ConstPtr PointCloudLConstPtr;
#
# typedef typename pcl::Comparator<PointT> Comparator;
# typedef typename Comparator::Ptr ComparatorPtr;
# typedef typename Comparator::ConstPtr ComparatorConstPtr;
#
# /** \brief Constructor for OrganizedConnectedComponentSegmentation
# * \param[in] compare A pointer to the comparator to be used for segmentation. Must be an instance of pcl::Comparator.
# */
# OrganizedConnectedComponentSegmentation (const ComparatorConstPtr& compare)
# : compare_ (compare)
# {
# }
#
# /** \brief Destructor for OrganizedConnectedComponentSegmentation. */
# virtual
# ~OrganizedConnectedComponentSegmentation ()
# {
# }
#
# /** \brief Provide a pointer to the comparator to be used for segmentation.
# * \param[in] compare the comparator
# */
# void
# setComparator (const ComparatorConstPtr& compare)
# {
# compare_ = compare;
# }
#
# /** \brief Get the comparator.*/
# ComparatorConstPtr
# getComparator () const { return (compare_); }
#
# /** \brief Perform the connected component segmentation.
# * \param[out] labels a PointCloud of labels: each connected component will have a unique id.
# * \param[out] label_indices a vector of PointIndices corresponding to each label / component id.
# */
# void
# segment (pcl::PointCloud<PointLT>& labels, std::vector<pcl::PointIndices>& label_indices) const;
#
# /** \brief Find the boundary points / contour of a connected component
# * \param[in] start_idx the first (lowest) index of the connected component for which a boundary shoudl be returned
# * \param[in] labels the Label cloud produced by segmentation
# * \param[out] boundary_indices the indices of the boundary points for the label corresponding to start_idx
# */
# static void
# findLabeledRegionBoundary (int start_idx, PointCloudLPtr labels, pcl::PointIndices& boundary_indices);
#
#
# protected:
# ComparatorConstPtr compare_;
#
# inline unsigned
# findRoot (const std::vector<unsigned>& runs, unsigned index) const
# {
# register unsigned idx = index;
# while (runs[idx] != idx)
# idx = runs[idx];
#
# return (idx);
# }
###
# organized_multi_plane_segmentation.h
# namespace pcl
# /** \brief OrganizedMultiPlaneSegmentation finds all planes present in the
# * input cloud, and outputs a vector of plane equations, as well as a vector
# * of point clouds corresponding to the inliers of each detected plane. Only
# * planes with more than min_inliers points are detected.
# * Templated on point type, normal type, and label type
# *
# * \author Alex Trevor, Suat Gedikli
# */
# template<typename PointT, typename PointNT, typename PointLT>
# class OrganizedMultiPlaneSegmentation : public PCLBase<PointT>
# using PCLBase<PointT>::input_;
# using PCLBase<PointT>::indices_;
# using PCLBase<PointT>::initCompute;
# using PCLBase<PointT>::deinitCompute;
#
# public:
# typedef pcl::PointCloud<PointT> PointCloud;
# typedef typename PointCloud::Ptr PointCloudPtr;
# typedef typename PointCloud::ConstPtr PointCloudConstPtr;
#
# typedef typename pcl::PointCloud<PointNT> PointCloudN;
# typedef typename PointCloudN::Ptr PointCloudNPtr;
# typedef typename PointCloudN::ConstPtr PointCloudNConstPtr;
#
# typedef typename pcl::PointCloud<PointLT> PointCloudL;
# typedef typename PointCloudL::Ptr PointCloudLPtr;
# typedef typename PointCloudL::ConstPtr PointCloudLConstPtr;
#
# typedef typename pcl::PlaneCoefficientComparator<PointT, PointNT> PlaneComparator;
# typedef typename PlaneComparator::Ptr PlaneComparatorPtr;
# typedef typename PlaneComparator::ConstPtr PlaneComparatorConstPtr;
#
# typedef typename pcl::PlaneRefinementComparator<PointT, PointNT, PointLT> PlaneRefinementComparator;
# typedef typename PlaneRefinementComparator::Ptr PlaneRefinementComparatorPtr;
# typedef typename PlaneRefinementComparator::ConstPtr PlaneRefinementComparatorConstPtr;
#
# /** \brief Constructor for OrganizedMultiPlaneSegmentation. */
# OrganizedMultiPlaneSegmentation () :
# normals_ (),
# min_inliers_ (1000),
# angular_threshold_ (pcl::deg2rad (3.0)),
# distance_threshold_ (0.02),
# maximum_curvature_ (0.001),
# project_points_ (false),
# compare_ (new PlaneComparator ()), refinement_compare_ (new PlaneRefinementComparator ())
# {
# }
#
# /** \brief Destructor for OrganizedMultiPlaneSegmentation. */
# virtual
# ~OrganizedMultiPlaneSegmentation ()
# {
# }
#
# /** \brief Provide a pointer to the input normals.
# * \param[in] normals the input normal cloud
# */
# inline void
# setInputNormals (const PointCloudNConstPtr &normals)
# {
# normals_ = normals;
# }
#
# /** \brief Get the input normals. */
# inline PointCloudNConstPtr
# getInputNormals () const
# {
# return (normals_);
# }
#
# /** \brief Set the minimum number of inliers required for a plane
# * \param[in] min_inliers the minimum number of inliers required per plane
# */
# inline void
# setMinInliers (unsigned min_inliers)
# {
# min_inliers_ = min_inliers;
# }
#
# /** \brief Get the minimum number of inliers required per plane. */
# inline unsigned
# getMinInliers () const
# {
# return (min_inliers_);
# }
#
# /** \brief Set the tolerance in radians for difference in normal direction between neighboring points, to be considered part of the same plane.
# * \param[in] angular_threshold the tolerance in radians
# */
# inline void
# setAngularThreshold (double angular_threshold)
# {
# angular_threshold_ = angular_threshold;
# }
#
# /** \brief Get the angular threshold in radians for difference in normal direction between neighboring points, to be considered part of the same plane. */
# inline double
# getAngularThreshold () const
# {
# return (angular_threshold_);
# }
#
# /** \brief Set the tolerance in meters for difference in perpendicular distance (d component of plane equation) to the plane between neighboring points, to be considered part of the same plane.
# * \param[in] distance_threshold the tolerance in meters
# */
# inline void
# setDistanceThreshold (double distance_threshold)
# {
# distance_threshold_ = distance_threshold;
# }
#
# /** \brief Get the distance threshold in meters (d component of plane equation) between neighboring points, to be considered part of the same plane. */
# inline double
# getDistanceThreshold () const
# {
# return (distance_threshold_);
# }
#
# /** \brief Set the maximum curvature allowed for a planar region.
# * \param[in] maximum_curvature the maximum curvature
# */
# inline void
# setMaximumCurvature (double maximum_curvature)
# {
# maximum_curvature_ = maximum_curvature;
# }
#
# /** \brief Get the maximum curvature allowed for a planar region. */
# inline double
# getMaximumCurvature () const
# {
# return (maximum_curvature_);
# }
#
# /** \brief Provide a pointer to the comparator to be used for segmentation.
# * \param[in] compare A pointer to the comparator to be used for segmentation.
# */
# void
# setComparator (const PlaneComparatorPtr& compare)
# {
# compare_ = compare;
# }
#
# /** \brief Provide a pointer to the comparator to be used for refinement.
# * \param[in] compare A pointer to the comparator to be used for refinement.
# */
# void
# setRefinementComparator (const PlaneRefinementComparatorPtr& compare)
# {
# refinement_compare_ = compare;
# }
#
# /** \brief Set whether or not to project boundary points to the plane, or leave them in the original 3D space.
# * \param[in] project_points true if points should be projected, false if not.
# */
# void
# setProjectPoints (bool project_points)
# {
# project_points_ = project_points;
# }
#
# /** \brief Segmentation of all planes in a point cloud given by setInputCloud(), setIndices()
# * \param[out] model_coefficients a vector of model_coefficients for each plane found in the input cloud
# * \param[out] inlier_indices a vector of inliers for each detected plane
# * \param[out] centroids a vector of centroids for each plane
# * \param[out] covariances a vector of covariance matricies for the inliers of each plane
# * \param[out] labels a point cloud for the connected component labels of each pixel
# * \param[out] label_indices a vector of PointIndices for each labeled component
# */
# void
# segment (std::vector<ModelCoefficients>& model_coefficients,
# std::vector<PointIndices>& inlier_indices,
# std::vector<Eigen::Vector4f, Eigen::aligned_allocator<Eigen::Vector4f> >& centroids,
# std::vector <Eigen::Matrix3f, Eigen::aligned_allocator<Eigen::Matrix3f> >& covariances,
# pcl::PointCloud<PointLT>& labels,
# std::vector<pcl::PointIndices>& label_indices);
#
# /** \brief Segmentation of all planes in a point cloud given by setInputCloud(), setIndices()
# * \param[out] model_coefficients a vector of model_coefficients for each plane found in the input cloud
# * \param[out] inlier_indices a vector of inliers for each detected plane
# */
# void
# segment (std::vector<ModelCoefficients>& model_coefficients,
# std::vector<PointIndices>& inlier_indices);
#
# /** \brief Segmentation of all planes in a point cloud given by setInputCloud(), setIndices()
# * \param[out] regions a list of resultant planar polygonal regions
# */
# void
# segment (std::vector<PlanarRegion<PointT>, Eigen::aligned_allocator<PlanarRegion<PointT> > >& regions);
#
# /** \brief Perform a segmentation, as well as an additional refinement step. This helps with including points whose normals may not match neighboring points well, but may match the planar model well.
# * \param[out] regions A list of regions generated by segmentation and refinement.
# */
# void
# segmentAndRefine (std::vector<PlanarRegion<PointT>, Eigen::aligned_allocator<PlanarRegion<PointT> > >& regions);
#
# /** \brief Perform a segmentation, as well as additional refinement step. Returns intermediate data structures for use in
# * subsequent processing.
# * \param[out] regions A vector of PlanarRegions generated by segmentation
# * \param[out] model_coefficients A vector of model coefficients for each segmented plane
# * \param[out] inlier_indices A vector of PointIndices, indicating the inliers to each segmented plane
# * \param[out] labels A PointCloud<PointLT> corresponding to the resulting segmentation.
# * \param[out] label_indices A vector of PointIndices for each label
# * \param[out] boundary_indices A vector of PointIndices corresponding to the outer boundary / contour of each label
# */
# void
# segmentAndRefine (std::vector<PlanarRegion<PointT>, Eigen::aligned_allocator<PlanarRegion<PointT> > >& regions,
# std::vector<ModelCoefficients>& model_coefficients,
# std::vector<PointIndices>& inlier_indices,
# PointCloudLPtr& labels,
# std::vector<pcl::PointIndices>& label_indices,
# std::vector<pcl::PointIndices>& boundary_indices);
#
# /** \brief Perform a refinement of an initial segmentation, by comparing points to adjacent regions detected by the initial segmentation.
# * \param [in] model_coefficients The list of segmented model coefficients
# * \param [in] inlier_indices The list of segmented inlier indices, corresponding to each model
# * \param [in] centroids The list of centroids corresponding to each segmented plane
# * \param [in] covariances The list of covariances corresponding to each segemented plane
# * \param [in] labels The labels produced by the initial segmentation
# * \param [in] label_indices The list of indices corresponding to each label
# */
# void
# refine (std::vector<ModelCoefficients>& model_coefficients,
# std::vector<PointIndices>& inlier_indices,
# std::vector<Eigen::Vector4f, Eigen::aligned_allocator<Eigen::Vector4f> >& centroids,
# std::vector <Eigen::Matrix3f, Eigen::aligned_allocator<Eigen::Matrix3f> >& covariances,
# PointCloudLPtr& labels,
# std::vector<pcl::PointIndices>& label_indices);
###
# planar_polygon_fusion.h
# namespace pcl
# /** \brief PlanarPolygonFusion takes a list of 2D planar polygons and
# * attempts to reduce them to a minimum set that best represents the scene,
# * based on various given comparators.
# */
# template <typename PointT>
# class PlanarPolygonFusion
# public:
# /** \brief Constructor */
# PlanarPolygonFusion () : regions_ () {}
#
# /** \brief Destructor */
# virtual ~PlanarPolygonFusion () {}
#
# /** \brief Reset the state (clean the list of planar models). */
# void
# reset ()
# {
# regions_.clear ();
# }
#
# /** \brief Set the list of 2D planar polygons to refine.
# * \param[in] input the list of 2D planar polygons to refine
# */
# void
# addInputPolygons (const std::vector<PlanarRegion<PointT>, Eigen::aligned_allocator<PlanarRegion<PointT> > > &input)
# {
# int start = static_cast<int> (regions_.size ());
# regions_.resize (regions_.size () + input.size ());
# for(size_t i = 0; i < input.size (); i++)
# regions_[start+i] = input[i];
# }
###
# planar_region.h
# namespace pcl
# /** \brief PlanarRegion represents a set of points that lie in a plane. Inherits summary statistics about these points from Region3D, and summary statistics of a 3D collection of points.
# * \author Alex Trevor
# */
# template <typename PointT>
# class PlanarRegion : public pcl::Region3D<PointT>, public pcl::PlanarPolygon<PointT>
# protected:
# using Region3D<PointT>::centroid_;
# using Region3D<PointT>::covariance_;
# using Region3D<PointT>::count_;
# using PlanarPolygon<PointT>::contour_;
# using PlanarPolygon<PointT>::coefficients_;
#
# public:
# /** \brief Empty constructor for PlanarRegion. */
# PlanarRegion () : contour_labels_ ()
# {}
#
# /** \brief Constructor for Planar region from a Region3D and a PlanarPolygon.
# * \param[in] region a Region3D for the input data
# * \param[in] polygon a PlanarPolygon for the input region
# */
# PlanarRegion (const pcl::Region3D<PointT>& region, const pcl::PlanarPolygon<PointT>& polygon) :
# contour_labels_ ()
# {
# centroid_ = region.centroid;
# covariance_ = region.covariance;
# count_ = region.count;
# contour_ = polygon.contour;
# coefficients_ = polygon.coefficients;
# }
#
# /** \brief Destructor. */
# virtual ~PlanarRegion () {}
#
# /** \brief Constructor for PlanarRegion.
# * \param[in] centroid the centroid of the region.
# * \param[in] covariance the covariance of the region.
# * \param[in] count the number of points in the region.
# * \param[in] contour the contour / boudnary for the region
# * \param[in] coefficients the model coefficients (a,b,c,d) for the plane
# */
# PlanarRegion (const Eigen::Vector3f& centroid, const Eigen::Matrix3f& covariance, unsigned count,
# const typename pcl::PointCloud<PointT>::VectorType& contour,
# const Eigen::Vector4f& coefficients) :
# contour_labels_ ()
# {
# centroid_ = centroid;
# covariance_ = covariance;
# count_ = count;
# contour_ = contour;
# coefficients_ = coefficients;
# }
###
# plane_refinement_comparator.h
# namespace pcl
# /** \brief PlaneRefinementComparator is a Comparator that operates on plane coefficients,
# * for use in planar segmentation.
# * In conjunction with OrganizedConnectedComponentSegmentation, this allows planes to be segmented from organized data.
# *
# * \author Alex Trevor, Suat Gedikli
# */
# template<typename PointT, typename PointNT, typename PointLT>
# class PlaneRefinementComparator: public PlaneCoefficientComparator<PointT, PointNT>
# public:
# typedef typename Comparator<PointT>::PointCloud PointCloud;
# typedef typename Comparator<PointT>::PointCloudConstPtr PointCloudConstPtr;
# typedef typename pcl::PointCloud<PointNT> PointCloudN;
# typedef typename PointCloudN::Ptr PointCloudNPtr;
# typedef typename PointCloudN::ConstPtr PointCloudNConstPtr;
# typedef typename pcl::PointCloud<PointLT> PointCloudL;
# typedef typename PointCloudL::Ptr PointCloudLPtr;
# typedef typename PointCloudL::ConstPtr PointCloudLConstPtr;
# typedef boost::shared_ptr<PlaneRefinementComparator<PointT, PointNT, PointLT> > Ptr;
# typedef boost::shared_ptr<const PlaneRefinementComparator<PointT, PointNT, PointLT> > ConstPtr;
# using pcl::PlaneCoefficientComparator<PointT, PointNT>::input_;
# using pcl::PlaneCoefficientComparator<PointT, PointNT>::normals_;
# using pcl::PlaneCoefficientComparator<PointT, PointNT>::distance_threshold_;
# using pcl::PlaneCoefficientComparator<PointT, PointNT>::plane_coeff_d_;
#
# /** \brief Empty constructor for PlaneCoefficientComparator. */
# PlaneRefinementComparator ()
# : models_ ()
# , labels_ ()
# , refine_labels_ ()
# , label_to_model_ ()
# , depth_dependent_ (false)
#
# /** \brief Empty constructor for PlaneCoefficientComparator.
# * \param[in] models
# * \param[in] refine_labels
# */
# PlaneRefinementComparator (boost::shared_ptr<std::vector<pcl::ModelCoefficients> >& models,
# boost::shared_ptr<std::vector<bool> >& refine_labels)
# : models_ (models)
# , labels_ ()
# , refine_labels_ (refine_labels)
# , label_to_model_ ()
# , depth_dependent_ (false)
#
# /** \brief Destructor for PlaneCoefficientComparator. */
# virtual
# ~PlaneRefinementComparator ()
#
# /** \brief Set the vector of model coefficients to which we will compare.
# * \param[in] models a vector of model coefficients produced by the initial segmentation step.
# */
# void setModelCoefficients (boost::shared_ptr<std::vector<pcl::ModelCoefficients> >& models)
#
# /** \brief Set the vector of model coefficients to which we will compare.
# * \param[in] models a vector of model coefficients produced by the initial segmentation step.
# */
# void setModelCoefficients (std::vector<pcl::ModelCoefficients>& models)
#
# /** \brief Set which labels should be refined. This is a vector of bools 0-max_label, true if the label should be refined.
# * \param[in] refine_labels A vector of bools 0-max_label, true if the label should be refined.
# */
# void setRefineLabels (boost::shared_ptr<std::vector<bool> >& refine_labels)
#
# /** \brief Set which labels should be refined. This is a vector of bools 0-max_label, true if the label should be refined.
# * \param[in] refine_labels A vector of bools 0-max_label, true if the label should be refined.
# */
# void setRefineLabels (std::vector<bool>& refine_labels)
#
# /** \brief A mapping from label to index in the vector of models, allowing the model coefficients of a label to be accessed.
# * \param[in] label_to_model A vector of size max_label, with the index of each corresponding model in models
# */
# inline void setLabelToModel (boost::shared_ptr<std::vector<int> >& label_to_model)
#
# /** \brief A mapping from label to index in the vector of models, allowing the model coefficients of a label to be accessed.
# * \param[in] label_to_model A vector of size max_label, with the index of each corresponding model in models
# */
# inline void setLabelToModel (std::vector<int>& label_to_model)
#
# /** \brief Get the vector of model coefficients to which we will compare. */
# inline boost::shared_ptr<std::vector<pcl::ModelCoefficients> > getModelCoefficients () const
#
# /** \brief ...
# * \param[in] labels
# */
# inline void setLabels (PointCloudLPtr& labels)
#
# /** \brief Compare two neighboring points
# * \param[in] idx1 The index of the first point.
# * \param[in] idx2 The index of the second point.
# */
# virtual bool compare (int idx1, int idx2) const
###
# region_3d.h
# namespace pcl
# /** \brief Region3D represents summary statistics of a 3D collection of points.
# * \author Alex Trevor
# */
# template <typename PointT>
# class Region3D
# public:
# /** \brief Empty constructor for Region3D. */
# Region3D () : centroid_ (Eigen::Vector3f::Zero ()), covariance_ (Eigen::Matrix3f::Identity ()), count_ (0)
# {
# }
#
# /** \brief Constructor for Region3D.
# * \param[in] centroid The centroid of the region.
# * \param[in] covariance The covariance of the region.
# * \param[in] count The number of points in the region.
# */
# Region3D (Eigen::Vector3f& centroid, Eigen::Matrix3f& covariance, unsigned count)
# : centroid_ (centroid), covariance_ (covariance), count_ (count)
# {
# }
#
# /** \brief Destructor. */
# virtual ~Region3D () {}
#
# /** \brief Get the centroid of the region. */
# inline Eigen::Vector3f getCentroid () const
#
# /** \brief Get the covariance of the region. */
# inline Eigen::Matrix3f getCovariance () const
#
# /** \brief Get the number of points in the region. */
# unsigned getCount () const
###
# rgb_plane_coefficient_comparator.h
# namespace pcl
# /** \brief RGBPlaneCoefficientComparator is a Comparator that operates on plane coefficients,
# * for use in planar segmentation. Also takes into account RGB, so we can segmented different colored co-planar regions.
# * In conjunction with OrganizedConnectedComponentSegmentation, this allows planes to be segmented from organized data.
# * \author Alex Trevor
# */
# template<typename PointT, typename PointNT>
# class RGBPlaneCoefficientComparator: public PlaneCoefficientComparator<PointT, PointNT>
# public:
# typedef typename Comparator<PointT>::PointCloud PointCloud;
# typedef typename Comparator<PointT>::PointCloudConstPtr PointCloudConstPtr;
#
# typedef typename pcl::PointCloud<PointNT> PointCloudN;
# typedef typename PointCloudN::Ptr PointCloudNPtr;
# typedef typename PointCloudN::ConstPtr PointCloudNConstPtr;
#
# typedef boost::shared_ptr<RGBPlaneCoefficientComparator<PointT, PointNT> > Ptr;
# typedef boost::shared_ptr<const RGBPlaneCoefficientComparator<PointT, PointNT> > ConstPtr;
#
# using pcl::Comparator<PointT>::input_;
# using pcl::PlaneCoefficientComparator<PointT, PointNT>::normals_;
# using pcl::PlaneCoefficientComparator<PointT, PointNT>::angular_threshold_;
# using pcl::PlaneCoefficientComparator<PointT, PointNT>::distance_threshold_;
#
# /** \brief Empty constructor for RGBPlaneCoefficientComparator. */
# RGBPlaneCoefficientComparator ()
# : color_threshold_ (50.0f)
# {
# }
#
# /** \brief Constructor for RGBPlaneCoefficientComparator.
# * \param[in] plane_coeff_d a reference to a vector of d coefficients of plane equations. Must be the same size as the input cloud and input normals. a, b, and c coefficients are in the input normals.
# */
# RGBPlaneCoefficientComparator (boost::shared_ptr<std::vector<float> >& plane_coeff_d)
# : PlaneCoefficientComparator<PointT, PointNT> (plane_coeff_d), color_threshold_ (50.0f)
# {
# }
#
# /** \brief Destructor for RGBPlaneCoefficientComparator. */
# virtual
# ~RGBPlaneCoefficientComparator ()
# {
# }
#
# /** \brief Set the tolerance in color space between neighboring points, to be considered part of the same plane.
# * \param[in] color_threshold The distance in color space
# */
# inline void
# setColorThreshold (float color_threshold)
# {
# color_threshold_ = color_threshold * color_threshold;
# }
#
# /** \brief Get the color threshold between neighboring points, to be considered part of the same plane. */
# inline float
# getColorThreshold () const
# {
# return (color_threshold_);
# }
#
# /** \brief Compare two neighboring points, by using normal information, euclidean distance, and color information.
# * \param[in] idx1 The index of the first point.
# * \param[in] idx2 The index of the second point.
# */
# bool
# compare (int idx1, int idx2) const
# {
# float dx = input_->points[idx1].x - input_->points[idx2].x;
# float dy = input_->points[idx1].y - input_->points[idx2].y;
# float dz = input_->points[idx1].z - input_->points[idx2].z;
# float dist = sqrtf (dx*dx + dy*dy + dz*dz);
# int dr = input_->points[idx1].r - input_->points[idx2].r;
# int dg = input_->points[idx1].g - input_->points[idx2].g;
# int db = input_->points[idx1].b - input_->points[idx2].b;
# //Note: This is not the best metric for color comparisons, we should probably use HSV space.
# float color_dist = static_cast<float> (dr*dr + dg*dg + db*db);
# return ( (dist < distance_threshold_)
# && (normals_->points[idx1].getNormalVector3fMap ().dot (normals_->points[idx2].getNormalVector3fMap () ) > angular_threshold_ )
# && (color_dist < color_threshold_));
# }
###
# segment_differences.h
# namespace pcl
# /** \brief Obtain the difference between two aligned point clouds as another point cloud, given a distance threshold.
# * \param src the input point cloud source
# * \param tgt the input point cloud target we need to obtain the difference against
# * \param threshold the distance threshold (tolerance) for point correspondences. (e.g., check if f a point p1 from
# * src has a correspondence > threshold than a point p2 from tgt)
# * \param tree the spatial locator (e.g., kd-tree) used for nearest neighbors searching built over \a tgt
# * \param output the resultant output point cloud difference
# * \ingroup segmentation
# */
# template <typename PointT>
# void getPointCloudDifference (
# const pcl::PointCloud<PointT> &src, const pcl::PointCloud<PointT> &tgt,
# double threshold, const boost::shared_ptr<pcl::search::Search<PointT> > &tree,
# pcl::PointCloud<PointT> &output);
# segment_differences.h
# namespace pcl
# /** \brief @b SegmentDifferences obtains the difference between two spatially
# * aligned point clouds and returns the difference between them for a maximum
# * given distance threshold.
# * \author Radu Bogdan Rusu
# * \ingroup segmentation
# */
# template <typename PointT>
# class SegmentDifferences: public PCLBase<PointT>
# typedef PCLBase<PointT> BasePCLBase;
#
# public:
# typedef pcl::PointCloud<PointT> PointCloud;
# typedef typename PointCloud::Ptr PointCloudPtr;
# typedef typename PointCloud::ConstPtr PointCloudConstPtr;
#
# typedef typename pcl::search::Search<PointT> KdTree;
# typedef typename pcl::search::Search<PointT>::Ptr KdTreePtr;
#
# typedef PointIndices::Ptr PointIndicesPtr;
# typedef PointIndices::ConstPtr PointIndicesConstPtr;
#
# /** \brief Empty constructor. */
# SegmentDifferences ()
#
# /** \brief Provide a pointer to the target dataset against which we
# * compare the input cloud given in setInputCloud
# * \param cloud the target PointCloud dataset
# inline void setTargetCloud (const PointCloudConstPtr &cloud)
#
# /** \brief Get a pointer to the input target point cloud dataset. */
# inline PointCloudConstPtr const getTargetCloud ()
# /** \brief Provide a pointer to the search object.
# * \param tree a pointer to the spatial search object.
# inline void setSearchMethod (const KdTreePtr &tree)
# /** \brief Get a pointer to the search method used. */
# inline KdTreePtr getSearchMethod ()
# /** \brief Set the maximum distance tolerance (squared) between corresponding
# * points in the two input datasets.
# * \param sqr_threshold the squared distance tolerance as a measure in L2 Euclidean space
# inline void setDistanceThreshold (double sqr_threshold)
# /** \brief Get the squared distance tolerance between corresponding points as a
# * measure in the L2 Euclidean space.
# inline double getDistanceThreshold ()
#
# /** \brief Segment differences between two input point clouds.
# * \param output the resultant difference between the two point clouds as a PointCloud
# */
# void segment (PointCloud &output);
# protected:
# // Members derived from the base class
# using BasePCLBase::input_;
# using BasePCLBase::indices_;
# using BasePCLBase::initCompute;
# using BasePCLBase::deinitCompute;
# /** \brief A pointer to the spatial search object. */
# KdTreePtr tree_;
# /** \brief The input target point cloud dataset. */
# PointCloudConstPtr target_;
# /** \brief The distance tolerance (squared) as a measure in the L2
# * Euclidean space between corresponding points.
# */
# double distance_threshold_;
# /** \brief Class getName method. */
# virtual std::string getClassName () const { return ("SegmentDifferences"); }
###
###############################################################################
# Enum
###############################################################################
###############################################################################
# Activation
###############################################################################
### pcl 1.7.2 ###
# approximate_progressive_morphological_filter.h
# namespace pcl
# /** \brief
# * Implements the Progressive Morphological Filter for segmentation of ground points.
# * Description can be found in the article
# * "A Progressive Morphological Filter for Removing Nonground Measurements from
# * Airborne LIDAR Data"
# * by K. Zhang, S. Chen, D. Whitman, M. Shyu, J. Yan, and C. Zhang.
# */
# template <typename PointT>
# class PCL_EXPORTS ApproximateProgressiveMorphologicalFilter : public pcl::PCLBase<PointT>
# public:
# typedef pcl::PointCloud <PointT> PointCloud;
# using PCLBase <PointT>::input_;
# using PCLBase <PointT>::indices_;
# using PCLBase <PointT>::initCompute;
# using PCLBase <PointT>::deinitCompute;
# public:
# /** \brief Constructor that sets default values for member variables. */
# ApproximateProgressiveMorphologicalFilter ();
#
# virtual ~ApproximateProgressiveMorphologicalFilter ();
#
# /** \brief Get the maximum window size to be used in filtering ground returns. */
# inline int getMaxWindowSize () const { return (max_window_size_); }
#
# /** \brief Set the maximum window size to be used in filtering ground returns. */
# inline void setMaxWindowSize (int max_window_size) { max_window_size_ = max_window_size; }
#
# /** \brief Get the slope value to be used in computing the height threshold. */
# inline float getSlope () const { return (slope_); }
#
# /** \brief Set the slope value to be used in computing the height threshold. */
# inline void setSlope (float slope) { slope_ = slope; }
#
# /** \brief Get the maximum height above the parameterized ground surface to be considered a ground return. */
# inline float getMaxDistance () const { return (max_distance_); }
#
# /** \brief Set the maximum height above the parameterized ground surface to be considered a ground return. */
# inline void setMaxDistance (float max_distance) { max_distance_ = max_distance; }
#
# /** \brief Get the initial height above the parameterized ground surface to be considered a ground return. */
# inline float getInitialDistance () const { return (initial_distance_); }
#
# /** \brief Set the initial height above the parameterized ground surface to be considered a ground return. */
# inline void setInitialDistance (float initial_distance) { initial_distance_ = initial_distance; }
#
# /** \brief Get the cell size. */
# inline float getCellSize () const { return (cell_size_); }
#
# /** \brief Set the cell size. */
# inline void setCellSize (float cell_size) { cell_size_ = cell_size; }
#
# /** \brief Get the base to be used in computing progressive window sizes. */
# inline float getBase () const { return (base_); }
#
# /** \brief Set the base to be used in computing progressive window sizes. */
# inline void setBase (float base) { base_ = base; }
#
# /** \brief Get flag indicating whether or not to exponentially grow window sizes? */
# inline bool getExponential () const { return (exponential_); }
#
# /** \brief Set flag indicating whether or not to exponentially grow window sizes? */
# inline void setExponential (bool exponential) { exponential_ = exponential; }
#
# /** \brief Initialize the scheduler and set the number of threads to use.
# * \param nr_threads the number of hardware threads to use (0 sets the value back to automatic)
# */
# inline void setNumberOfThreads (unsigned int nr_threads = 0) { threads_ = nr_threads; }
#
# /** \brief This method launches the segmentation algorithm and returns indices of
# * points determined to be ground returns.
# * \param[out] ground indices of points determined to be ground returns.
# */
# virtual void extract (std::vector<int>& ground);
###
# boost.h
###
# conditional_euclidean_clustering.h
# namespace pcl
# typedef std::vector<pcl::PointIndices> IndicesClusters;
# typedef boost::shared_ptr<std::vector<pcl::PointIndices> > IndicesClustersPtr;
#
# /** \brief @b ConditionalEuclideanClustering performs segmentation based on Euclidean distance and a user-defined clustering condition.
# * \details The condition that need to hold is currently passed using a function pointer.
# * For more information check the documentation of setConditionFunction() or the usage example below:
# * \code
# * bool
# * enforceIntensitySimilarity (const pcl::PointXYZI& point_a, const pcl::PointXYZI& point_b, float squared_distance)
# * {
# * if (fabs (point_a.intensity - point_b.intensity) < 0.1f)
# * return (true);
# * else
# * return (false);
# * }
# * // ...
# * // Somewhere down to the main code
# * // ...
# * pcl::ConditionalEuclideanClustering<pcl::PointXYZI> cec (true);
# * cec.setInputCloud (cloud_in);
# * cec.setConditionFunction (&enforceIntensitySimilarity);
# * // Points within this distance from one another are going to need to validate the enforceIntensitySimilarity function to be part of the same cluster:
# * cec.setClusterTolerance (0.09f);
# * // Size constraints for the clusters:
# * cec.setMinClusterSize (5);
# * cec.setMaxClusterSize (30);
# * // The resulting clusters (an array of pointindices):
# * cec.segment (*clusters);
# * // The clusters that are too small or too large in size can also be extracted separately:
# * cec.getRemovedClusters (small_clusters, large_clusters);
# * \endcode
# * \author Frits Florentinus
# * \ingroup segmentation
# */
# template<typename PointT>
# class ConditionalEuclideanClustering : public PCLBase<PointT>
# protected:
# typedef typename pcl::search::Search<PointT>::Ptr SearcherPtr;
# using PCLBase<PointT>::input_;
# using PCLBase<PointT>::indices_;
# using PCLBase<PointT>::initCompute;
# using PCLBase<PointT>::deinitCompute;
#
# public:
# /** \brief Constructor.
# * \param[in] extract_removed_clusters Set to true if you want to be able to extract the clusters that are too large or too small (default = false)
# */
# ConditionalEuclideanClustering (bool extract_removed_clusters = false) :
# searcher_ (),
# condition_function_ (),
# cluster_tolerance_ (0.0f),
# min_cluster_size_ (1),
# max_cluster_size_ (std::numeric_limits<int>::max ()),
# extract_removed_clusters_ (extract_removed_clusters),
# small_clusters_ (new pcl::IndicesClusters),
# large_clusters_ (new pcl::IndicesClusters)
#
#
# /** \brief Set the condition that needs to hold for neighboring points to be considered part of the same cluster.
# * \details Any two points within a certain distance from one another will need to evaluate this condition in order to be made part of the same cluster.
# * The distance can be set using setClusterTolerance().
# * <br>
# * Note that for a point to be part of a cluster, the condition only needs to hold for at least 1 point pair.
# * To clarify, the following statement is false:
# * Any two points within a cluster always evaluate this condition function to true.
# * <br><br>
# * The input arguments of the condition function are:
# * <ul>
# * <li>PointT The first point of the point pair</li>
# * <li>PointT The second point of the point pair</li>
# * <li>float The squared distance between the points</li>
# * </ul>
# * The output argument is a boolean, returning true will merge the second point into the cluster of the first point.
# * \param[in] condition_function The condition function that needs to hold for clustering
# */
# inline void setConditionFunction (bool (*condition_function) (const PointT&, const PointT&, float))
#
# /** \brief Set the spatial tolerance for new cluster candidates.
# * \details Any two points within this distance from one another will need to evaluate a certain condition in order to be made part of the same cluster.
# * The condition can be set using setConditionFunction().
# * \param[in] cluster_tolerance The distance to scan for cluster candidates (default = 0.0)
# */
# inline void setClusterTolerance (float cluster_tolerance)
#
# /** \brief Get the spatial tolerance for new cluster candidates.*/
# inline float getClusterTolerance ()
#
# /** \brief Set the minimum number of points that a cluster needs to contain in order to be considered valid.
# * \param[in] min_cluster_size The minimum cluster size (default = 1)
# */
# inline void setMinClusterSize (int min_cluster_size)
#
# /** \brief Get the minimum number of points that a cluster needs to contain in order to be considered valid.*/
# inline int getMinClusterSize ()
#
# /** \brief Set the maximum number of points that a cluster needs to contain in order to be considered valid.
# * \param[in] max_cluster_size The maximum cluster size (default = unlimited)
# */
# inline void setMaxClusterSize (int max_cluster_size)
#
# /** \brief Get the maximum number of points that a cluster needs to contain in order to be considered valid.*/
# inline int getMaxClusterSize ()
#
# /** \brief Segment the input into separate clusters.
# * \details The input can be set using setInputCloud() and setIndices().
# * <br>
# * The size constraints for the resulting clusters can be set using setMinClusterSize() and setMaxClusterSize().
# * <br>
# * The region growing parameters can be set using setConditionFunction() and setClusterTolerance().
# * <br>
# * \param[out] clusters The resultant set of indices, indexing the points of the input cloud that correspond to the clusters
# */
# void segment (IndicesClusters &clusters);
#
# /** \brief Get the clusters that are invalidated due to size constraints.
# * \note The constructor of this class needs to be initialized with true, and the segment method needs to have been called prior to using this method.
# * \param[out] small_clusters The resultant clusters that contain less than min_cluster_size points
# * \param[out] large_clusters The resultant clusters that contain more than max_cluster_size points
# */
# inline void getRemovedClusters (IndicesClustersPtr &small_clusters, IndicesClustersPtr &large_clusters)
###
# crf_normal_segmentation.h
# namespace pcl
# /** \brief
# * \author Christian Potthast
# *
# */
# template <typename PointT>
# class PCL_EXPORTS CrfNormalSegmentation
# public:
#
# /** \brief Constructor that sets default values for member variables. */
# CrfNormalSegmentation ();
#
# /** \brief Destructor that frees memory. */
# ~CrfNormalSegmentation ();
#
# /** \brief This method sets the input cloud.
# * \param[in] input_cloud input point cloud
# */
# void setCloud (typename pcl::PointCloud<PointT>::Ptr input_cloud);
#
# /** \brief This method simply launches the segmentation algorithm */
# void segmentPoints ();
###
# grabcut_segmentation.h
# namespace pcl
# namespace segmentation
# namespace grabcut
# /** boost implementation of Boykov and Kolmogorov's maxflow algorithm doesn't support
# * negative flows which makes it inappropriate for this conext.
# * This implementation of Boykov and Kolmogorov's maxflow algorithm by Stephen Gould
# * <stephen.gould@anu.edu.au> in DARWIN under BSD does the trick however solwer than original
# * implementation.
# */
# class PCL_EXPORTS BoykovKolmogorov
# public:
# typedef int vertex_descriptor;
# typedef double edge_capacity_type;
#
# /// construct a maxflow/mincut problem with estimated max_nodes
# BoykovKolmogorov (std::size_t max_nodes = 0);
#
# /// destructor
# virtual ~BoykovKolmogorov () {}
#
# /// get number of nodes in the graph
# size_t numNodes () const { return nodes_.size (); }
#
# /// reset all edge capacities to zero (but don't free the graph)
# void reset ();
#
# /// clear the graph and internal datastructures
# void clear ();
#
# /// add nodes to the graph (returns the id of the first node added)
# int addNodes (std::size_t n = 1);
#
# /// add constant flow to graph
# void addConstant (double c) { flow_value_ += c; }
#
# /// add edge from s to nodeId
# void addSourceEdge (int u, double cap);
#
# /// add edge from nodeId to t
# void addTargetEdge (int u, double cap);
#
# /// add edge from u to v and edge from v to u
# /// (requires cap_uv + cap_vu >= 0)
# void addEdge (int u, int v, double cap_uv, double cap_vu = 0.0);
#
# /// solve the max-flow problem and return the flow
# double solve ();
#
# /// return true if \p u is in the s-set after calling \ref solve.
# bool inSourceTree (int u) const { return (cut_[u] == SOURCE); }
#
# /// return true if \p u is in the t-set after calling \ref solve
# bool inSinkTree (int u) const { return (cut_[u] == TARGET); }
#
# /// returns the residual capacity for an edge (use -1 for terminal (-1,-1) is the current flow
# double operator() (int u, int v) const;
#
# double getSourceEdgeCapacity (int u) const;
#
# double getTargetEdgeCapacity (int u) const;
###
# grabcut_segmentation.h
# namespace pcl
# namespace segmentation
# namespace grabcut
# /**\brief Structure to save RGB colors into floats */
# struct Color
# {
# Color () : r (0), g (0), b (0) {}
# Color (float _r, float _g, float _b) : r(_r), g(_g), b(_b) {}
# Color (const pcl::RGB& color) : r (color.r), g (color.g), b (color.b) {}
#
# template<typename PointT> Color (const PointT& p);
#
# template<typename PointT> operator PointT () const;
#
# float r, g, b;
# };
# grabcut_segmentation.h
# namespace pcl
# namespace segmentation
# namespace grabcut
# /// An Image is a point cloud of Color
# typedef pcl::PointCloud<Color> Image;
#
# /** \brief Compute squared distance between two colors
# * \param[in] c1 first color
# * \param[in] c2 second color
# * \return the squared distance measure in RGB space
# */
# float colorDistance (const Color& c1, const Color& c2);
#
# /// User supplied Trimap values
# enum TrimapValue { TrimapUnknown = -1, TrimapForeground, TrimapBackground };
#
# /// Grabcut derived hard segementation values
# enum SegmentationValue { SegmentationForeground = 0, SegmentationBackground };
#
# /// Gaussian structure
# struct Gaussian
# {
# Gaussian () {}
# /// mean of the gaussian
# Color mu;
# /// covariance matrix of the gaussian
# Eigen::Matrix3f covariance;
# /// determinant of the covariance matrix
# float determinant;
# /// inverse of the covariance matrix
# Eigen::Matrix3f inverse;
# /// weighting of this gaussian in the GMM.
# float pi;
# /// heighest eigenvalue of covariance matrix
# float eigenvalue;
# /// eigenvector corresponding to the heighest eigenvector
# Eigen::Vector3f eigenvector;
# };
###
# grabcut_segmentation.h
# namespace pcl
# namespace segmentation
# namespace grabcut
# class PCL_EXPORTS GMM
# public:
# /// Initialize GMM with ddesired number of gaussians.
# GMM () : gaussians_ (0) {}
# /// Initialize GMM with ddesired number of gaussians.
# GMM (std::size_t K) : gaussians_ (K) {}
# /// Destructor
# ~GMM () {}
#
# /// \return K
# std::size_t getK () const { return gaussians_.size (); }
#
# /// resize gaussians
# void resize (std::size_t K) { gaussians_.resize (K); }
#
# /// \return a reference to the gaussian at a given position
# Gaussian& operator[] (std::size_t pos) { return (gaussians_[pos]); }
#
# /// \return a const reference to the gaussian at a given position
# const Gaussian& operator[] (std::size_t pos) const { return (gaussians_[pos]); }
#
# /// \brief \return the computed probability density of a color in this GMM
# float probabilityDensity (const Color &c);
#
# /// \brief \return the computed probability density of a color in just one Gaussian
# float probabilityDensity(std::size_t i, const Color &c);
###
# grabcut_segmentation.h
# namespace pcl
# namespace segmentation
# namespace grabcut
# /** Helper class that fits a single Gaussian to color samples */
# class GaussianFitter
# public:
# GaussianFitter (float epsilon = 0.0001)
# : sum_ (Eigen::Vector3f::Zero ())
# , accumulator_ (Eigen::Matrix3f::Zero ())
# , count_ (0)
# , epsilon_ (epsilon)
# { }
#
# /// Add a color sample
# void add (const Color &c);
#
# /// Build the gaussian out of all the added color samples
# void fit (Gaussian& g, std::size_t total_count, bool compute_eigens = false) const;
#
# /// \return epsilon
# float getEpsilon () { return (epsilon_); }
#
# /** set epsilon which will be added to the covariance matrix diagonal which avoids singular
# * covariance matrix
# * \param[in] epsilon user defined epsilon
# */
# void setEpsilon (float epsilon) { epsilon_ = epsilon; }
###
# grabcut_segmentation.h
# namespace pcl
# namespace segmentation
# namespace grabcut
# /** Build the initial GMMs using the Orchard and Bouman color clustering algorithm */
# PCL_EXPORTS void buildGMMs (const Image &image,
# const std::vector<int>& indices,
# const std::vector<SegmentationValue> &hardSegmentation,
# std::vector<std::size_t> &components,
# GMM &background_GMM, GMM &foreground_GMM);
###
# grabcut_segmentation.h
# namespace pcl
# namespace segmentation
# namespace grabcut
# /** Iteratively learn GMMs using GrabCut updating algorithm */
# PCL_EXPORTS void learnGMMs (const Image& image,
# const std::vector<int>& indices,
# const std::vector<SegmentationValue>& hard_segmentation,
# std::vector<std::size_t>& components,
# GMM& background_GMM, GMM& foreground_GMM);
###
# grabcut_segmentation.h
# namespace pcl
# namespace segmentation
# /** \brief Implementation of the GrabCut segmentation in
# * "GrabCut - Interactive Foreground Extraction using Iterated Graph Cuts" by
# * Carsten Rother, Vladimir Kolmogorov and Andrew Blake.
# * \author Justin Talbot, jtalbot@stanford.edu placed in Public Domain, 2010
# * \author Nizar Sallem port to PCL and adaptation of original code.
# * \ingroup segmentation
# */
# template <typename PointT>
# class GrabCut : public pcl::PCLBase<PointT>
# public:
# typedef typename pcl::search::Search<PointT> KdTree;
# typedef typename pcl::search::Search<PointT>::Ptr KdTreePtr;
# typedef typename PCLBase<PointT>::PointCloudConstPtr PointCloudConstPtr;
# typedef typename PCLBase<PointT>::PointCloudPtr PointCloudPtr;
# using PCLBase<PointT>::input_;
# using PCLBase<PointT>::indices_;
# using PCLBase<PointT>::fake_indices_;
#
# /// Constructor
# GrabCut (uint32_t K = 5, float lambda = 50.f)
# : K_ (K)
# , lambda_ (lambda)
# , nb_neighbours_ (9)
# , initialized_ (false)
# {}
#
# /// Desctructor
# virtual ~GrabCut () {};
#
# // /// Set input cloud
# void setInputCloud (const PointCloudConstPtr& cloud);
#
# /// Set background points, foreground points = points \ background points
# void setBackgroundPoints (const PointCloudConstPtr& background_points);
#
# /// Set background indices, foreground indices = indices \ background indices
# void setBackgroundPointsIndices (int x1, int y1, int x2, int y2);
#
# /// Set background indices, foreground indices = indices \ background indices
# void setBackgroundPointsIndices (const PointIndicesConstPtr& indices);
#
# /// Run Grabcut refinement on the hard segmentation
# virtual void refine ();
#
# /// \return the number of pixels that have changed from foreground to background or vice versa
# virtual int refineOnce ();
#
# /// \return lambda
# float getLambda () { return (lambda_); }
#
# /** Set lambda parameter to user given value. Suggested value by the authors is 50
# * \param[in] lambda
# */
# void setLambda (float lambda) { lambda_ = lambda; }
#
# /// \return the number of components in the GMM
# uint32_t getK () { return (K_); }
#
# /** Set K parameter to user given value. Suggested value by the authors is 5
# * \param[in] K the number of components used in GMM
# */
# void setK (uint32_t K) { K_ = K; }
#
# /** \brief Provide a pointer to the search object.
# * \param tree a pointer to the spatial search object.
# */
# inline void setSearchMethod (const KdTreePtr &tree) { tree_ = tree; }
#
# /** \brief Get a pointer to the search method used. */
# inline KdTreePtr getSearchMethod () { return (tree_); }
#
# /** \brief Allows to set the number of neighbours to find.
# * \param[in] nb_neighbours new number of neighbours
# */
# void setNumberOfNeighbours (int nb_neighbours) { nb_neighbours_ = nb_neighbours; }
#
# /** \brief Returns the number of neighbours to find. */
# int getNumberOfNeighbours () const { return (nb_neighbours_); }
#
# /** \brief This method launches the segmentation algorithm and returns the clusters that were
# * obtained during the segmentation. The indices of points belonging to the object will be stored
# * in the cluster with index 1, other indices will be stored in the cluster with index 0.
# * \param[out] clusters clusters that were obtained. Each cluster is an array of point indices.
# */
# void extract (std::vector<pcl::PointIndices>& clusters);
###
# ground_plane_comparator.h
# namespace pcl
# /** \brief GroundPlaneComparator is a Comparator for detecting smooth surfaces suitable for driving.
# * In conjunction with OrganizedConnectedComponentSegmentation, this allows smooth groundplanes / road surfaces to be segmented from point clouds.
# * \author Alex Trevor
# */
# template<typename PointT, typename PointNT>
# class GroundPlaneComparator: public Comparator<PointT>
# public:
# typedef typename Comparator<PointT>::PointCloud PointCloud;
# typedef typename Comparator<PointT>::PointCloudConstPtr PointCloudConstPtr;
# typedef typename pcl::PointCloud<PointNT> PointCloudN;
# typedef typename PointCloudN::Ptr PointCloudNPtr;
# typedef typename PointCloudN::ConstPtr PointCloudNConstPtr;
# typedef boost::shared_ptr<GroundPlaneComparator<PointT, PointNT> > Ptr;
# typedef boost::shared_ptr<const GroundPlaneComparator<PointT, PointNT> > ConstPtr;
#
# using pcl::Comparator<PointT>::input_;
#
# /** \brief Empty constructor for GroundPlaneComparator. */
# GroundPlaneComparator ()
# : normals_ ()
# , plane_coeff_d_ ()
# , angular_threshold_ (cosf (pcl::deg2rad (2.0f)))
# , road_angular_threshold_ ( cosf(pcl::deg2rad (10.0f)))
# , distance_threshold_ (0.1f)
# , depth_dependent_ (true)
# , z_axis_ (Eigen::Vector3f (0.0, 0.0, 1.0) )
# , desired_road_axis_ (Eigen::Vector3f(0.0, -1.0, 0.0))
#
# /** \brief Constructor for GroundPlaneComparator.
# * \param[in] plane_coeff_d a reference to a vector of d coefficients of plane equations. Must be the same size as the input cloud and input normals. a, b, and c coefficients are in the input normals.
# */
# GroundPlaneComparator (boost::shared_ptr<std::vector<float> >& plane_coeff_d)
# : normals_ ()
# , plane_coeff_d_ (plane_coeff_d)
# , angular_threshold_ (cosf (pcl::deg2rad (3.0f)))
# , distance_threshold_ (0.1f)
# , depth_dependent_ (true)
# , z_axis_ (Eigen::Vector3f (0.0f, 0.0f, 1.0f))
# , road_angular_threshold_ ( cosf(pcl::deg2rad (40.0f)))
# , desired_road_axis_ (Eigen::Vector3f(0.0, -1.0, 0.0))
#
# /** \brief Destructor for GroundPlaneComparator. */
# virtual ~GroundPlaneComparator ()
#
# /** \brief Provide the input cloud.
# * \param[in] cloud the input point cloud.
# */
# virtual void setInputCloud (const PointCloudConstPtr& cloud)
#
# /** \brief Provide a pointer to the input normals.
# * \param[in] normals the input normal cloud.
# */
# inline void setInputNormals (const PointCloudNConstPtr &normals)
#
# /** \brief Get the input normals. */
# inline PointCloudNConstPtr getInputNormals () const
#
# /** \brief Provide a pointer to a vector of the d-coefficient of the planes' hessian normal form. a, b, and c are provided by the normal cloud.
# * \param[in] plane_coeff_d a pointer to the plane coefficients.
# */
# void setPlaneCoeffD (boost::shared_ptr<std::vector<float> >& plane_coeff_d)
#
# /** \brief Provide a pointer to a vector of the d-coefficient of the planes' hessian normal form. a, b, and c are provided by the normal cloud.
# * \param[in] plane_coeff_d a pointer to the plane coefficients.
# */
# void setPlaneCoeffD (std::vector<float>& plane_coeff_d)
#
# /** \brief Get a pointer to the vector of the d-coefficient of the planes' hessian normal form. */
# const std::vector<float>& getPlaneCoeffD () const
#
# /** \brief Set the tolerance in radians for difference in normal direction between neighboring points, to be considered part of the same plane.
# * \param[in] angular_threshold the tolerance in radians
# */
# virtual void setAngularThreshold (float angular_threshold)
#
# /** \brief Set the tolerance in radians for difference in normal direction between a point and the expected ground normal.
# * \param[in] angular_threshold the
# */
# virtual void setGroundAngularThreshold (float angular_threshold)
#
# /** \brief Set the expected ground plane normal with respect to the sensor. Pixels labeled as ground must be within ground_angular_threshold radians of this normal to be labeled as ground.
# * \param[in] normal The normal direction of the expected ground plane.
# */
# void setExpectedGroundNormal (Eigen::Vector3f normal)
#
# /** \brief Get the angular threshold in radians for difference in normal direction between neighboring points, to be considered part of the same plane. */
# inline float getAngularThreshold () const
#
# /** \brief Set the tolerance in meters for difference in perpendicular distance (d component of plane equation) to the plane between neighboring points, to be considered part of the same plane.
# * \param[in] distance_threshold the tolerance in meters (at 1m)
# * \param[in] depth_dependent whether to scale the threshold based on range from the sensor (default: false)
# */
# void setDistanceThreshold (float distance_threshold, bool depth_dependent = false)
#
# /** \brief Get the distance threshold in meters (d component of plane equation) between neighboring points, to be considered part of the same plane. */
# inline float getDistanceThreshold () const
#
# /** \brief Compare points at two indices by their plane equations. True if the angle between the normals is less than the angular threshold,
# * and the difference between the d component of the normals is less than distance threshold, else false
# * \param idx1 The first index for the comparison
# * \param idx2 The second index for the comparison
# */
# virtual bool compare (int idx1, int idx2) const
###
# min_cut_segmentation.h
# namespace pcl
# template <typename PointT>
# class PCL_EXPORTS MinCutSegmentation : public pcl::PCLBase<PointT>
cdef extern from "pcl/segmentation/min_cut_segmentation.h" namespace "pcl":
cdef cppclass MinCutSegmentation[T](PCLBase[T]):
MinCutSegmentation()
# public:
# typedef pcl::search::Search <PointT> KdTree;
# typedef typename KdTree::Ptr KdTreePtr;
# typedef pcl::PointCloud< PointT > PointCloud;
# typedef typename PointCloud::ConstPtr PointCloudConstPtr;
# using PCLBase <PointT>::input_;
# using PCLBase <PointT>::indices_;
# using PCLBase <PointT>::initCompute;
# using PCLBase <PointT>::deinitCompute;
# public:
# typedef boost::adjacency_list_traits< boost::vecS, boost::vecS, boost::directedS > Traits;
# typedef boost::adjacency_list< boost::vecS, boost::vecS, boost::directedS,
# boost::property< boost::vertex_name_t, std::string,
# boost::property< boost::vertex_index_t, long,
# boost::property< boost::vertex_color_t, boost::default_color_type,
# boost::property< boost::vertex_distance_t, long,
# boost::property< boost::vertex_predecessor_t, Traits::edge_descriptor > > > > >,
# boost::property< boost::edge_capacity_t, double,
# boost::property< boost::edge_residual_capacity_t, double,
# boost::property< boost::edge_reverse_t, Traits::edge_descriptor > > > > mGraph;
# typedef boost::property_map< mGraph, boost::edge_capacity_t >::type CapacityMap;
# typedef boost::property_map< mGraph, boost::edge_reverse_t>::type ReverseEdgeMap;
# typedef Traits::vertex_descriptor VertexDescriptor;
# typedef boost::graph_traits< mGraph >::edge_descriptor EdgeDescriptor;
# typedef boost::graph_traits< mGraph >::out_edge_iterator OutEdgeIterator;
# typedef boost::graph_traits< mGraph >::vertex_iterator VertexIterator;
# typedef boost::property_map< mGraph, boost::edge_residual_capacity_t >::type ResidualCapacityMap;
# typedef boost::property_map< mGraph, boost::vertex_index_t >::type IndexMap;
# typedef boost::graph_traits< mGraph >::in_edge_iterator InEdgeIterator;
# public:
# /** \brief This method simply sets the input point cloud.
# * \param[in] cloud the const boost shared pointer to a PointCloud
# virtual void setInputCloud (const PointCloudConstPtr &cloud);
# /** \brief Returns normalization value for binary potentials. For more information see the article. */
double getSigma ()
# /** \brief Allows to set the normalization value for the binary potentials as described in the article.
# * \param[in] sigma new normalization value
void setSigma (double sigma)
# /** \brief Returns radius to the background. */
double getRadius ()
# /** \brief Allows to set the radius to the background.
# * \param[in] radius new radius to the background
void setRadius (double radius)
# /** \brief Returns weight that every edge from the source point has. */
double getSourceWeight ()
# /** \brief Allows to set weight for source edges. Every edge that comes from the source point will have that weight.
# * \param[in] weight new weight
void setSourceWeight (double weight)
# /** \brief Returns search method that is used for finding KNN.
# * The graph is build such way that it contains the edges that connect point and its KNN.
# KdTreePtr getSearchMethod () const;
# /** \brief Allows to set search method for finding KNN.
# * The graph is build such way that it contains the edges that connect point and its KNN.
# * \param[in] search search method that will be used for finding KNN.
# void setSearchMethod (const KdTreePtr& tree);
# /** \brief Returns the number of neighbours to find. */
unsigned int getNumberOfNeighbours ()
# /** \brief Allows to set the number of neighbours to find.
# * \param[in] number_of_neighbours new number of neighbours
void setNumberOfNeighbours (unsigned int neighbour_number)
# /** \brief Returns the points that must belong to foreground. */
# std::vector<PointT, Eigen::aligned_allocator<PointT> > getForegroundPoints () const;
# /** \brief Allows to specify points which are known to be the points of the object.
# * \param[in] foreground_points point cloud that contains foreground points. At least one point must be specified.
# void setForegroundPoints (typename pcl::PointCloud<PointT>::Ptr foreground_points);
# /** \brief Returns the points that must belong to background. */
# std::vector<PointT, Eigen::aligned_allocator<PointT> > getBackgroundPoints () const;
# /** \brief Allows to specify points which are known to be the points of the background.
# * \param[in] background_points point cloud that contains background points.
# void setBackgroundPoints (typename pcl::PointCloud<PointT>::Ptr background_points);
# /** \brief This method launches the segmentation algorithm and returns the clusters that were
# * obtained during the segmentation. The indices of points that belong to the object will be stored
# * in the cluster with index 1, other indices will be stored in the cluster with index 0.
# * \param[out] clusters clusters that were obtained. Each cluster is an array of point indices.
# void extract (vector <pcl::PointIndices>& clusters);
# /** \brief Returns that flow value that was calculated during the segmentation. */
double getMaxFlow ()
# /** \brief Returns the graph that was build for finding the minimum cut. */
# typename boost::shared_ptr<typename pcl::MinCutSegmentation<PointT>::mGraph> getGraph () const;
# /** \brief Returns the colored cloud. Points that belong to the object have the same color. */
# pcl::PointCloud<pcl::PointXYZRGB>::Ptr getColoredCloud ();
# protected:
# /** \brief This method simply builds the graph that will be used during the segmentation. */
bool buildGraph ()
# /** \brief Returns unary potential(data cost) for the given point index.
# * In other words it calculates weights for (source, point) and (point, sink) edges.
# * \param[in] point index of the point for which weights will be calculated
# * \param[out] source_weight calculated weight for the (source, point) edge
# * \param[out] sink_weight calculated weight for the (point, sink) edge
void calculateUnaryPotential (int point, double& source_weight, double& sink_weight)
# /** \brief This method simply adds the edge from the source point to the target point with a given weight.
# * \param[in] source index of the source point of the edge
# * \param[in] target index of the target point of the edge
# * \param[in] weight weight that will be assigned to the (source, target) edge
bool addEdge (int source, int target, double weight)
# /** \brief Returns the binary potential(smooth cost) for the given indices of points.
# * In other words it returns weight that must be assigned to the edge from source to target point.
# * \param[in] source index of the source point of the edge
# * \param[in] target index of the target point of the edge
double calculateBinaryPotential (int source, int target)
# brief This method recalculates unary potentials(data cost) if some changes were made, instead of creating new graph. */
bool recalculateUnaryPotentials ()
# brief This method recalculates binary potentials(smooth cost) if some changes were made, instead of creating new graph. */
bool recalculateBinaryPotentials ()
# /** \brief This method analyzes the residual network and assigns a label to every point in the cloud.
# * \param[in] residual_capacity residual network that was obtained during the segmentation
# void assembleLabels (ResidualCapacityMap& residual_capacity);
# protected:
# /** \brief Stores the sigma coefficient. It is used for finding smooth costs. More information can be found in the article. */
# double inverse_sigma_;
# /** \brief Signalizes if the binary potentials are valid. */
# bool binary_potentials_are_valid_;
# /** \brief Used for comparison of the floating point numbers. */
# double epsilon_;
# /** \brief Stores the distance to the background. */
# double radius_;
# /** \brief Signalizes if the unary potentials are valid. */
# bool unary_potentials_are_valid_;
# /** \brief Stores the weight for every edge that comes from source point. */
# double source_weight_;
# /** \brief Stores the search method that will be used for finding K nearest neighbors. Neighbours are used for building the graph. */
# KdTreePtr search_;
# /** \brief Stores the number of neighbors to find. */
# unsigned int number_of_neighbours_;
# /** \brief Signalizes if the graph is valid. */
# bool graph_is_valid_;
# /** \brief Stores the points that are known to be in the foreground. */
# std::vector<PointT, Eigen::aligned_allocator<PointT> > foreground_points_;
# /** \brief Stores the points that are known to be in the background. */
# std::vector<PointT, Eigen::aligned_allocator<PointT> > background_points_;
# /** \brief After the segmentation it will contain the segments. */
# std::vector <pcl::PointIndices> clusters_;
# /** \brief Stores the graph for finding the maximum flow. */
# boost::shared_ptr<mGraph> graph_;
# /** \brief Stores the capacity of every edge in the graph. */
# boost::shared_ptr<CapacityMap> capacity_;
# /** \brief Stores reverse edges for every edge in the graph. */
# boost::shared_ptr<ReverseEdgeMap> reverse_edges_;
# /** \brief Stores the vertices of the graph. */
# std::vector< VertexDescriptor > vertices_;
# /** \brief Stores the information about the edges that were added to the graph. It is used to avoid the duplicate edges. */
# std::vector< std::set<int> > edge_marker_;
# /** \brief Stores the vertex that serves as source. */
# VertexDescriptor source_;
# /** \brief Stores the vertex that serves as sink. */
# VertexDescriptor sink_;
# /** \brief Stores the maximum flow value that was calculated during the segmentation. */
# double max_flow_;
# public:
# EIGEN_MAKE_ALIGNED_OPERATOR_NEW
###
# organized_connected_component_segmentation.h
# namespace pcl
# /** \brief OrganizedConnectedComponentSegmentation allows connected
# * components to be found within organized point cloud data, given a
# * comparison function. Given an input cloud and a comparator, it will
# * output a PointCloud of labels, giving each connected component a unique
# * id, along with a vector of PointIndices corresponding to each component.
# * See OrganizedMultiPlaneSegmentation for an example application.
# * \author Alex Trevor, Suat Gedikli
# */
# template <typename PointT, typename PointLT>
# class OrganizedConnectedComponentSegmentation : public PCLBase<PointT>
# {
cdef extern from "pcl/segmentation/organized_connected_component_segmentation.h" namespace "pcl":
cdef cppclass OrganizedConnectedComponentSegmentation[T, LT](PCLBase[T]):
OrganizedConnectedComponentSegmentation()
# using PCLBase<PointT>::input_;
# using PCLBase<PointT>::indices_;
# using PCLBase<PointT>::initCompute;
# using PCLBase<PointT>::deinitCompute;
#
# public:
# typedef typename pcl::PointCloud<PointT> PointCloud;
# typedef typename PointCloud::Ptr PointCloudPtr;
# typedef typename PointCloud::ConstPtr PointCloudConstPtr;
#
# typedef typename pcl::PointCloud<PointLT> PointCloudL;
# typedef typename PointCloudL::Ptr PointCloudLPtr;
# typedef typename PointCloudL::ConstPtr PointCloudLConstPtr;
# typedef typename pcl::Comparator<PointT> Comparator;
# typedef typename Comparator::Ptr ComparatorPtr;
# typedef typename Comparator::ConstPtr ComparatorConstPtr;
#
# /** \brief Constructor for OrganizedConnectedComponentSegmentation
# * \param[in] compare A pointer to the comparator to be used for segmentation. Must be an instance of pcl::Comparator.
# */
# OrganizedConnectedComponentSegmentation (const ComparatorConstPtr& compare) : compare_ (compare)
# /** \brief Destructor for OrganizedConnectedComponentSegmentation. */
# virtual ~OrganizedConnectedComponentSegmentation ()
#
# /** \brief Provide a pointer to the comparator to be used for segmentation.
# * \param[in] compare the comparator
# */
# void setComparator (const ComparatorConstPtr& compare)
#
# /** \brief Get the comparator.*/
# ComparatorConstPtr getComparator () const { return (compare_); }
#
# /** \brief Perform the connected component segmentation.
# * \param[out] labels a PointCloud of labels: each connected component will have a unique id.
# * \param[out] label_indices a vector of PointIndices corresponding to each label / component id.
# */
# void segment (pcl::PointCloud<PointLT>& labels, std::vector<pcl::PointIndices>& label_indices) const;
#
# /** \brief Find the boundary points / contour of a connected component
# * \param[in] start_idx the first (lowest) index of the connected component for which a boundary shoudl be returned
# * \param[in] labels the Label cloud produced by segmentation
# * \param[out] boundary_indices the indices of the boundary points for the label corresponding to start_idx
# */
# static void findLabeledRegionBoundary (int start_idx, PointCloudLPtr labels, pcl::PointIndices& boundary_indices);
###
# organized_multi_plane_segmentation.h
# namespace pcl
# {
# /** \brief OrganizedMultiPlaneSegmentation finds all planes present in the
# * input cloud, and outputs a vector of plane equations, as well as a vector
# * of point clouds corresponding to the inliers of each detected plane. Only
# * planes with more than min_inliers points are detected.
# * Templated on point type, normal type, and label type
# *
# * \author Alex Trevor, Suat Gedikli
# */
# template<typename PointT, typename PointNT, typename PointLT>
# class OrganizedMultiPlaneSegmentation : public PCLBase<PointT>
# using PCLBase<PointT>::input_;
# using PCLBase<PointT>::indices_;
# using PCLBase<PointT>::initCompute;
# using PCLBase<PointT>::deinitCompute;
#
# public:
# typedef pcl::PointCloud<PointT> PointCloud;
# typedef typename PointCloud::Ptr PointCloudPtr;
# typedef typename PointCloud::ConstPtr PointCloudConstPtr;
# typedef typename pcl::PointCloud<PointNT> PointCloudN;
# typedef typename PointCloudN::Ptr PointCloudNPtr;
# typedef typename PointCloudN::ConstPtr PointCloudNConstPtr;
# typedef typename pcl::PointCloud<PointLT> PointCloudL;
# typedef typename PointCloudL::Ptr PointCloudLPtr;
# typedef typename PointCloudL::ConstPtr PointCloudLConstPtr;
# typedef typename pcl::PlaneCoefficientComparator<PointT, PointNT> PlaneComparator;
# typedef typename PlaneComparator::Ptr PlaneComparatorPtr;
# typedef typename PlaneComparator::ConstPtr PlaneComparatorConstPtr;
# typedef typename pcl::PlaneRefinementComparator<PointT, PointNT, PointLT> PlaneRefinementComparator;
# typedef typename PlaneRefinementComparator::Ptr PlaneRefinementComparatorPtr;
# typedef typename PlaneRefinementComparator::ConstPtr PlaneRefinementComparatorConstPtr;
#
# /** \brief Constructor for OrganizedMultiPlaneSegmentation. */
# OrganizedMultiPlaneSegmentation () :
# normals_ (),
# min_inliers_ (1000),
# angular_threshold_ (pcl::deg2rad (3.0)),
# distance_threshold_ (0.02),
# maximum_curvature_ (0.001),
# project_points_ (false),
# compare_ (new PlaneComparator ()), refinement_compare_ (new PlaneRefinementComparator ())
#
# /** \brief Destructor for OrganizedMultiPlaneSegmentation. */
# virtual ~OrganizedMultiPlaneSegmentation ()
#
# /** \brief Provide a pointer to the input normals.
# * \param[in] normals the input normal cloud
# */
# inline void setInputNormals (const PointCloudNConstPtr &normals)
#
# /** \brief Get the input normals. */
# inline PointCloudNConstPtr getInputNormals () const
#
# /** \brief Set the minimum number of inliers required for a plane
# * \param[in] min_inliers the minimum number of inliers required per plane
# */
# inline void setMinInliers (unsigned min_inliers)
#
# /** \brief Get the minimum number of inliers required per plane. */
# inline unsigned getMinInliers () const
#
# /** \brief Set the tolerance in radians for difference in normal direction between neighboring points, to be considered part of the same plane.
# * \param[in] angular_threshold the tolerance in radians
# */
# inline void setAngularThreshold (double angular_threshold)
#
# /** \brief Get the angular threshold in radians for difference in normal direction between neighboring points, to be considered part of the same plane. */
# inline double getAngularThreshold () const
#
# /** \brief Set the tolerance in meters for difference in perpendicular distance (d component of plane equation) to the plane between neighboring points, to be considered part of the same plane.
# * \param[in] distance_threshold the tolerance in meters
# */
# inline void setDistanceThreshold (double distance_threshold)
#
# /** \brief Get the distance threshold in meters (d component of plane equation) between neighboring points, to be considered part of the same plane. */
# inline double getDistanceThreshold () const
#
# /** \brief Set the maximum curvature allowed for a planar region.
# * \param[in] maximum_curvature the maximum curvature
# */
# inline void setMaximumCurvature (double maximum_curvature)
#
# /** \brief Get the maximum curvature allowed for a planar region. */
# inline double getMaximumCurvature () const
#
# /** \brief Provide a pointer to the comparator to be used for segmentation.
# * \param[in] compare A pointer to the comparator to be used for segmentation.
# */
# void setComparator (const PlaneComparatorPtr& compare)
#
# /** \brief Provide a pointer to the comparator to be used for refinement.
# * \param[in] compare A pointer to the comparator to be used for refinement.
# */
# void setRefinementComparator (const PlaneRefinementComparatorPtr& compare)
#
# /** \brief Set whether or not to project boundary points to the plane, or leave them in the original 3D space.
# * \param[in] project_points true if points should be projected, false if not.
# */
# void setProjectPoints (bool project_points)
#
# /** \brief Segmentation of all planes in a point cloud given by setInputCloud(), setIndices()
# * \param[out] model_coefficients a vector of model_coefficients for each plane found in the input cloud
# * \param[out] inlier_indices a vector of inliers for each detected plane
# * \param[out] centroids a vector of centroids for each plane
# * \param[out] covariances a vector of covariance matricies for the inliers of each plane
# * \param[out] labels a point cloud for the connected component labels of each pixel
# * \param[out] label_indices a vector of PointIndices for each labeled component
# */
# void segment (
# std::vector<ModelCoefficients>& model_coefficients,
# std::vector<PointIndices>& inlier_indices,
# std::vector<Eigen::Vector4f, Eigen::aligned_allocator<Eigen::Vector4f> >& centroids,
# std::vector <Eigen::Matrix3f, Eigen::aligned_allocator<Eigen::Matrix3f> >& covariances,
# pcl::PointCloud<PointLT>& labels,
# std::vector<pcl::PointIndices>& label_indices);
#
# /** \brief Segmentation of all planes in a point cloud given by setInputCloud(), setIndices()
# * \param[out] model_coefficients a vector of model_coefficients for each plane found in the input cloud
# * \param[out] inlier_indices a vector of inliers for each detected plane
# */
# void segment (
# std::vector<ModelCoefficients>& model_coefficients,
# std::vector<PointIndices>& inlier_indices);
#
# /** \brief Segmentation of all planes in a point cloud given by setInputCloud(), setIndices()
# * \param[out] regions a list of resultant planar polygonal regions
# */
# void segment (std::vector<PlanarRegion<PointT>, Eigen::aligned_allocator<PlanarRegion<PointT> > >& regions);
#
# /** \brief Perform a segmentation, as well as an additional refinement step. This helps with including points whose normals may not match neighboring points well, but may match the planar model well.
# * \param[out] regions A list of regions generated by segmentation and refinement.
# */
# void segmentAndRefine (std::vector<PlanarRegion<PointT>, Eigen::aligned_allocator<PlanarRegion<PointT> > >& regions);
#
# /** \brief Perform a segmentation, as well as additional refinement step. Returns intermediate data structures for use in
# * subsequent processing.
# * \param[out] regions A vector of PlanarRegions generated by segmentation
# * \param[out] model_coefficients A vector of model coefficients for each segmented plane
# * \param[out] inlier_indices A vector of PointIndices, indicating the inliers to each segmented plane
# * \param[out] labels A PointCloud<PointLT> corresponding to the resulting segmentation.
# * \param[out] label_indices A vector of PointIndices for each label
# * \param[out] boundary_indices A vector of PointIndices corresponding to the outer boundary / contour of each label
# */
# void segmentAndRefine (
# std::vector<PlanarRegion<PointT>, Eigen::aligned_allocator<PlanarRegion<PointT> > >& regions,
# std::vector<ModelCoefficients>& model_coefficients,
# std::vector<PointIndices>& inlier_indices,
# PointCloudLPtr& labels,
# std::vector<pcl::PointIndices>& label_indices,
# std::vector<pcl::PointIndices>& boundary_indices);
#
# /** \brief Perform a refinement of an initial segmentation, by comparing points to adjacent regions detected by the initial segmentation.
# * \param [in] model_coefficients The list of segmented model coefficients
# * \param [in] inlier_indices The list of segmented inlier indices, corresponding to each model
# * \param [in] centroids The list of centroids corresponding to each segmented plane
# * \param [in] covariances The list of covariances corresponding to each segemented plane
# * \param [in] labels The labels produced by the initial segmentation
# * \param [in] label_indices The list of indices corresponding to each label
# */
# void refine (std::vector<ModelCoefficients>& model_coefficients,
# std::vector<PointIndices>& inlier_indices,
# std::vector<Eigen::Vector4f, Eigen::aligned_allocator<Eigen::Vector4f> >& centroids,
# std::vector <Eigen::Matrix3f, Eigen::aligned_allocator<Eigen::Matrix3f> >& covariances,
# PointCloudLPtr& labels,
# std::vector<pcl::PointIndices>& label_indices);
###
#ifdef PCL_NO_PRECOMPILE
#include <pcl/segmentation/impl/organized_multi_plane_segmentation.hpp>
#endif
#endif //#ifndef PCL_SEGMENTATION_ORGANIZED_MULTI_PLANE_SEGMENTATION_H_
###
# planar_polygon_fusion.h
# namespace pcl
# /** \brief PlanarPolygonFusion takes a list of 2D planar polygons and
# * attempts to reduce them to a minimum set that best represents the scene,
# * based on various given comparators.
# */
# template <typename PointT>
# class PlanarPolygonFusion
# public:
# /** \brief Constructor */
# PlanarPolygonFusion () : regions_ () {}
#
# /** \brief Destructor */
# virtual ~PlanarPolygonFusion () {}
#
# /** \brief Reset the state (clean the list of planar models). */
# void reset ()
#
# /** \brief Set the list of 2D planar polygons to refine.
# * \param[in] input the list of 2D planar polygons to refine
# */
# void addInputPolygons (const std::vector<PlanarRegion<PointT>, Eigen::aligned_allocator<PlanarRegion<PointT> > > &input)
###
# planar_region.h
# namespace pcl
# /** \brief PlanarRegion represents a set of points that lie in a plane. Inherits summary statistics about these points from Region3D, and summary statistics of a 3D collection of points.
# * \author Alex Trevor
# */
# template <typename PointT>
# class PlanarRegion : public pcl::Region3D<PointT>, public pcl::PlanarPolygon<PointT>
# protected:
# using Region3D<PointT>::centroid_;
# using Region3D<PointT>::covariance_;
# using Region3D<PointT>::count_;
# using PlanarPolygon<PointT>::contour_;
# using PlanarPolygon<PointT>::coefficients_;
#
# public:
# /** \brief Empty constructor for PlanarRegion. */
# PlanarRegion () : contour_labels_ ()
#
# /** \brief Constructor for Planar region from a Region3D and a PlanarPolygon.
# * \param[in] region a Region3D for the input data
# * \param[in] polygon a PlanarPolygon for the input region
# */
# PlanarRegion (const pcl::Region3D<PointT>& region, const pcl::PlanarPolygon<PointT>& polygon) :
#
# /** \brief Destructor. */
# virtual ~PlanarRegion () {}
#
# /** \brief Constructor for PlanarRegion.
# * \param[in] centroid the centroid of the region.
# * \param[in] covariance the covariance of the region.
# * \param[in] count the number of points in the region.
# * \param[in] contour the contour / boudnary for the region
# * \param[in] coefficients the model coefficients (a,b,c,d) for the plane
# */
# PlanarRegion (const Eigen::Vector3f& centroid, const Eigen::Matrix3f& covariance, unsigned count,
# const typename pcl::PointCloud<PointT>::VectorType& contour,
# const Eigen::Vector4f& coefficients) :
###
# plane_coefficient_comparator.h
# namespace pcl
# /** \brief PlaneCoefficientComparator is a Comparator that operates on plane coefficients, for use in planar segmentation.
# * In conjunction with OrganizedConnectedComponentSegmentation, this allows planes to be segmented from organized data.
# * \author Alex Trevor
# */
# template<typename PointT, typename PointNT>
# class PlaneCoefficientComparator: public Comparator<PointT>
# public:
# typedef typename Comparator<PointT>::PointCloud PointCloud;
# typedef typename Comparator<PointT>::PointCloudConstPtr PointCloudConstPtr;
# typedef typename pcl::PointCloud<PointNT> PointCloudN;
# typedef typename PointCloudN::Ptr PointCloudNPtr;
# typedef typename PointCloudN::ConstPtr PointCloudNConstPtr;
# typedef boost::shared_ptr<PlaneCoefficientComparator<PointT, PointNT> > Ptr;
# typedef boost::shared_ptr<const PlaneCoefficientComparator<PointT, PointNT> > ConstPtr;
# using pcl::Comparator<PointT>::input_;
#
# /** \brief Empty constructor for PlaneCoefficientComparator. */
# PlaneCoefficientComparator ()
# : normals_ ()
# , plane_coeff_d_ ()
# , angular_threshold_ (pcl::deg2rad (2.0f))
# , distance_threshold_ (0.02f)
# , depth_dependent_ (true)
# , z_axis_ (Eigen::Vector3f (0.0, 0.0, 1.0) )
#
# /** \brief Constructor for PlaneCoefficientComparator.
# * \param[in] plane_coeff_d a reference to a vector of d coefficients of plane equations. Must be the same size as the input cloud and input normals. a, b, and c coefficients are in the input normals.
# */
# PlaneCoefficientComparator (boost::shared_ptr<std::vector<float> >& plane_coeff_d)
# : normals_ ()
# , plane_coeff_d_ (plane_coeff_d)
# , angular_threshold_ (pcl::deg2rad (2.0f))
# , distance_threshold_ (0.02f)
# , depth_dependent_ (true)
# , z_axis_ (Eigen::Vector3f (0.0f, 0.0f, 1.0f) )
#
# /** \brief Destructor for PlaneCoefficientComparator. */
# virtual ~PlaneCoefficientComparator ()
#
# virtual void setInputCloud (const PointCloudConstPtr& cloud)
#
# /** \brief Provide a pointer to the input normals.
# * \param[in] normals the input normal cloud
# */
# inline void setInputNormals (const PointCloudNConstPtr &normals)
#
# /** \brief Get the input normals. */
# inline PointCloudNConstPtr getInputNormals () const
#
# /** \brief Provide a pointer to a vector of the d-coefficient of the planes' hessian normal form. a, b, and c are provided by the normal cloud.
# * \param[in] plane_coeff_d a pointer to the plane coefficients.
# */
# void setPlaneCoeffD (boost::shared_ptr<std::vector<float> >& plane_coeff_d)
#
# /** \brief Provide a pointer to a vector of the d-coefficient of the planes' hessian normal form. a, b, and c are provided by the normal cloud.
# * \param[in] plane_coeff_d a pointer to the plane coefficients.
# */
# void setPlaneCoeffD (std::vector<float>& plane_coeff_d)
#
# /** \brief Get a pointer to the vector of the d-coefficient of the planes' hessian normal form. */
# const std::vector<float>& getPlaneCoeffD () const
#
# /** \brief Set the tolerance in radians for difference in normal direction between neighboring points, to be considered part of the same plane.
# * \param[in] angular_threshold the tolerance in radians
# */
# virtual void setAngularThreshold (float angular_threshold)
#
# /** \brief Get the angular threshold in radians for difference in normal direction between neighboring points, to be considered part of the same plane. */
# inline float getAngularThreshold () const
#
# /** \brief Set the tolerance in meters for difference in perpendicular distance (d component of plane equation) to the plane between neighboring points, to be considered part of the same plane.
# * \param[in] distance_threshold the tolerance in meters (at 1m)
# * \param[in] depth_dependent whether to scale the threshold based on range from the sensor (default: false)
# */
# void setDistanceThreshold (float distance_threshold, bool depth_dependent = false)
#
# /** \brief Get the distance threshold in meters (d component of plane equation) between neighboring points, to be considered part of the same plane. */
# inline float getDistanceThreshold () const
#
# /** \brief Compare points at two indices by their plane equations. True if the angle between the normals is less than the angular threshold,
# * and the difference between the d component of the normals is less than distance threshold, else false
# * \param idx1 The first index for the comparison
# * \param idx2 The second index for the comparison
# */
# virtual bool compare (int idx1, int idx2) const
###
# plane_refinement_comparator.h
# namespace pcl
# /** \brief PlaneRefinementComparator is a Comparator that operates on plane coefficients,
# * for use in planar segmentation.
# * In conjunction with OrganizedConnectedComponentSegmentation, this allows planes to be segmented from organized data.
# *
# * \author Alex Trevor, Suat Gedikli
# */
# template<typename PointT, typename PointNT, typename PointLT>
# class PlaneRefinementComparator: public PlaneCoefficientComparator<PointT, PointNT>
# public:
# typedef typename Comparator<PointT>::PointCloud PointCloud;
# typedef typename Comparator<PointT>::PointCloudConstPtr PointCloudConstPtr;
# typedef typename pcl::PointCloud<PointNT> PointCloudN;
# typedef typename PointCloudN::Ptr PointCloudNPtr;
# typedef typename PointCloudN::ConstPtr PointCloudNConstPtr;
# typedef typename pcl::PointCloud<PointLT> PointCloudL;
# typedef typename PointCloudL::Ptr PointCloudLPtr;
# typedef typename PointCloudL::ConstPtr PointCloudLConstPtr;
#
# typedef boost::shared_ptr<PlaneRefinementComparator<PointT, PointNT, PointLT> > Ptr;
# typedef boost::shared_ptr<const PlaneRefinementComparator<PointT, PointNT, PointLT> > ConstPtr;
#
# using pcl::PlaneCoefficientComparator<PointT, PointNT>::input_;
# using pcl::PlaneCoefficientComparator<PointT, PointNT>::normals_;
# using pcl::PlaneCoefficientComparator<PointT, PointNT>::distance_threshold_;
# using pcl::PlaneCoefficientComparator<PointT, PointNT>::plane_coeff_d_;
#
# /** \brief Empty constructor for PlaneCoefficientComparator. */
# PlaneRefinementComparator ()
# : models_ ()
# , labels_ ()
# , refine_labels_ ()
# , label_to_model_ ()
# , depth_dependent_ (false)
#
# /** \brief Empty constructor for PlaneCoefficientComparator.
# * \param[in] models
# * \param[in] refine_labels
# */
# PlaneRefinementComparator (boost::shared_ptr<std::vector<pcl::ModelCoefficients> >& models,
# boost::shared_ptr<std::vector<bool> >& refine_labels)
# : models_ (models)
# , labels_ ()
# , refine_labels_ (refine_labels)
# , label_to_model_ ()
# , depth_dependent_ (false)
#
# /** \brief Destructor for PlaneCoefficientComparator. */
# virtual ~PlaneRefinementComparator ()
#
# /** \brief Set the vector of model coefficients to which we will compare.
# * \param[in] models a vector of model coefficients produced by the initial segmentation step.
# */
# void setModelCoefficients (boost::shared_ptr<std::vector<pcl::ModelCoefficients> >& models)
#
# /** \brief Set the vector of model coefficients to which we will compare.
# * \param[in] models a vector of model coefficients produced by the initial segmentation step.
# */
# void setModelCoefficients (std::vector<pcl::ModelCoefficients>& models)
#
# /** \brief Set which labels should be refined. This is a vector of bools 0-max_label, true if the label should be refined.
# * \param[in] refine_labels A vector of bools 0-max_label, true if the label should be refined.
# */
# void setRefineLabels (boost::shared_ptr<std::vector<bool> >& refine_labels)
#
# /** \brief Set which labels should be refined. This is a vector of bools 0-max_label, true if the label should be refined.
# * \param[in] refine_labels A vector of bools 0-max_label, true if the label should be refined.
# */
# void setRefineLabels (std::vector<bool>& refine_labels)
#
# /** \brief A mapping from label to index in the vector of models, allowing the model coefficients of a label to be accessed.
# * \param[in] label_to_model A vector of size max_label, with the index of each corresponding model in models
# */
# inline void setLabelToModel (boost::shared_ptr<std::vector<int> >& label_to_model)
#
# /** \brief A mapping from label to index in the vector of models, allowing the model coefficients of a label to be accessed.
# * \param[in] label_to_model A vector of size max_label, with the index of each corresponding model in models
# */
# inline void setLabelToModel (std::vector<int>& label_to_model)
#
# /** \brief Get the vector of model coefficients to which we will compare. */
# inline boost::shared_ptr<std::vector<pcl::ModelCoefficients> > getModelCoefficients () const
#
# /** \brief ...
# * \param[in] labels
# */
# inline void setLabels (PointCloudLPtr& labels)
#
# /** \brief Compare two neighboring points
# * \param[in] idx1 The index of the first point.
# * \param[in] idx2 The index of the second point.
# */
# virtual bool compare (int idx1, int idx2) const
###
# 1.7.2 NG
# progressive_morphological_filter.h
# namespace pcl
# /** \brief
# * Implements the Progressive Morphological Filter for segmentation of ground points.
# * Description can be found in the article
# * "A Progressive Morphological Filter for Removing Nonground Measurements from
# * Airborne LIDAR Data"
# * by K. Zhang, S. Chen, D. Whitman, M. Shyu, J. Yan, and C. Zhang.
# */
# template <typename PointT>
# class PCL_EXPORTS ProgressiveMorphologicalFilter : public pcl::PCLBase<PointT>
# cdef extern from "pcl/segmentation/progressive_morphological_filter.h" namespace "pcl":
# cdef cppclass ProgressiveMorphologicalFilter[PointT](PCLBase[PointT]):
# ProgressiveMorphologicalFilter()
# public:
# typedef pcl::PointCloud <PointT> PointCloud;
#
# using PCLBase <PointT>::input_;
# using PCLBase <PointT>::indices_;
# using PCLBase <PointT>::initCompute;
# using PCLBase <PointT>::deinitCompute;
# public:
# /** \brief Constructor that sets default values for member variables. */
# ProgressiveMorphologicalFilter ();
# virtual ~ProgressiveMorphologicalFilter ();
#
# /** \brief Get the maximum window size to be used in filtering ground returns. */
# inline int getMaxWindowSize () const { return (max_window_size_); }
# int getMaxWindowSize ()
#
# /** \brief Set the maximum window size to be used in filtering ground returns. */
# inline void setMaxWindowSize (int max_window_size) { max_window_size_ = max_window_size; }
# void setMaxWindowSize (int max_window_size)
#
# /** \brief Get the slope value to be used in computing the height threshold. */
# inline float getSlope () const { return (slope_); }
# float getSlope ()
#
# /** \brief Set the slope value to be used in computing the height threshold. */
# inline void setSlope (float slope) { slope_ = slope; }
# void setSlope (float slope)
#
# /** \brief Get the maximum height above the parameterized ground surface to be considered a ground return. */
# inline float getMaxDistance () const { return (max_distance_); }
# float getMaxDistance ()
#
# /** \brief Set the maximum height above the parameterized ground surface to be considered a ground return. */
# inline void setMaxDistance (float max_distance) { max_distance_ = max_distance; }
# void setMaxDistance (float max_distance)
#
# /** \brief Get the initial height above the parameterized ground surface to be considered a ground return. */
# inline float getInitialDistance () const { return (initial_distance_); }
# float getInitialDistance ()
#
# /** \brief Set the initial height above the parameterized ground surface to be considered a ground return. */
# inline void setInitialDistance (float initial_distance) { initial_distance_ = initial_distance; }
# void setInitialDistance (float initial_distance)
#
# /** \brief Get the cell size. */
# inline float getCellSize () const { return (cell_size_); }
# float getCellSize ()
#
# /** \brief Set the cell size. */
# inline void setCellSize (float cell_size) { cell_size_ = cell_size; }
# void setCellSize (float cell_size)
#
# /** \brief Get the base to be used in computing progressive window sizes. */
# inline float getBase () const { return (base_); }
# float getBase ()
#
# /** \brief Set the base to be used in computing progressive window sizes. */
# inline void setBase (float base) { base_ = base; }
# setBase (float base)
#
# /** \brief Get flag indicating whether or not to exponentially grow window sizes? */
# inline bool getExponential () const { return (exponential_); }
# bool getExponential ()
#
# /** \brief Set flag indicating whether or not to exponentially grow window sizes? */
# inline void setExponential (bool exponential) { exponential_ = exponential; }
# void setExponential (bool exponential)
#
# /** \brief This method launches the segmentation algorithm and returns indices of
# * points determined to be ground returns.
# * \param[out] ground indices of points determined to be ground returns.
# */
# virtual void extract (std::vector<int>& ground);
# void extract (vector[int]& ground)
# ctypedef ProgressiveMorphologicalFilter[PointXYZ] ProgressiveMorphologicalFilter_t
# ctypedef ProgressiveMorphologicalFilter[PointXYZI] ProgressiveMorphologicalFilter_PointXYZI_t
# ctypedef ProgressiveMorphologicalFilter[PointXYZRGB] ProgressiveMorphologicalFilter_PointXYZRGB_t
# ctypedef ProgressiveMorphologicalFilter[PointXYZRGBA] ProgressiveMorphologicalFilter_PointXYZRGBA_t
###
# region_3d.h
# namespace pcl
# /** \brief Region3D represents summary statistics of a 3D collection of points.
# * \author Alex Trevor
# */
# template <typename PointT>
# class Region3D
# public:
# /** \brief Empty constructor for Region3D. */
# Region3D () : centroid_ (Eigen::Vector3f::Zero ()), covariance_ (Eigen::Matrix3f::Identity ()), count_ (0)
#
# /** \brief Constructor for Region3D.
# * \param[in] centroid The centroid of the region.
# * \param[in] covariance The covariance of the region.
# * \param[in] count The number of points in the region.
# */
# Region3D (Eigen::Vector3f& centroid, Eigen::Matrix3f& covariance, unsigned count)
# : centroid_ (centroid), covariance_ (covariance), count_ (count)
#
# /** \brief Destructor. */
# virtual ~Region3D () {}
#
# /** \brief Get the centroid of the region. */
# inline Eigen::Vector3f getCentroid () const
#
# /** \brief Get the covariance of the region. */
# inline Eigen::Matrix3f getCovariance () const
#
# /** \brief Get the number of points in the region. */
# unsigned getCount () const
#
# /** \brief Get the curvature of the region. */
# float getCurvature () const
#
# /** \brief Set the curvature of the region. */
# void setCurvature (float curvature)
###
# region_growing.h
# namespace pcl
# /** \brief
# * Implements the well known Region Growing algorithm used for segmentation.
# * Description can be found in the article
# * "Segmentation of point clouds using smoothness constraint"
# * by T. Rabbania, F. A. van den Heuvelb, G. Vosselmanc.
# * In addition to residual test, the possibility to test curvature is added.
# */
# template <typename PointT, typename NormalT>
# class PCL_EXPORTS RegionGrowing : public pcl::PCLBase<PointT>
# public:
# typedef pcl::search::Search <PointT> KdTree;
# typedef typename KdTree::Ptr KdTreePtr;
# typedef pcl::PointCloud <NormalT> Normal;
# typedef typename Normal::Ptr NormalPtr;
# typedef pcl::PointCloud <PointT> PointCloud;
# using PCLBase <PointT>::input_;
# using PCLBase <PointT>::indices_;
# using PCLBase <PointT>::initCompute;
# using PCLBase <PointT>::deinitCompute;
# public:
# /** \brief Constructor that sets default values for member variables. */
# RegionGrowing ();
#
# /** \brief This destructor destroys the cloud, normals and search method used for
# * finding KNN. In other words it frees memory.
# */
# virtual ~RegionGrowing ();
#
# /** \brief Get the minimum number of points that a cluster needs to contain in order to be considered valid. */
# int getMinClusterSize ();
#
# /** \brief Set the minimum number of points that a cluster needs to contain in order to be considered valid. */
# void setMinClusterSize (int min_cluster_size);
#
# /** \brief Get the maximum number of points that a cluster needs to contain in order to be considered valid. */
# int getMaxClusterSize ();
#
# /** \brief Set the maximum number of points that a cluster needs to contain in order to be considered valid. */
# void setMaxClusterSize (int max_cluster_size);
#
# /** \brief Returns the flag value. This flag signalizes which mode of algorithm will be used.
# * If it is set to true than it will work as said in the article. This means that
# * it will be testing the angle between normal of the current point and it's neighbours normal.
# * Otherwise, it will be testing the angle between normal of the current point
# * and normal of the initial point that was chosen for growing new segment.
# */
# bool getSmoothModeFlag () const;
#
# /** \brief This function allows to turn on/off the smoothness constraint.
# * \param[in] value new mode value, if set to true then the smooth version will be used.
# */
# void setSmoothModeFlag (bool value);
#
# /** \brief Returns the flag that signalize if the curvature test is turned on/off. */
# bool getCurvatureTestFlag () const;
#
# /** \brief Allows to turn on/off the curvature test. Note that at least one test
# * (residual or curvature) must be turned on. If you are turning curvature test off
# * then residual test will be turned on automatically.
# * \param[in] value new value for curvature test. If set to true then the test will be turned on
# */
# virtual void setCurvatureTestFlag (bool value);
#
# /** \brief Returns the flag that signalize if the residual test is turned on/off. */
# bool getResidualTestFlag () const;
#
# /** \brief
# * Allows to turn on/off the residual test. Note that at least one test
# * (residual or curvature) must be turned on. If you are turning residual test off
# * then curvature test will be turned on automatically.
# * \param[in] value new value for residual test. If set to true then the test will be turned on
# */
# virtual void setResidualTestFlag (bool value);
#
# /** \brief Returns smoothness threshold. */
# float getSmoothnessThreshold () const;
#
# /** \brief Allows to set smoothness threshold used for testing the points.
# * \param[in] theta new threshold value for the angle between normals
# */
# void setSmoothnessThreshold (float theta);
#
# /** \brief Returns residual threshold. */
# float getResidualThreshold () const;
#
# /** \brief Allows to set residual threshold used for testing the points.
# * \param[in] residual new threshold value for residual testing
# */
# void setResidualThreshold (float residual);
#
# /** \brief Returns curvature threshold. */
# float getCurvatureThreshold () const;
#
# /** \brief Allows to set curvature threshold used for testing the points.
# * \param[in] curvature new threshold value for curvature testing
# */
# void setCurvatureThreshold (float curvature);
#
# /** \brief Returns the number of nearest neighbours used for KNN. */
# unsigned int getNumberOfNeighbours () const;
#
# /** \brief Allows to set the number of neighbours. For more information check the article.
# * \param[in] neighbour_number number of neighbours to use
# */
# void setNumberOfNeighbours (unsigned int neighbour_number);
#
# /** \brief Returns the pointer to the search method that is used for KNN. */
# KdTreePtr getSearchMethod () const;
#
# /** \brief Allows to set search method that will be used for finding KNN.
# * \param[in] tree pointer to a KdTree
# */
# void setSearchMethod (const KdTreePtr& tree);
#
# /** \brief Returns normals. */
# NormalPtr getInputNormals () const;
#
# /** \brief This method sets the normals. They are needed for the algorithm, so if
# * no normals will be set, the algorithm would not be able to segment the points.
# * \param[in] norm normals that will be used in the algorithm
# */
# void setInputNormals (const NormalPtr& norm);
#
# /** \brief This method launches the segmentation algorithm and returns the clusters that were
# * obtained during the segmentation.
# * \param[out] clusters clusters that were obtained. Each cluster is an array of point indices.
# */
# virtual void extract (std::vector <pcl::PointIndices>& clusters);
#
# /** \brief For a given point this function builds a segment to which it belongs and returns this segment.
# * \param[in] index index of the initial point which will be the seed for growing a segment.
# * \param[out] cluster cluster to which the point belongs.
# */
# virtual void getSegmentFromPoint (int index, pcl::PointIndices& cluster);
#
# /** \brief If the cloud was successfully segmented, then function
# * returns colored cloud. Otherwise it returns an empty pointer.
# * Points that belong to the same segment have the same color.
# * But this function doesn't guarantee that different segments will have different
# * color(it all depends on RNG). Points that were not listed in the indices array will have red color.
# */
# pcl::PointCloud<pcl::PointXYZRGB>::Ptr getColoredCloud ();
#
# /** \brief If the cloud was successfully segmented, then function
# * returns colored cloud. Otherwise it returns an empty pointer.
# * Points that belong to the same segment have the same color.
# * But this function doesn't guarantee that different segments will have different
# * color(it all depends on RNG). Points that were not listed in the indices array will have red color.
# */
# pcl::PointCloud<pcl::PointXYZRGBA>::Ptr getColoredCloudRGBA ();
###
# region_growing_rgb.h
# namespace pcl
# /** \brief
# * Implements the well known Region Growing algorithm used for segmentation.
# * Description can be found in the article
# * "Segmentation of point clouds using smoothness constraint"
# * by T. Rabbania, F. A. van den Heuvelb, G. Vosselmanc.
# * In addition to residual test, the possibility to test curvature is added.
# */
# template <typename PointT, typename NormalT>
# class PCL_EXPORTS RegionGrowing : public pcl::PCLBase<PointT>
# public:
# typedef pcl::search::Search <PointT> KdTree;
# typedef typename KdTree::Ptr KdTreePtr;
# typedef pcl::PointCloud <NormalT> Normal;
# typedef typename Normal::Ptr NormalPtr;
# typedef pcl::PointCloud <PointT> PointCloud;
# using PCLBase <PointT>::input_;
# using PCLBase <PointT>::indices_;
# using PCLBase <PointT>::initCompute;
# using PCLBase <PointT>::deinitCompute;
# public:
#
# /** \brief Constructor that sets default values for member variables. */
# RegionGrowing ();
#
# /** \brief This destructor destroys the cloud, normals and search method used for
# * finding KNN. In other words it frees memory.
# */
# virtual ~RegionGrowing ();
#
# /** \brief Get the minimum number of points that a cluster needs to contain in order to be considered valid. */
# int getMinClusterSize ();
#
# /** \brief Set the minimum number of points that a cluster needs to contain in order to be considered valid. */
# void setMinClusterSize (int min_cluster_size);
#
# /** \brief Get the maximum number of points that a cluster needs to contain in order to be considered valid. */
# int getMaxClusterSize ();
#
# /** \brief Set the maximum number of points that a cluster needs to contain in order to be considered valid. */
# void setMaxClusterSize (int max_cluster_size);
#
# /** \brief Returns the flag value. This flag signalizes which mode of algorithm will be used.
# * If it is set to true than it will work as said in the article. This means that
# * it will be testing the angle between normal of the current point and it's neighbours normal.
# * Otherwise, it will be testing the angle between normal of the current point
# * and normal of the initial point that was chosen for growing new segment.
# */
# bool getSmoothModeFlag () const;
#
# /** \brief This function allows to turn on/off the smoothness constraint.
# * \param[in] value new mode value, if set to true then the smooth version will be used.
# */
# void setSmoothModeFlag (bool value);
#
# /** \brief Returns the flag that signalize if the curvature test is turned on/off. */
# bool getCurvatureTestFlag () const;
#
# /** \brief Allows to turn on/off the curvature test. Note that at least one test
# * (residual or curvature) must be turned on. If you are turning curvature test off
# * then residual test will be turned on automatically.
# * \param[in] value new value for curvature test. If set to true then the test will be turned on
# */
# virtual void setCurvatureTestFlag (bool value);
#
# /** \brief Returns the flag that signalize if the residual test is turned on/off. */
# bool getResidualTestFlag () const;
#
# /** \brief
# * Allows to turn on/off the residual test. Note that at least one test
# * (residual or curvature) must be turned on. If you are turning residual test off
# * then curvature test will be turned on automatically.
# * \param[in] value new value for residual test. If set to true then the test will be turned on
# */
# virtual void setResidualTestFlag (bool value);
#
# /** \brief Returns smoothness threshold. */
# float getSmoothnessThreshold () const;
#
# /** \brief Allows to set smoothness threshold used for testing the points.
# * \param[in] theta new threshold value for the angle between normals
# */
# void setSmoothnessThreshold (float theta);
#
# /** \brief Returns residual threshold. */
# float getResidualThreshold () const;
#
# /** \brief Allows to set residual threshold used for testing the points.
# * \param[in] residual new threshold value for residual testing
# */
# void setResidualThreshold (float residual);
#
# /** \brief Returns curvature threshold. */
# float getCurvatureThreshold () const;
#
# /** \brief Allows to set curvature threshold used for testing the points.
# * \param[in] curvature new threshold value for curvature testing
# */
# void setCurvatureThreshold (float curvature);
#
# /** \brief Returns the number of nearest neighbours used for KNN. */
# unsigned int getNumberOfNeighbours () const;
#
# /** \brief Allows to set the number of neighbours. For more information check the article.
# * \param[in] neighbour_number number of neighbours to use
# */
# void setNumberOfNeighbours (unsigned int neighbour_number);
#
# /** \brief Returns the pointer to the search method that is used for KNN. */
# KdTreePtr getSearchMethod () const;
#
# /** \brief Allows to set search method that will be used for finding KNN.
# * \param[in] tree pointer to a KdTree
# */
# void setSearchMethod (const KdTreePtr& tree);
#
# /** \brief Returns normals. */
# NormalPtr getInputNormals () const;
#
# /** \brief This method sets the normals. They are needed for the algorithm, so if
# * no normals will be set, the algorithm would not be able to segment the points.
# * \param[in] norm normals that will be used in the algorithm
# */
# void setInputNormals (const NormalPtr& norm);
#
# /** \brief This method launches the segmentation algorithm and returns the clusters that were
# * obtained during the segmentation.
# * \param[out] clusters clusters that were obtained. Each cluster is an array of point indices.
# */
# virtual void extract (std::vector <pcl::PointIndices>& clusters);
#
# /** \brief For a given point this function builds a segment to which it belongs and returns this segment.
# * \param[in] index index of the initial point which will be the seed for growing a segment.
# * \param[out] cluster cluster to which the point belongs.
# */
# virtual void getSegmentFromPoint (int index, pcl::PointIndices& cluster);
#
# /** \brief If the cloud was successfully segmented, then function
# * returns colored cloud. Otherwise it returns an empty pointer.
# * Points that belong to the same segment have the same color.
# * But this function doesn't guarantee that different segments will have different
# * color(it all depends on RNG). Points that were not listed in the indices array will have red color.
# */
# pcl::PointCloud<pcl::PointXYZRGB>::Ptr getColoredCloud ();
#
# /** \brief If the cloud was successfully segmented, then function
# * returns colored cloud. Otherwise it returns an empty pointer.
# * Points that belong to the same segment have the same color.
# * But this function doesn't guarantee that different segments will have different
# * color(it all depends on RNG). Points that were not listed in the indices array will have red color.
# */
# pcl::PointCloud<pcl::PointXYZRGBA>::Ptr getColoredCloudRGBA ();
#
# /** \brief This function is used as a comparator for sorting. */
# inline bool comparePair (std::pair<float, int> i, std::pair<float, int> j)
###
# rgb_plane_coefficient_comparator.h
# namespace pcl
# /** \brief RGBPlaneCoefficientComparator is a Comparator that operates on plane coefficients,
# * for use in planar segmentation. Also takes into account RGB, so we can segmented different colored co-planar regions.
# * In conjunction with OrganizedConnectedComponentSegmentation, this allows planes to be segmented from organized data.
# *
# * \author Alex Trevor
# */
# template<typename PointT, typename PointNT>
# class RGBPlaneCoefficientComparator: public PlaneCoefficientComparator<PointT, PointNT>
# public:
# typedef typename Comparator<PointT>::PointCloud PointCloud;
# typedef typename Comparator<PointT>::PointCloudConstPtr PointCloudConstPtr;
# typedef typename pcl::PointCloud<PointNT> PointCloudN;
# typedef typename PointCloudN::Ptr PointCloudNPtr;
# typedef typename PointCloudN::ConstPtr PointCloudNConstPtr;
# typedef boost::shared_ptr<RGBPlaneCoefficientComparator<PointT, PointNT> > Ptr;
# typedef boost::shared_ptr<const RGBPlaneCoefficientComparator<PointT, PointNT> > ConstPtr;
#
# using pcl::Comparator<PointT>::input_;
# using pcl::PlaneCoefficientComparator<PointT, PointNT>::normals_;
# using pcl::PlaneCoefficientComparator<PointT, PointNT>::angular_threshold_;
# using pcl::PlaneCoefficientComparator<PointT, PointNT>::distance_threshold_;
#
# /** \brief Empty constructor for RGBPlaneCoefficientComparator. */
# RGBPlaneCoefficientComparator ()
# : color_threshold_ (50.0f)
#
# /** \brief Constructor for RGBPlaneCoefficientComparator.
# * \param[in] plane_coeff_d a reference to a vector of d coefficients of plane equations. Must be the same size as the input cloud and input normals. a, b, and c coefficients are in the input normals.
# */
# RGBPlaneCoefficientComparator (boost::shared_ptr<std::vector<float> >& plane_coeff_d)
# : PlaneCoefficientComparator<PointT, PointNT> (plane_coeff_d), color_threshold_ (50.0f)
#
# /** \brief Destructor for RGBPlaneCoefficientComparator. */
# virtual ~RGBPlaneCoefficientComparator ()
#
# /** \brief Set the tolerance in color space between neighboring points, to be considered part of the same plane.
# * \param[in] color_threshold The distance in color space
# */
# inline void setColorThreshold (float color_threshold)
#
# /** \brief Get the color threshold between neighboring points, to be considered part of the same plane. */
# inline float getColorThreshold () const
#
# /** \brief Compare two neighboring points, by using normal information, euclidean distance, and color information.
# * \param[in] idx1 The index of the first point.
# * \param[in] idx2 The index of the second point.
# */
# bool compare (int idx1, int idx2) const
###
# sac_segmentation.h
# namespace pcl
# /** \brief @b SACSegmentation represents the Nodelet segmentation class for
# * Sample Consensus methods and models, in the sense that it just creates a
# * Nodelet wrapper for generic-purpose SAC-based segmentation.
# * \author Radu Bogdan Rusu
# * \ingroup segmentation
# */
# template <typename PointT>
# class SACSegmentation : public PCLBase<PointT>
# using PCLBase<PointT>::initCompute;
# using PCLBase<PointT>::deinitCompute;
# public:
# using PCLBase<PointT>::input_;
# using PCLBase<PointT>::indices_;
# typedef pcl::PointCloud<PointT> PointCloud;
# typedef typename PointCloud::Ptr PointCloudPtr;
# typedef typename PointCloud::ConstPtr PointCloudConstPtr;
# typedef typename pcl::search::Search<PointT>::Ptr SearchPtr;
# typedef typename SampleConsensus<PointT>::Ptr SampleConsensusPtr;
# typedef typename SampleConsensusModel<PointT>::Ptr SampleConsensusModelPtr;
#
# /** \brief Empty constructor.
# * \param[in] random if true set the random seed to the current time, else set to 12345 (default: false)
# */
# SACSegmentation (bool random = false)
# : model_ ()
# , sac_ ()
# , model_type_ (-1)
# , method_type_ (0)
# , threshold_ (0)
# , optimize_coefficients_ (true)
# , radius_min_ (-std::numeric_limits<double>::max ())
# , radius_max_ (std::numeric_limits<double>::max ())
# , samples_radius_ (0.0)
# , samples_radius_search_ ()
# , eps_angle_ (0.0)
# , axis_ (Eigen::Vector3f::Zero ())
# , max_iterations_ (50)
# , probability_ (0.99)
# , random_ (random)
#
# /** \brief Empty destructor. */
# virtual ~SACSegmentation () { /*srv_.reset ();*/ };
#
# /** \brief The type of model to use (user given parameter).
# * \param[in] model the model type (check \a model_types.h)
# */
# inline void setModelType (int model) { model_type_ = model; }
#
# /** \brief Get the type of SAC model used. */
# inline int getModelType () const { return (model_type_); }
#
# /** \brief Get a pointer to the SAC method used. */
# inline SampleConsensusPtr getMethod () const { return (sac_); }
#
# /** \brief Get a pointer to the SAC model used. */
# inline SampleConsensusModelPtr getModel () const { return (model_); }
#
# /** \brief The type of sample consensus method to use (user given parameter).
# * \param[in] method the method type (check \a method_types.h)
# */
# inline void setMethodType (int method) { method_type_ = method; }
#
# /** \brief Get the type of sample consensus method used. */
# inline int getMethodType () const { return (method_type_); }
#
# /** \brief Distance to the model threshold (user given parameter).
# * \param[in] threshold the distance threshold to use
# */
# inline void setDistanceThreshold (double threshold) { threshold_ = threshold; }
#
# /** \brief Get the distance to the model threshold. */
# inline double getDistanceThreshold () const { return (threshold_); }
#
# /** \brief Set the maximum number of iterations before giving up.
# * \param[in] max_iterations the maximum number of iterations the sample consensus method will run
# */
# inline void setMaxIterations (int max_iterations) { max_iterations_ = max_iterations; }
#
# /** \brief Get maximum number of iterations before giving up. */
# inline int getMaxIterations () const { return (max_iterations_); }
#
# /** \brief Set the probability of choosing at least one sample free from outliers.
# * \param[in] probability the model fitting probability
# */
# inline void setProbability (double probability) { probability_ = probability; }
#
# /** \brief Get the probability of choosing at least one sample free from outliers. */
# inline double getProbability () const { return (probability_); }
#
# /** \brief Set to true if a coefficient refinement is required.
# * \param[in] optimize true for enabling model coefficient refinement, false otherwise
# */
# inline void setOptimizeCoefficients (bool optimize) { optimize_coefficients_ = optimize; }
#
# /** \brief Get the coefficient refinement internal flag. */
# inline bool getOptimizeCoefficients () const { return (optimize_coefficients_); }
#
# /** \brief Set the minimum and maximum allowable radius limits for the model (applicable to models that estimate
# * a radius)
# * \param[in] min_radius the minimum radius model
# * \param[in] max_radius the maximum radius model
# */
# inline void setRadiusLimits (const double &min_radius, const double &max_radius)
#
# /** \brief Get the minimum and maximum allowable radius limits for the model as set by the user.
# * \param[out] min_radius the resultant minimum radius model
# * \param[out] max_radius the resultant maximum radius model
# */
# inline void getRadiusLimits (double &min_radius, double &max_radius)
#
# /** \brief Set the maximum distance allowed when drawing random samples
# * \param[in] radius the maximum distance (L2 norm)
# * \param search
# */
# inline void setSamplesMaxDist (const double &radius, SearchPtr search)
#
# /** \brief Get maximum distance allowed when drawing random samples
# *
# * \param[out] radius the maximum distance (L2 norm)
# */
# inline void getSamplesMaxDist (double &radius)
#
# /** \brief Set the axis along which we need to search for a model perpendicular to.
# * \param[in] ax the axis along which we need to search for a model perpendicular to
# */
# inline void setAxis (const Eigen::Vector3f &ax) { axis_ = ax; }
#
# /** \brief Get the axis along which we need to search for a model perpendicular to. */
# inline Eigen::Vector3f getAxis () const { return (axis_); }
#
# /** \brief Set the angle epsilon (delta) threshold.
# * \param[in] ea the maximum allowed difference between the model normal and the given axis in radians.
# */
# inline void setEpsAngle (double ea) { eps_angle_ = ea; }
#
# /** \brief Get the epsilon (delta) model angle threshold in radians. */
# inline double getEpsAngle () const { return (eps_angle_); }
#
# /** \brief Base method for segmentation of a model in a PointCloud given by <setInputCloud (), setIndices ()>
# * \param[in] inliers the resultant point indices that support the model found (inliers)
# * \param[out] model_coefficients the resultant model coefficients
# */
# virtual void segment (PointIndices &inliers, ModelCoefficients &model_coefficients);
###
# sac_segmentation.h
# namespace pcl
# /** \brief @b SACSegmentationFromNormals represents the PCL nodelet segmentation class for Sample Consensus methods and
# * models that require the use of surface normals for estimation.
# * \ingroup segmentation
# */
# template <typename PointT, typename PointNT>
# class SACSegmentationFromNormals: public SACSegmentation<PointT>
# using SACSegmentation<PointT>::model_;
# using SACSegmentation<PointT>::model_type_;
# using SACSegmentation<PointT>::radius_min_;
# using SACSegmentation<PointT>::radius_max_;
# using SACSegmentation<PointT>::eps_angle_;
# using SACSegmentation<PointT>::axis_;
# using SACSegmentation<PointT>::random_;
#
# public:
# using PCLBase<PointT>::input_;
# using PCLBase<PointT>::indices_;
# typedef typename SACSegmentation<PointT>::PointCloud PointCloud;
# typedef typename PointCloud::Ptr PointCloudPtr;
# typedef typename PointCloud::ConstPtr PointCloudConstPtr;
# typedef typename pcl::PointCloud<PointNT> PointCloudN;
# typedef typename PointCloudN::Ptr PointCloudNPtr;
# typedef typename PointCloudN::ConstPtr PointCloudNConstPtr;
# typedef typename SampleConsensus<PointT>::Ptr SampleConsensusPtr;
# typedef typename SampleConsensusModel<PointT>::Ptr SampleConsensusModelPtr;
# typedef typename SampleConsensusModelFromNormals<PointT, PointNT>::Ptr SampleConsensusModelFromNormalsPtr;
#
# /** \brief Empty constructor.
# * \param[in] random if true set the random seed to the current time, else set to 12345 (default: false)
# */
# SACSegmentationFromNormals (bool random = false)
# : SACSegmentation<PointT> (random)
# , normals_ ()
# , distance_weight_ (0.1)
# , distance_from_origin_ (0)
# , min_angle_ ()
# , max_angle_ ()
#
# /** \brief Provide a pointer to the input dataset that contains the point normals of
# * the XYZ dataset.
# * \param[in] normals the const boost shared pointer to a PointCloud message
# */
# inline void setInputNormals (const PointCloudNConstPtr &normals) { normals_ = normals; }
#
# /** \brief Get a pointer to the normals of the input XYZ point cloud dataset. */
# inline PointCloudNConstPtr getInputNormals () const { return (normals_); }
#
# /** \brief Set the relative weight (between 0 and 1) to give to the angular
# * distance (0 to pi/2) between point normals and the plane normal.
# * \param[in] distance_weight the distance/angular weight
# */
# inline void setNormalDistanceWeight (double distance_weight) { distance_weight_ = distance_weight; }
#
# /** \brief Get the relative weight (between 0 and 1) to give to the angular distance (0 to pi/2) between point
# * normals and the plane normal. */
# inline double getNormalDistanceWeight () const { return (distance_weight_); }
#
# /** \brief Set the minimum opning angle for a cone model.
# * \param min_angle the opening angle which we need minumum to validate a cone model.
# * \param max_angle the opening angle which we need maximum to validate a cone model.
# */
# inline void setMinMaxOpeningAngle (const double &min_angle, const double &max_angle)
#
# /** \brief Get the opening angle which we need minumum to validate a cone model. */
# inline void getMinMaxOpeningAngle (double &min_angle, double &max_angle)
#
# /** \brief Set the distance we expect a plane model to be from the origin
# * \param[in] d distance from the template plane modl to the origin
# */
# inline void setDistanceFromOrigin (const double d) { distance_from_origin_ = d; }
#
# /** \brief Get the distance of a plane model from the origin. */
# inline double getDistanceFromOrigin () const { return (distance_from_origin_); }
###
# seeded_hue_segmentation.h
# namespace pcl
# /** \brief Decompose a region of space into clusters based on the Euclidean distance between points
# * \param[in] cloud the point cloud message
# * \param[in] tree the spatial locator (e.g., kd-tree) used for nearest neighbors searching
# * \note the tree has to be created as a spatial locator on \a cloud
# * \param[in] tolerance the spatial cluster tolerance as a measure in L2 Euclidean space
# * \param[in] indices_in the cluster containing the seed point indices (as a vector of PointIndices)
# * \param[out] indices_out
# * \param[in] delta_hue
# * \todo look how to make this templated!
# * \ingroup segmentation
# */
# void seededHueSegmentation (
# const PointCloud<PointXYZRGB> &cloud,
# const boost::shared_ptr<search::Search<PointXYZRGB> > &tree,
# float tolerance,
# PointIndices &indices_in,
# PointIndices &indices_out,
# float delta_hue = 0.0);
###
# seeded_hue_segmentation.h
# namespace pcl
# /** \brief Decompose a region of space into clusters based on the Euclidean distance between points
# * \param[in] cloud the point cloud message
# * \param[in] tree the spatial locator (e.g., kd-tree) used for nearest neighbors searching
# * \note the tree has to be created as a spatial locator on \a cloud
# * \param[in] tolerance the spatial cluster tolerance as a measure in L2 Euclidean space
# * \param[in] indices_in the cluster containing the seed point indices (as a vector of PointIndices)
# * \param[out] indices_out
# * \param[in] delta_hue
# * \todo look how to make this templated!
# * \ingroup segmentation
# */
# void
# seededHueSegmentation (const PointCloud<PointXYZRGB> &cloud,
# const boost::shared_ptr<search::Search<PointXYZRGBL> > &tree,
# float tolerance,
# PointIndices &indices_in,
# PointIndices &indices_out,
# float delta_hue = 0.0);
#
###
# seeded_hue_segmentation.h
# namespace pcl
# /** \brief SeededHueSegmentation
# * \author Koen Buys
# * \ingroup segmentation
# */
# class SeededHueSegmentation: public PCLBase<PointXYZRGB>
# {
# typedef PCLBase<PointXYZRGB> BasePCLBase;
#
# public:
# typedef pcl::PointCloud<PointXYZRGB> PointCloud;
# typedef PointCloud::Ptr PointCloudPtr;
# typedef PointCloud::ConstPtr PointCloudConstPtr;
#
# typedef pcl::search::Search<PointXYZRGB> KdTree;
# typedef pcl::search::Search<PointXYZRGB>::Ptr KdTreePtr;
#
# typedef PointIndices::Ptr PointIndicesPtr;
# typedef PointIndices::ConstPtr PointIndicesConstPtr;
#
# //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
# /** \brief Empty constructor. */
# SeededHueSegmentation () : tree_ (), cluster_tolerance_ (0), delta_hue_ (0.0)
# {};
#
# /** \brief Provide a pointer to the search object.
# * \param[in] tree a pointer to the spatial search object.
# */
# inline void
# setSearchMethod (const KdTreePtr &tree) { tree_ = tree; }
#
# /** \brief Get a pointer to the search method used. */
# inline KdTreePtr
# getSearchMethod () const { return (tree_); }
#
# /** \brief Set the spatial cluster tolerance as a measure in the L2 Euclidean space
# * \param[in] tolerance the spatial cluster tolerance as a measure in the L2 Euclidean space
# */
# inline void
# setClusterTolerance (double tolerance) { cluster_tolerance_ = tolerance; }
#
# /** \brief Get the spatial cluster tolerance as a measure in the L2 Euclidean space. */
# inline double
# getClusterTolerance () const { return (cluster_tolerance_); }
#
# /** \brief Set the tollerance on the hue
# * \param[in] delta_hue the new delta hue
# */
# inline void setDeltaHue (float delta_hue) { delta_hue_ = delta_hue; }
#
# /** \brief Get the tolerance on the hue */
# inline float getDeltaHue () const { return (delta_hue_); }
#
# /** \brief Cluster extraction in a PointCloud given by <setInputCloud (), setIndices ()>
# * \param[in] indices_in
# * \param[out] indices_out
# */
# void segment (PointIndices &indices_in, PointIndices &indices_out);
###
# segment_differences.h
# namespace pcl
# /** \brief Obtain the difference between two aligned point clouds as another point cloud, given a distance threshold.
# * \param src the input point cloud source
# * \param tgt the input point cloud target we need to obtain the difference against
# * \param threshold the distance threshold (tolerance) for point correspondences. (e.g., check if f a point p1 from
# * src has a correspondence > threshold than a point p2 from tgt)
# * \param tree the spatial locator (e.g., kd-tree) used for nearest neighbors searching built over \a tgt
# * \param output the resultant output point cloud difference
# * \ingroup segmentation
# */
# template <typename PointT>
# void getPointCloudDifference (
# const pcl::PointCloud<PointT> &src, const pcl::PointCloud<PointT> &tgt,
# double threshold, const boost::shared_ptr<pcl::search::Search<PointT> > &tree,
# pcl::PointCloud<PointT> &output);
###
# segment_differences.h
# namespace pcl
# /** \brief @b SegmentDifferences obtains the difference between two spatially
# * aligned point clouds and returns the difference between them for a maximum
# * given distance threshold.
# * \author Radu Bogdan Rusu
# * \ingroup segmentation
# */
# template <typename PointT>
# class SegmentDifferences: public PCLBase<PointT>
# typedef PCLBase<PointT> BasePCLBase;
#
# public:
# typedef pcl::PointCloud<PointT> PointCloud;
# typedef typename PointCloud::Ptr PointCloudPtr;
# typedef typename PointCloud::ConstPtr PointCloudConstPtr;
# typedef typename pcl::search::Search<PointT> KdTree;
# typedef typename pcl::search::Search<PointT>::Ptr KdTreePtr;
# typedef PointIndices::Ptr PointIndicesPtr;
# typedef PointIndices::ConstPtr PointIndicesConstPtr;
#
# /** \brief Empty constructor. */
# SegmentDifferences () :
# tree_ (), target_ (), distance_threshold_ (0)
# {};
#
# /** \brief Provide a pointer to the target dataset against which we
# * compare the input cloud given in setInputCloud
# *
# * \param cloud the target PointCloud dataset
# */
# inline void setTargetCloud (const PointCloudConstPtr &cloud) { target_ = cloud; }
#
# /** \brief Get a pointer to the input target point cloud dataset. */
# inline PointCloudConstPtr const getTargetCloud () { return (target_); }
#
# /** \brief Provide a pointer to the search object.
# * \param tree a pointer to the spatial search object.
# */
# inline void setSearchMethod (const KdTreePtr &tree) { tree_ = tree; }
#
# /** \brief Get a pointer to the search method used. */
# inline KdTreePtr getSearchMethod () { return (tree_); }
#
# /** \brief Set the maximum distance tolerance (squared) between corresponding
# * points in the two input datasets.
# * \param sqr_threshold the squared distance tolerance as a measure in L2 Euclidean space
# */
# inline void setDistanceThreshold (double sqr_threshold) { distance_threshold_ = sqr_threshold; }
#
# /** \brief Get the squared distance tolerance between corresponding points as a
# * measure in the L2 Euclidean space.
# */
# inline double getDistanceThreshold () { return (distance_threshold_); }
#
# /** \brief Segment differences between two input point clouds.
# * \param output the resultant difference between the two point clouds as a PointCloud
# */
# void segment (PointCloud &output);
###
# supervoxel_clustering.h
# namespace pcl
# /** \brief Supervoxel container class - stores a cluster extracted using supervoxel clustering
# */
# template <typename PointT>
# class Supervoxel
# public:
# Supervoxel () :
# voxels_ (new pcl::PointCloud<PointT> ()),
# normals_ (new pcl::PointCloud<Normal> ())
#
# typedef boost::shared_ptr<Supervoxel<PointT> > Ptr;
# typedef boost::shared_ptr<const Supervoxel<PointT> > ConstPtr;
#
# /** \brief Gets the centroid of the supervoxel
# * \param[out] centroid_arg centroid of the supervoxel
# */
# void getCentroidPoint (PointXYZRGBA ¢roid_arg)
#
# /** \brief Gets the point normal for the supervoxel
# * \param[out] normal_arg Point normal of the supervoxel
# * \note This isn't an average, it is a normal computed using all of the voxels in the supervoxel as support
# */
# void getCentroidPointNormal (PointNormal &normal_arg)
###
# # supervoxel_clustering.h
# namespace pcl
# /** \brief Implements a supervoxel algorithm based on voxel structure, normals, and rgb values
# * \note Supervoxels are oversegmented volumetric patches (usually surfaces)
# * \note Usually, color isn't needed (and can be detrimental)- spatial structure is mainly used
# * - J. Papon, A. Abramov, M. Schoeler, F. Woergoetter
# * Voxel Cloud Connectivity Segmentation - Supervoxels from PointClouds
# * In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) 2013
# * \author Jeremie Papon (jpapon@gmail.com)
# */
# template <typename PointT>
# class PCL_EXPORTS SupervoxelClustering : public pcl::PCLBase<PointT>
# {
# //Forward declaration of friended helper class
# class SupervoxelHelper;
# friend class SupervoxelHelper;
# public:
# /** \brief VoxelData is a structure used for storing data within a pcl::octree::OctreePointCloudAdjacencyContainer
# * \note It stores xyz, rgb, normal, distance, an index, and an owner.
# */
# class VoxelData
# {
# public:
# VoxelData ():
# xyz_ (0.0f, 0.0f, 0.0f),
# rgb_ (0.0f, 0.0f, 0.0f),
# normal_ (0.0f, 0.0f, 0.0f, 0.0f),
# curvature_ (0.0f),
# owner_ (0)
# {}
#
# /** \brief Gets the data of in the form of a point
# * \param[out] point_arg Will contain the point value of the voxeldata
# */
# void
# getPoint (PointT &point_arg) const;
#
# /** \brief Gets the data of in the form of a normal
# * \param[out] normal_arg Will contain the normal value of the voxeldata
# */
# void
# getNormal (Normal &normal_arg) const;
#
# Eigen::Vector3f xyz_;
# Eigen::Vector3f rgb_;
# Eigen::Vector4f normal_;
# float curvature_;
# float distance_;
# int idx_;
# SupervoxelHelper* owner_;
#
# public:
# EIGEN_MAKE_ALIGNED_OPERATOR_NEW
# };
#
# typedef pcl::octree::OctreePointCloudAdjacencyContainer<PointT, VoxelData> LeafContainerT;
# typedef std::vector <LeafContainerT*> LeafVectorT;
# typedef typename pcl::PointCloud<PointT> PointCloudT;
# typedef typename pcl::PointCloud<Normal> NormalCloudT;
# typedef typename pcl::octree::OctreePointCloudAdjacency<PointT, LeafContainerT> OctreeAdjacencyT;
# typedef typename pcl::octree::OctreePointCloudSearch <PointT> OctreeSearchT;
# typedef typename pcl::search::KdTree<PointT> KdTreeT;
# typedef boost::shared_ptr<std::vector<int> > IndicesPtr;
#
# using PCLBase <PointT>::initCompute;
# using PCLBase <PointT>::deinitCompute;
# using PCLBase <PointT>::input_;
#
# typedef boost::adjacency_list<boost::setS, boost::setS, boost::undirectedS, uint32_t, float> VoxelAdjacencyList;
# typedef VoxelAdjacencyList::vertex_descriptor VoxelID;
# typedef VoxelAdjacencyList::edge_descriptor EdgeID;
#
#
# public:
#
# /** \brief Constructor that sets default values for member variables.
# * \param[in] voxel_resolution The resolution (in meters) of voxels used
# * \param[in] seed_resolution The average size (in meters) of resulting supervoxels
# * \param[in] use_single_camera_transform Set to true if point density in cloud falls off with distance from origin (such as with a cloud coming from one stationary camera), set false if input cloud is from multiple captures from multiple locations.
# */
# SupervoxelClustering (float voxel_resolution, float seed_resolution, bool use_single_camera_transform = true);
#
# /** \brief This destructor destroys the cloud, normals and search method used for
# * finding neighbors. In other words it frees memory.
# */
# virtual
# ~SupervoxelClustering ();
#
# /** \brief Set the resolution of the octree voxels */
# void
# setVoxelResolution (float resolution);
#
# /** \brief Get the resolution of the octree voxels */
# float
# getVoxelResolution () const;
#
# /** \brief Set the resolution of the octree seed voxels */
# void
# setSeedResolution (float seed_resolution);
#
# /** \brief Get the resolution of the octree seed voxels */
# float
# getSeedResolution () const;
#
# /** \brief Set the importance of color for supervoxels */
# void
# setColorImportance (float val);
#
# /** \brief Set the importance of spatial distance for supervoxels */
# void
# setSpatialImportance (float val);
#
# /** \brief Set the importance of scalar normal product for supervoxels */
# void
# setNormalImportance (float val);
#
# /** \brief This method launches the segmentation algorithm and returns the supervoxels that were
# * obtained during the segmentation.
# * \param[out] supervoxel_clusters A map of labels to pointers to supervoxel structures
# */
# virtual void
# extract (std::map<uint32_t,typename Supervoxel<PointT>::Ptr > &supervoxel_clusters);
#
# /** \brief This method sets the cloud to be supervoxelized
# * \param[in] cloud The cloud to be supervoxelize
# */
# virtual void
# setInputCloud (const typename pcl::PointCloud<PointT>::ConstPtr& cloud);
#
# /** \brief This method sets the normals to be used for supervoxels (should be same size as input cloud)
# * \param[in] normal_cloud The input normals
# */
# virtual void
# setNormalCloud (typename NormalCloudT::ConstPtr normal_cloud);
#
# /** \brief This method refines the calculated supervoxels - may only be called after extract
# * \param[in] num_itr The number of iterations of refinement to be done (2 or 3 is usually sufficient)
# * \param[out] supervoxel_clusters The resulting refined supervoxels
# */
# virtual void
# refineSupervoxels (int num_itr, std::map<uint32_t,typename Supervoxel<PointT>::Ptr > &supervoxel_clusters);
#
# ////////////////////////////////////////////////////////////
# /** \brief Returns an RGB colorized cloud showing superpixels
# * Otherwise it returns an empty pointer.
# * Points that belong to the same supervoxel have the same color.
# * But this function doesn't guarantee that different segments will have different
# * color(it's random). Points that are unlabeled will be black
# * \note This will expand the label_colors_ vector so that it can accomodate all labels
# */
# typename pcl::PointCloud<PointXYZRGBA>::Ptr
# getColoredCloud () const;
#
# /** \brief Returns a deep copy of the voxel centroid cloud */
# typename pcl::PointCloud<PointT>::Ptr
# getVoxelCentroidCloud () const;
#
# /** \brief Returns labeled cloud
# * Points that belong to the same supervoxel have the same label.
# * Labels for segments start from 1, unlabled points have label 0
# */
# typename pcl::PointCloud<PointXYZL>::Ptr
# getLabeledCloud () const;
#
# /** \brief Returns an RGB colorized voxelized cloud showing superpixels
# * Otherwise it returns an empty pointer.
# * Points that belong to the same supervoxel have the same color.
# * But this function doesn't guarantee that different segments will have different
# * color(it's random). Points that are unlabeled will be black
# * \note This will expand the label_colors_ vector so that it can accomodate all labels
# */
# pcl::PointCloud<pcl::PointXYZRGBA>::Ptr
# getColoredVoxelCloud () const;
#
# /** \brief Returns labeled voxelized cloud
# * Points that belong to the same supervoxel have the same label.
# * Labels for segments start from 1, unlabled points have label 0
# */
# pcl::PointCloud<pcl::PointXYZL>::Ptr
# getLabeledVoxelCloud () const;
#
# /** \brief Gets the adjacency list (Boost Graph library) which gives connections between supervoxels
# * \param[out] adjacency_list_arg BGL graph where supervoxel labels are vertices, edges are touching relationships
# */
# void
# getSupervoxelAdjacencyList (VoxelAdjacencyList &adjacency_list_arg) const;
#
# /** \brief Get a multimap which gives supervoxel adjacency
# * \param[out] label_adjacency Multi-Map which maps a supervoxel label to all adjacent supervoxel labels
# */
# void getSupervoxelAdjacency (std::multimap<uint32_t, uint32_t> &label_adjacency) const;
#
# /** \brief Static helper function which returns a pointcloud of normals for the input supervoxels
# * \param[in] supervoxel_clusters Supervoxel cluster map coming from this class
# * \returns Cloud of PointNormals of the supervoxels
# *
# */
# static pcl::PointCloud<pcl::PointNormal>::Ptr
# makeSupervoxelNormalCloud (std::map<uint32_t,typename Supervoxel<PointT>::Ptr > &supervoxel_clusters);
#
# /** \brief Returns the current maximum (highest) label */
# int getMaxLabel () const;
# };
#
# }
###
|