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
|
@@ -58,8 +58,8 @@ else () endif () if (BUILD_GLEW) - add_subdirectory(glew) - INSTALL_HEADERS(glew) + #add_subdirectory(glew) + #INSTALL_HEADERS(glew) endif () # GLFW @@ -94,14 +94,14 @@ else () endif () if (BUILD_GLFW) - add_subdirectory(GLFW) - INSTALL_HEADERS(GLFW) - list(APPEND GLFW_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR}) - list(APPEND GLFW_LIBRARIES ${OPENGL_gl_LIBRARY}) + #add_subdirectory(GLFW) + #INSTALL_HEADERS(GLFW) + #list(APPEND GLFW_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR}) + #list(APPEND GLFW_LIBRARIES ${OPENGL_gl_LIBRARY}) endif () # Azure Kinect -include(azure_kinect/azure_kinect.cmake) +#include(azure_kinect/azure_kinect.cmake) # JSONCPP if ((APPLE) AND ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")) @@ -166,8 +166,8 @@ else () endif () if (BUILD_JPEG) - message(STATUS "Building libjpeg-turbo from source") - include(libjpeg-turbo/libjpeg-turbo.cmake) + #message(STATUS "Building libjpeg-turbo from source") + #include(libjpeg-turbo/libjpeg-turbo.cmake) endif() # PyBind @@ -323,11 +323,11 @@ list(APPEND 3RDPARTY_INCLUDE_DIRS ${flann_INCLUDE_DIRS} ${GLEW_INCLUDE_DIRS} ${GLFW_INCLUDE_DIRS} - ${JPEG_TURBO_INCLUDE_DIRS} + #${JPEG_TURBO_INCLUDE_DIRS} ${JSONCPP_INCLUDE_DIRS} ${liblzf_INCLUDE_DIRS} ${tomasakeninemoeller_INCLUDE_DIRS} - ${librealsense_INCLUDE_DIRS} + #${librealsense_INCLUDE_DIRS} ${PNG_INCLUDE_DIRS} ${rply_INCLUDE_DIRS} ${tinyfiledialogs_INCLUDE_DIRS} @@ -336,7 +336,7 @@ list(APPEND 3RDPARTY_INCLUDE_DIRS ${qhull_INCLUDE_DIRS} ${googletest_INCLUDE_DIRS} ${fmt_INCLUDE_DIRS} - ${k4a_INCLUDE_DIRS} + #${k4a_INCLUDE_DIRS} ${poisson_INCLUDE_DIRS} ) @@ -356,14 +356,14 @@ list(APPEND 3RDPARTY_LIBRARY_DIRS ${GLFW_LIBRARY_DIRS} ${JSONCPP_LIBRARY_DIRS} ${PNG_LIBRARY_DIRS} - ${JPEG_TURBO_LIBRARY_DIRS} + #${JPEG_TURBO_LIBRARY_DIRS} ) # set 3RDPARTY_LIBRARIES list(APPEND 3RDPARTY_LIBRARIES ${GLEW_LIBRARIES} ${GLFW_LIBRARIES} - ${JPEG_TURBO_LIBRARIES} + #${JPEG_TURBO_LIBRARIES} ${JSONCPP_LIBRARIES} ${PNG_LIBRARIES} ${tinyfiledialogs_LIBRARIES}
@@ -9,7 +9,7 @@ function(ShowAndAbortOnWarning trgt) endfunction() add_subdirectory(Open3D) -add_subdirectory(Tools) +#add_subdirectory(Tools) if (BUILD_UNIT_TESTS) add_subdirectory(UnitTest) endif ()
@@ -13,7 +13,7 @@ add_subdirectory(Odometry) add_subdirectory(Registration) add_subdirectory(Utility) add_subdirectory(IO) -add_subdirectory(Visualization) +#add_subdirectory(Visualization) # Source group for Visual Studio ADD_SOURCE_GROUP(Camera) @@ -24,7 +24,7 @@ ADD_SOURCE_GROUP(Odometry) ADD_SOURCE_GROUP(Registration) ADD_SOURCE_GROUP(Utility) ADD_SOURCE_GROUP(IO) -ADD_SOURCE_GROUP(Visualization) +#ADD_SOURCE_GROUP(Visualization) # Install headers install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" @@ -47,7 +47,7 @@ add_library(${CMAKE_PROJECT_NAME} $<TARGET_OBJECTS:Registration> $<TARGET_OBJECTS:Utility> $<TARGET_OBJECTS:IO> - $<TARGET_OBJECTS:Visualization> + #$<TARGET_OBJECTS:Visualization> ) ShowAndAbortOnWarning(${CMAKE_PROJECT_NAME}) @@ -57,8 +57,8 @@ if (ENABLE_HEADLESS_RENDERING) include_directories(${OSMESA_INCLUDE_DIR}) target_link_libraries(${CMAKE_PROJECT_NAME} ${OSMESA_LIBRARY}) else () - find_package(OpenGL REQUIRED) - target_link_libraries(${CMAKE_PROJECT_NAME} ${OPENGL_LIBRARIES}) + #find_package(OpenGL REQUIRED) + #target_link_libraries(${CMAKE_PROJECT_NAME} ${OPENGL_LIBRARIES}) endif () target_link_libraries(${CMAKE_PROJECT_NAME}
@@ -27,8 +27,6 @@ #include <cstddef> #include <cstdio> -#include <jpeglib.h> // Include after cstddef to define size_t - #include "Open3D/IO/ClassIO/ImageIO.h" #include "Open3D/Utility/Console.h" #include "Open3D/Utility/FileSystem.h" @@ -37,109 +35,14 @@ namespace open3d { namespace io { bool ReadImageFromJPG(const std::string &filename, geometry::Image &image) { - struct jpeg_decompress_struct cinfo; - struct jpeg_error_mgr jerr; - FILE *file_in; - JSAMPARRAY buffer; - - if ((file_in = utility::filesystem::FOpen(filename, "rb")) == NULL) { - utility::LogWarning("Read JPG failed: unable to open file: {}", - filename); - return false; - } - - cinfo.err = jpeg_std_error(&jerr); - jpeg_create_decompress(&cinfo); - jpeg_stdio_src(&cinfo, file_in); - jpeg_read_header(&cinfo, TRUE); - - // We only support two channel types: gray, and RGB. - int num_of_channels = 3; - int bytes_per_channel = 1; - switch (cinfo.jpeg_color_space) { - case JCS_RGB: - case JCS_YCbCr: - cinfo.out_color_space = JCS_RGB; - cinfo.out_color_components = 3; - num_of_channels = 3; - break; - case JCS_GRAYSCALE: - cinfo.jpeg_color_space = JCS_GRAYSCALE; - cinfo.out_color_components = 1; - num_of_channels = 1; - break; - case JCS_CMYK: - case JCS_YCCK: - default: - utility::LogWarning("Read JPG failed: color space not supported."); - jpeg_destroy_decompress(&cinfo); - fclose(file_in); - return false; - } - jpeg_start_decompress(&cinfo); - image.Prepare(cinfo.output_width, cinfo.output_height, num_of_channels, - bytes_per_channel); - int row_stride = cinfo.output_width * cinfo.output_components; - buffer = (*cinfo.mem->alloc_sarray)((j_common_ptr)&cinfo, JPOOL_IMAGE, - row_stride, 1); - uint8_t *pdata = image.data_.data(); - while (cinfo.output_scanline < cinfo.output_height) { - jpeg_read_scanlines(&cinfo, buffer, 1); - memcpy(pdata, buffer[0], row_stride); - pdata += row_stride; - } - jpeg_finish_decompress(&cinfo); - jpeg_destroy_decompress(&cinfo); - fclose(file_in); + return true; } bool WriteImageToJPG(const std::string &filename, const geometry::Image &image, int quality /* = 90*/) { - if (image.HasData() == false) { - utility::LogWarning("Write JPG failed: image has no data."); - return false; - } - if (image.bytes_per_channel_ != 1 || - (image.num_of_channels_ != 1 && image.num_of_channels_ != 3)) { - utility::LogWarning("Write JPG failed: unsupported image data."); - return false; - } - struct jpeg_compress_struct cinfo; - struct jpeg_error_mgr jerr; - FILE *file_out; - JSAMPROW row_pointer[1]; - - if ((file_out = utility::filesystem::FOpen(filename, "wb")) == NULL) { - utility::LogWarning("Write JPG failed: unable to open file: {}", - filename); - return false; - } - - cinfo.err = jpeg_std_error(&jerr); - jpeg_create_compress(&cinfo); - jpeg_stdio_dest(&cinfo, file_out); - cinfo.image_width = image.width_; - cinfo.image_height = image.height_; - cinfo.input_components = image.num_of_channels_; - cinfo.in_color_space = - (cinfo.input_components == 1 ? JCS_GRAYSCALE : JCS_RGB); - jpeg_set_defaults(&cinfo); - jpeg_set_quality(&cinfo, quality, TRUE); - jpeg_start_compress(&cinfo, TRUE); - int row_stride = image.width_ * image.num_of_channels_; - const uint8_t *pdata = image.data_.data(); - std::vector<uint8_t> buffer(row_stride); - while (cinfo.next_scanline < cinfo.image_height) { - memcpy(buffer.data(), pdata, row_stride); - row_pointer[0] = buffer.data(); - jpeg_write_scanlines(&cinfo, row_pointer, 1); - pdata += row_stride; - } - jpeg_finish_compress(&cinfo); - fclose(file_out); - jpeg_destroy_compress(&cinfo); + return true; }
deleted file mode 100644
@@ -1,121 +0,0 @@ -// ---------------------------------------------------------------------------- -// - Open3D: www.open3d.org - -// ---------------------------------------------------------------------------- -// The MIT License (MIT) -// -// Copyright (c) 2019 www.open3d.org -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -// ---------------------------------------------------------------------------- - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#include "Open3D/IO/Sensor/AzureKinect/AzureKinectRecorder.h" - -#include <assert.h> -#include <Eigen/Core> -#include <algorithm> -#include <atomic> -#include <ctime> -#include <iostream> - -#include <k4a/k4a.h> -#include <k4arecord/record.h> - -#include "Open3D/Geometry/RGBDImage.h" -#include "Open3D/IO/Sensor/AzureKinect/K4aPlugin.h" -#include "Open3D/IO/Sensor/AzureKinect/MKVReader.h" -#include "Open3D/Visualization/Utility/ColorMap.h" -#include "Open3D/Visualization/Visualizer/VisualizerWithKeyCallback.h" - -namespace open3d { -namespace io { - -AzureKinectRecorder::AzureKinectRecorder( - const AzureKinectSensorConfig& sensor_config, size_t sensor_index) - : RGBDRecorder(), - sensor_(AzureKinectSensor(sensor_config)), - device_index_(sensor_index) {} - -AzureKinectRecorder::~AzureKinectRecorder() { CloseRecord(); } - -bool AzureKinectRecorder::InitSensor() { - return sensor_.Connect(device_index_); -} - -bool AzureKinectRecorder::OpenRecord(const std::string& filename) { - if (!is_record_created_) { - if (K4A_FAILED(k4a_plugin::k4a_record_create( - filename.c_str(), sensor_.device_, - sensor_.sensor_config_.ConvertToNativeConfig(), - &recording_))) { - utility::LogWarning("Unable to create recording file: {}", - filename); - return false; - } - if (K4A_FAILED(k4a_plugin::k4a_record_write_header(recording_))) { - utility::LogWarning("Unable to write header"); - return false; - } - utility::LogInfo("Writing to header"); - - is_record_created_ = true; - } - return true; -} - -bool AzureKinectRecorder::CloseRecord() { - if (is_record_created_) { - utility::LogInfo("Saving recording..."); - if (K4A_FAILED(k4a_plugin::k4a_record_flush(recording_))) { - utility::LogWarning("Unable to flush record file"); - return false; - } - k4a_plugin::k4a_record_close(recording_); - utility::LogInfo("Done"); - - is_record_created_ = false; - } - return true; -} - -std::shared_ptr<geometry::RGBDImage> AzureKinectRecorder::RecordFrame( - bool write, bool enable_align_depth_to_color) { - k4a_capture_t capture = sensor_.CaptureRawFrame(); - if (capture != nullptr && is_record_created_ && write) { - if (K4A_FAILED(k4a_plugin::k4a_record_write_capture(recording_, - capture))) { - utility::LogError("Unable to write to capture"); - } - } - - auto im_rgbd = AzureKinectSensor::DecompressCapture( - capture, enable_align_depth_to_color - ? sensor_.transform_depth_to_color_ - : nullptr); - if (im_rgbd == nullptr) { - utility::LogInfo("Invalid capture, skipping this frame"); - return nullptr; - } - k4a_plugin::k4a_capture_release(capture); - return im_rgbd; -} -} // namespace io -} // namespace open3d
deleted file mode 100644
@@ -1,71 +0,0 @@ -// ---------------------------------------------------------------------------- -// - Open3D: www.open3d.org - -// ---------------------------------------------------------------------------- -// The MIT License (MIT) -// -// Copyright (c) 2019 www.open3d.org -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -// ---------------------------------------------------------------------------- - -#pragma once - -#include <atomic> -#include <memory> -#include <string> - -#include "Open3D/IO/Sensor/AzureKinect/AzureKinectSensor.h" -#include "Open3D/IO/Sensor/AzureKinect/AzureKinectSensorConfig.h" -#include "Open3D/IO/Sensor/RGBDRecorder.h" - -struct _k4a_record_t; // typedef _k4a_record_t* k4a_record_t; - -namespace open3d { - -namespace geometry { -class RGBDImage; -class Image; -} // namespace geometry - -namespace io { - -class AzureKinectRecorder : public RGBDRecorder { -public: - AzureKinectRecorder(const AzureKinectSensorConfig& sensor_config, - size_t sensor_index); - ~AzureKinectRecorder() override; - - bool InitSensor() override; - bool OpenRecord(const std::string& filename) override; - bool CloseRecord() override; - std::shared_ptr<geometry::RGBDImage> RecordFrame( - bool write, bool enable_align_depth_to_color) override; - - bool IsRecordCreated() { return is_record_created_; } - -protected: - AzureKinectSensor sensor_; - _k4a_record_t* recording_; - size_t device_index_; - - bool is_record_created_ = false; -}; - -} // namespace io -} // namespace open3d
deleted file mode 100644
@@ -1,332 +0,0 @@ -// ---------------------------------------------------------------------------- -// - Open3D: www.open3d.org - -// ---------------------------------------------------------------------------- -// The MIT License (MIT) -// -// Copyright (c) 2018 www.open3d.org -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -// ---------------------------------------------------------------------------- - -#include "Open3D/IO/Sensor/AzureKinect/AzureKinectSensor.h" - -#include <k4a/k4a.h> -#include <k4arecord/record.h> -#include <turbojpeg.h> -#include <memory> - -#include "Open3D/Geometry/RGBDImage.h" -#include "Open3D/IO/Sensor/AzureKinect/K4aPlugin.h" - -namespace open3d { -namespace io { - -AzureKinectSensor::AzureKinectSensor( - const AzureKinectSensorConfig &sensor_config) - : RGBDSensor(), sensor_config_(sensor_config) {} - -AzureKinectSensor::~AzureKinectSensor() { - k4a_plugin::k4a_device_stop_cameras(device_); - k4a_plugin::k4a_device_close(device_); -} - -bool AzureKinectSensor::Connect(size_t sensor_index) { - utility::LogInfo("AzureKinectSensor::Connect"); - utility::LogInfo("sensor_index {}", sensor_index); - auto device_config = sensor_config_.ConvertToNativeConfig(); - - // check mode - int camera_fps; - switch (device_config.camera_fps) { - case K4A_FRAMES_PER_SECOND_5: - camera_fps = 5; - break; - case K4A_FRAMES_PER_SECOND_15: - camera_fps = 15; - break; - case K4A_FRAMES_PER_SECOND_30: - camera_fps = 30; - break; - default: - camera_fps = 30; - break; - } - timeout_ = int(1000.0f / camera_fps); - - if (device_config.color_resolution == K4A_COLOR_RESOLUTION_OFF && - device_config.depth_mode == K4A_DEPTH_MODE_OFF) { - utility::LogWarning( - "Config error: either the color or depth modes must be " - "enabled to record."); - return false; - } - - // check available devices - const uint32_t installed_devices = - k4a_plugin::k4a_device_get_installed_count(); - if (sensor_index >= installed_devices) { - utility::LogWarning("Device not found."); - return false; - } - - // open device - if (K4A_FAILED(k4a_plugin::k4a_device_open(sensor_index, &device_))) { - utility::LogWarning( - "Runtime error: k4a_plugin::k4a_device_open() failed"); - return false; - } - - // get and print device info - PrintFirmware(device_); - - if (K4A_FAILED(k4a_plugin::k4a_device_start_cameras(device_, - &device_config))) { - utility::LogWarning( - "Runtime error: k4a_plugin::k4a_device_set_color_control() " - "failed"); - k4a_plugin::k4a_device_close(device_); - return false; - } - - // set color control, assume absoluteExposureValue == 0 - if (K4A_FAILED(k4a_plugin::k4a_device_set_color_control( - device_, K4A_COLOR_CONTROL_EXPOSURE_TIME_ABSOLUTE, - K4A_COLOR_CONTROL_MODE_AUTO, 0))) { - utility::LogWarning( - "Runtime error: k4a_plugin::k4a_device_set_color_control() " - "failed"); - k4a_plugin::k4a_device_close(device_); - return false; - } - - // set calibration - k4a_calibration_t calibration; - k4a_plugin::k4a_device_get_calibration(device_, device_config.depth_mode, - device_config.color_resolution, - &calibration); - transform_depth_to_color_ = - k4a_plugin::k4a_transformation_create(&calibration); - - return true; -} - -k4a_capture_t AzureKinectSensor::CaptureRawFrame() const { - k4a_capture_t capture; - auto result = - k4a_plugin::k4a_device_get_capture(device_, &capture, timeout_); - if (result == K4A_WAIT_RESULT_TIMEOUT) { - return nullptr; - } else if (result != K4A_WAIT_RESULT_SUCCEEDED) { - utility::LogWarning( - "Runtime error: k4a_plugin::k4a_device_get_capture() returned " - "{}", - result); - return nullptr; - } - - return capture; -} - -std::shared_ptr<geometry::RGBDImage> AzureKinectSensor::CaptureFrame( - bool enable_align_depth_to_color) const { - k4a_capture_t capture = CaptureRawFrame(); - auto im_rgbd = DecompressCapture( - capture, - enable_align_depth_to_color ? transform_depth_to_color_ : nullptr); - k4a_plugin::k4a_capture_release(capture); - return im_rgbd; -} - -void ConvertBGRAToRGB(geometry::Image &bgra, geometry::Image &rgb) { - if (bgra.bytes_per_channel_ != 1) { - utility::LogError("BGRA input image must have 1 byte per channel."); - } - if (rgb.bytes_per_channel_ != 1) { - utility::LogError("RGB output image must have 1 byte per channel."); - } - if (bgra.num_of_channels_ != 4) { - utility::LogError("BGRA input image must have 4 channels."); - } - if (rgb.num_of_channels_ != 3) { - utility::LogError("RGB output image must have 3 channels."); - } - if (bgra.width_ != rgb.width_ || bgra.height_ != rgb.height_) { - utility::LogError( - "BGRA input image and RGB output image have different " - "dimensions."); - } - -#ifdef _OPENMP -#ifdef _WIN32 -#pragma omp parallel for schedule(static) -#else -#pragma omp parallel for collapse(3) schedule(static) -#endif -#endif - for (int v = 0; v < bgra.height_; ++v) { - for (int u = 0; u < bgra.width_; ++u) { - for (int c = 0; c < 3; ++c) { - *rgb.PointerAt<uint8_t>(u, v, c) = - *bgra.PointerAt<uint8_t>(u, v, 2 - c); - } - } - } -} - -bool AzureKinectSensor::PrintFirmware(k4a_device_t device) { - char serial_number_buffer[256]; - size_t serial_number_buffer_size = sizeof(serial_number_buffer); - if (K4A_BUFFER_RESULT_SUCCEEDED != - k4a_plugin::k4a_device_get_serialnum(device, serial_number_buffer, - &serial_number_buffer_size)) { - utility::LogWarning( - "Runtime error: k4a_plugin::k4a_device_get_serialnum() " - "failed"); - return false; - } - - k4a_hardware_version_t version_info; - if (K4A_FAILED(k4a_plugin::k4a_device_get_version(device, &version_info))) { - utility::LogWarning( - "Runtime error: k4a_plugin::k4a_device_get_version() failed"); - return false; - } - - utility::LogInfo("Serial number: {}", serial_number_buffer); - utility::LogInfo("Firmware build: {}", - (version_info.firmware_build == K4A_FIRMWARE_BUILD_RELEASE - ? "Rel" - : "Dbg")); - utility::LogInfo("> Color: {}.{}.{}", version_info.rgb.major, - version_info.rgb.minor, version_info.rgb.iteration); - utility::LogInfo("> Depth: {}.{}.{}[{}.{}]", version_info.depth.major, - version_info.depth.minor, version_info.depth.iteration, - version_info.depth_sensor.major, - version_info.depth_sensor.minor); - return true; -} - -bool AzureKinectSensor::ListDevices() { - uint32_t device_count = k4a_plugin::k4a_device_get_installed_count(); - if (device_count > 0) { - for (uint8_t i = 0; i < device_count; i++) { - utility::LogInfo("Device index {}", i); - k4a_device_t device; - if (K4A_SUCCEEDED(k4a_plugin::k4a_device_open(i, &device))) { - AzureKinectSensor::PrintFirmware(device); - k4a_plugin::k4a_device_close(device); - } else { - utility::LogWarning("Device Open Failed"); - return false; - } - } - } else { - utility::LogError("No devices connected."); - } - - return true; -} - -std::shared_ptr<geometry::RGBDImage> AzureKinectSensor::DecompressCapture( - k4a_capture_t capture, k4a_transformation_t transformation) { - static std::shared_ptr<geometry::Image> color_buffer = nullptr; - static std::shared_ptr<geometry::RGBDImage> rgbd_buffer = nullptr; - - if (color_buffer == nullptr) { - color_buffer = std::make_shared<geometry::Image>(); - } - if (rgbd_buffer == nullptr) { - rgbd_buffer = std::make_shared<geometry::RGBDImage>(); - } - - k4a_image_t k4a_color = k4a_plugin::k4a_capture_get_color_image(capture); - k4a_image_t k4a_depth = k4a_plugin::k4a_capture_get_depth_image(capture); - if (k4a_color == nullptr || k4a_depth == nullptr) { - utility::LogDebug("Skipping empty captures."); - return nullptr; - } - - /* Process color */ - if (K4A_IMAGE_FORMAT_COLOR_MJPG != - k4a_plugin::k4a_image_get_format(k4a_color)) { - utility::LogWarning( - "Unexpected image format. The stream may have " - "corrupted."); - return nullptr; - } - - int width = k4a_plugin::k4a_image_get_width_pixels(k4a_color); - int height = k4a_plugin::k4a_image_get_height_pixels(k4a_color); - - /* resize */ - rgbd_buffer->color_.Prepare(width, height, 3, sizeof(uint8_t)); - color_buffer->Prepare(width, height, 4, sizeof(uint8_t)); - - tjhandle tjHandle; - tjHandle = tjInitDecompress(); - if (0 != - tjDecompress2(tjHandle, k4a_plugin::k4a_image_get_buffer(k4a_color), - static_cast<unsigned long>( - k4a_plugin::k4a_image_get_size(k4a_color)), - color_buffer->data_.data(), width, 0 /* pitch */, height, - TJPF_BGRA, TJFLAG_FASTDCT | TJFLAG_FASTUPSAMPLE)) { - utility::LogWarning("Failed to decompress color image."); - return nullptr; - } - tjDestroy(tjHandle); - ConvertBGRAToRGB(*color_buffer, rgbd_buffer->color_); - - /* transform depth to color plane */ - k4a_image_t k4a_transformed_depth = nullptr; - if (transformation) { - rgbd_buffer->depth_.Prepare(width, height, 1, sizeof(uint16_t)); - k4a_plugin::k4a_image_create_from_buffer( - K4A_IMAGE_FORMAT_DEPTH16, width, height, - width * sizeof(uint16_t), rgbd_buffer->depth_.data_.data(), - width * height * sizeof(uint16_t), NULL, NULL, - &k4a_transformed_depth); - if (K4A_RESULT_SUCCEEDED != - k4a_plugin::k4a_transformation_depth_image_to_color_camera( - transformation, k4a_depth, k4a_transformed_depth)) { - utility::LogWarning( - "Failed to transform depth frame to color frame."); - return nullptr; - } - } else { - rgbd_buffer->depth_.Prepare( - k4a_plugin::k4a_image_get_width_pixels(k4a_depth), - k4a_plugin::k4a_image_get_height_pixels(k4a_depth), 1, - sizeof(uint16_t)); - memcpy(rgbd_buffer->depth_.data_.data(), - k4a_plugin::k4a_image_get_buffer(k4a_depth), - k4a_plugin::k4a_image_get_size(k4a_depth)); - } - - /* process depth */ - k4a_plugin::k4a_image_release(k4a_color); - k4a_plugin::k4a_image_release(k4a_depth); - if (transformation) { - k4a_plugin::k4a_image_release(k4a_transformed_depth); - } - - return rgbd_buffer; -} - -} // namespace io -} // namespace open3d
deleted file mode 100644
@@ -1,76 +0,0 @@ -// ---------------------------------------------------------------------------- -// - Open3D: www.open3d.org - -// ---------------------------------------------------------------------------- -// The MIT License (MIT) -// -// Copyright (c) 2018 www.open3d.org -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -// ---------------------------------------------------------------------------- - -#pragma once - -#include <memory> - -#include "Open3D/IO/Sensor/AzureKinect/AzureKinectSensorConfig.h" -#include "Open3D/IO/Sensor/RGBDSensor.h" - -struct _k4a_capture_t; // typedef _k4a_capture_t* k4a_capture_t; -struct _k4a_device_t; // typedef _k4a_device_t* k4a_device_t; -struct _k4a_transformation_t; // typedef _k4a_transformation_t* - // k4a_transformation_t; - -namespace open3d { -namespace geometry { -class RGBDImage; -class Image; -} // namespace geometry - -namespace io { - -// Avoid including AzureKinectRecorder.h -class AzureKinectRecorder; - -class AzureKinectSensor : public RGBDSensor { -public: - AzureKinectSensor(const AzureKinectSensorConfig& sensor_config); - ~AzureKinectSensor(); - - bool Connect(size_t sensor_index) override; - std::shared_ptr<geometry::RGBDImage> CaptureFrame( - bool enable_align_depth_to_color) const override; - - static bool PrintFirmware(_k4a_device_t* device); - static bool ListDevices(); - static std::shared_ptr<geometry::RGBDImage> DecompressCapture( - _k4a_capture_t* capture, _k4a_transformation_t* transformation); - -protected: - _k4a_capture_t* CaptureRawFrame() const; - - AzureKinectSensorConfig sensor_config_; - _k4a_transformation_t* transform_depth_to_color_; - _k4a_device_t* device_; - int timeout_; - - friend class AzureKinectRecorder; -}; - -} // namespace io -} // namespace open3d
deleted file mode 100644
@@ -1,318 +0,0 @@ -// ---------------------------------------------------------------------------- -// - Open3D: www.open3d.org - -// ---------------------------------------------------------------------------- -// The MIT License (MIT) -// -// Copyright (c) 2018 www.open3d.org -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -// ---------------------------------------------------------------------------- - -#include "Open3D/IO/Sensor/AzureKinect/AzureKinectSensorConfig.h" - -#include <json/json.h> -#include <k4a/k4a.h> -#include <map> -#include <set> -#include <string> -#include <unordered_map> - -#include "Open3D/IO/Sensor/AzureKinect/K4aPlugin.h" -#include "Open3D/Utility/Console.h" - -namespace open3d { -namespace io { - -static std::map<k4a_image_format_t, std::string> k4a_image_format_t_to_string{ - {K4A_IMAGE_FORMAT_COLOR_MJPG, "K4A_IMAGE_FORMAT_COLOR_MJPG"}, - {K4A_IMAGE_FORMAT_COLOR_NV12, "K4A_IMAGE_FORMAT_COLOR_NV12"}, - {K4A_IMAGE_FORMAT_COLOR_YUY2, "K4A_IMAGE_FORMAT_COLOR_YUY2"}, - {K4A_IMAGE_FORMAT_COLOR_BGRA32, "K4A_IMAGE_FORMAT_COLOR_BGRA32"}, - {K4A_IMAGE_FORMAT_DEPTH16, "K4A_IMAGE_FORMAT_DEPTH16"}, - {K4A_IMAGE_FORMAT_IR16, "K4A_IMAGE_FORMAT_IR16"}, - {K4A_IMAGE_FORMAT_CUSTOM, "K4A_IMAGE_FORMAT_CUSTOM"}, -}; - -static std::map<k4a_color_resolution_t, std::string> - k4a_color_resolution_t_to_string{ - {K4A_COLOR_RESOLUTION_OFF, "K4A_COLOR_RESOLUTION_OFF"}, - {K4A_COLOR_RESOLUTION_720P, "K4A_COLOR_RESOLUTION_720P"}, - {K4A_COLOR_RESOLUTION_1080P, "K4A_COLOR_RESOLUTION_1080P"}, - {K4A_COLOR_RESOLUTION_1440P, "K4A_COLOR_RESOLUTION_1440P"}, - {K4A_COLOR_RESOLUTION_1536P, "K4A_COLOR_RESOLUTION_1536P"}, - {K4A_COLOR_RESOLUTION_2160P, "K4A_COLOR_RESOLUTION_2160P"}, - {K4A_COLOR_RESOLUTION_3072P, "K4A_COLOR_RESOLUTION_3072P"}, - }; - -static std::map<k4a_depth_mode_t, std::string> k4a_depth_mode_t_to_string{ - {K4A_DEPTH_MODE_OFF, "K4A_DEPTH_MODE_OFF"}, - {K4A_DEPTH_MODE_NFOV_2X2BINNED, "K4A_DEPTH_MODE_NFOV_2X2BINNED"}, - {K4A_DEPTH_MODE_NFOV_UNBINNED, "K4A_DEPTH_MODE_NFOV_UNBINNED"}, - {K4A_DEPTH_MODE_WFOV_2X2BINNED, "K4A_DEPTH_MODE_WFOV_2X2BINNED"}, - {K4A_DEPTH_MODE_WFOV_UNBINNED, "K4A_DEPTH_MODE_WFOV_UNBINNED"}, - {K4A_DEPTH_MODE_PASSIVE_IR, "K4A_DEPTH_MODE_PASSIVE_IR"}, -}; - -static std::map<k4a_fps_t, std::string> k4a_fps_t_to_string{ - {K4A_FRAMES_PER_SECOND_5, "K4A_FRAMES_PER_SECOND_5"}, - {K4A_FRAMES_PER_SECOND_15, "K4A_FRAMES_PER_SECOND_15"}, - {K4A_FRAMES_PER_SECOND_30, "K4A_FRAMES_PER_SECOND_30"}, -}; - -static std::map<k4a_wired_sync_mode_t, std::string> - k4a_wired_sync_mode_t_to_string{ - {K4A_WIRED_SYNC_MODE_STANDALONE, - "K4A_WIRED_SYNC_MODE_STANDALONE"}, - {K4A_WIRED_SYNC_MODE_MASTER, "K4A_WIRED_SYNC_MODE_MASTER"}, - {K4A_WIRED_SYNC_MODE_SUBORDINATE, - "K4A_WIRED_SYNC_MODE_SUBORDINATE"}, - }; - -static std::map<std::string, k4a_image_format_t> string_to_k4a_image_format_t({ - {"K4A_IMAGE_FORMAT_COLOR_MJPG", K4A_IMAGE_FORMAT_COLOR_MJPG}, - {"K4A_IMAGE_FORMAT_COLOR_NV12", K4A_IMAGE_FORMAT_COLOR_NV12}, - {"K4A_IMAGE_FORMAT_COLOR_YUY2", K4A_IMAGE_FORMAT_COLOR_YUY2}, - {"K4A_IMAGE_FORMAT_COLOR_BGRA32", K4A_IMAGE_FORMAT_COLOR_BGRA32}, - {"K4A_IMAGE_FORMAT_DEPTH16", K4A_IMAGE_FORMAT_DEPTH16}, - {"K4A_IMAGE_FORMAT_IR16", K4A_IMAGE_FORMAT_IR16}, - {"K4A_IMAGE_FORMAT_CUSTOM", K4A_IMAGE_FORMAT_CUSTOM}, -}); - -static std::map<std::string, k4a_color_resolution_t> - string_to_k4a_color_resolution_t{ - {"K4A_COLOR_RESOLUTION_OFF", K4A_COLOR_RESOLUTION_OFF}, - {"K4A_COLOR_RESOLUTION_720P", K4A_COLOR_RESOLUTION_720P}, - {"K4A_COLOR_RESOLUTION_1080P", K4A_COLOR_RESOLUTION_1080P}, - {"K4A_COLOR_RESOLUTION_1440P", K4A_COLOR_RESOLUTION_1440P}, - {"K4A_COLOR_RESOLUTION_1536P", K4A_COLOR_RESOLUTION_1536P}, - {"K4A_COLOR_RESOLUTION_2160P", K4A_COLOR_RESOLUTION_2160P}, - {"K4A_COLOR_RESOLUTION_3072P", K4A_COLOR_RESOLUTION_3072P}, - }; - -static std::map<std::string, k4a_depth_mode_t> string_to_k4a_depth_mode_t{ - {"K4A_DEPTH_MODE_OFF", K4A_DEPTH_MODE_OFF}, - {"K4A_DEPTH_MODE_NFOV_2X2BINNED", K4A_DEPTH_MODE_NFOV_2X2BINNED}, - {"K4A_DEPTH_MODE_NFOV_UNBINNED", K4A_DEPTH_MODE_NFOV_UNBINNED}, - {"K4A_DEPTH_MODE_WFOV_2X2BINNED", K4A_DEPTH_MODE_WFOV_2X2BINNED}, - {"K4A_DEPTH_MODE_WFOV_UNBINNED", K4A_DEPTH_MODE_WFOV_UNBINNED}, - {"K4A_DEPTH_MODE_PASSIVE_IR", K4A_DEPTH_MODE_PASSIVE_IR}, -}; - -static std::map<std::string, k4a_fps_t> string_to_k4a_fps_t{ - {"K4A_FRAMES_PER_SECOND_5", K4A_FRAMES_PER_SECOND_5}, - {"K4A_FRAMES_PER_SECOND_15", K4A_FRAMES_PER_SECOND_15}, - {"K4A_FRAMES_PER_SECOND_30", K4A_FRAMES_PER_SECOND_30}, -}; - -static std::map<std::string, k4a_wired_sync_mode_t> - string_to_k4a_wired_sync_mode_t{ - {"K4A_WIRED_SYNC_MODE_STANDALONE", - K4A_WIRED_SYNC_MODE_STANDALONE}, - {"K4A_WIRED_SYNC_MODE_MASTER", K4A_WIRED_SYNC_MODE_MASTER}, - {"K4A_WIRED_SYNC_MODE_SUBORDINATE", - K4A_WIRED_SYNC_MODE_SUBORDINATE}, - }; - -static std::unordered_map<std::string, std::string> standard_config{ - {"color_format", "K4A_IMAGE_FORMAT_COLOR_MJPG"}, - {"color_resolution", "K4A_COLOR_RESOLUTION_720P"}, - {"depth_mode", "K4A_DEPTH_MODE_WFOV_2X2BINNED"}, - {"camera_fps", "K4A_FRAMES_PER_SECOND_30"}, - {"synchronized_images_only", "false"}, - {"depth_delay_off_color_usec", "0"}, - {"wired_sync_mode", "K4A_WIRED_SYNC_MODE_STANDALONE"}, - {"subordinate_delay_off_master_usec", "0"}, - {"disable_streaming_indicator", "false"}, -}; - -AzureKinectSensorConfig::AzureKinectSensorConfig() { - config_ = standard_config; -} - -bool AzureKinectSensorConfig::IsValidConfig( - const std::unordered_map<std::string, std::string> &config, - bool verbose) { - bool rc = true; - - // No extra keys - for (const auto &it : config) { - if (standard_config.find(it.first) == standard_config.end()) { - rc = false; - utility::LogWarning("IsValidConfig: Unrecognized key {}", it.first); - } - } - - if (config.count("color_format") != 0 && - string_to_k4a_image_format_t.count(config.at("color_format")) == 0) { - rc = false; - if (verbose) { - utility::LogWarning("IsValidConfig: color_format invalid"); - } - } - - if (config.count("color_resolution") != 0 && - string_to_k4a_color_resolution_t.count(config.at("color_resolution")) == - 0) { - rc = false; - if (verbose) { - utility::LogWarning("IsValidConfig: color_resolution invalid"); - } - } - - if (config.count("depth_mode") != 0 && - string_to_k4a_depth_mode_t.count(config.at("depth_mode")) == 0) { - rc = false; - if (verbose) { - utility::LogWarning("IsValidConfig: depth_mode invalid"); - } - } - - if (config.count("camera_fps") != 0 && - string_to_k4a_fps_t.count(config.at("camera_fps")) == 0) { - rc = false; - if (verbose) { - utility::LogWarning("IsValidConfig: camera_fps invalid"); - } - } else { - if (config.count("camera_fps") != 0 && - config.count("color_resolution") != 0 && - config.at("camera_fps") == "K4A_FRAMES_PER_SECOND_30" && - config.at("color_resolution") == "K4A_COLOR_RESOLUTION_3072P") { - rc = false; - if (verbose) { - utility::LogWarning( - "K4A_COLOR_RESOLUTION_3072P does not support 30 FPS"); - } - } - } - - if (config.count("synchronized_images_only") != 0 && - config.at("synchronized_images_only") != "true" && - config.at("synchronized_images_only") != "false") { - rc = false; - if (verbose) { - utility::LogWarning( - "IsValidConfig: synchronized_images_only invalid"); - } - } - - if (config.count("wired_sync_mode") != 0 && - string_to_k4a_wired_sync_mode_t.count(config.at("wired_sync_mode")) == - 0) { - rc = false; - if (verbose) { - utility::LogWarning("IsValidConfig: wired_sync_mode invalid"); - } - } - - if (config.count("disable_streaming_indicator") != 0 && - config.at("disable_streaming_indicator") != "true" && - config.at("disable_streaming_indicator") != "false") { - rc = false; - if (verbose) { - utility::LogWarning( - "IsValidConfig: disable_streaming_indicator invalid"); - } - } - - return rc; -} - -AzureKinectSensorConfig::AzureKinectSensorConfig( - const std::unordered_map<std::string, std::string> &config) - : AzureKinectSensorConfig() { - if (!IsValidConfig(config)) { - utility::LogWarning("Invalid configs, default configs will be used."); - return; - } - for (const auto &it : config) { - config_[it.first] = it.second; - } -} - -bool AzureKinectSensorConfig::ConvertToJsonValue(Json::Value &value) const { - // clang-format off - value["color_format"] = config_.at("color_format"); - value["color_resolution"] = config_.at("color_resolution"); - value["depth_mode"] = config_.at("depth_mode"); - value["camera_fps"] = config_.at("camera_fps"); - value["synchronized_images_only"] = config_.at("synchronized_images_only"); - value["depth_delay_off_color_usec"] = config_.at("depth_delay_off_color_usec"); - value["wired_sync_mode"] = config_.at("wired_sync_mode"); - value["subordinate_delay_off_master_usec"] = config_.at("subordinate_delay_off_master_usec"); - value["disable_streaming_indicator"] = config_.at("disable_streaming_indicator"); - // clang-format on - return true; -} - -bool AzureKinectSensorConfig::ConvertFromJsonValue(const Json::Value &value) { - // clang-format off - config_["color_format"] = value["color_format"].asString(); - config_["color_resolution"] = value["color_resolution"].asString(); - config_["depth_mode"] = value["depth_mode"].asString(); - config_["camera_fps"] = value["camera_fps"].asString(); - config_["synchronized_images_only"] = value["synchronized_images_only"].asString(); - config_["depth_delay_off_color_usec"] = value["depth_delay_off_color_usec"].asString(); - config_["wired_sync_mode"] = value["wired_sync_mode"].asString(); - config_["subordinate_delay_off_master_usec"] = value["subordinate_delay_off_master_usec"].asString(); - config_["disable_streaming_indicator"] = value["disable_streaming_indicator"].asString(); - // clang-format on - - return IsValidConfig(config_, true); -} - -void AzureKinectSensorConfig::ConvertFromNativeConfig( - const k4a_device_configuration_t &k4a_config) { - // clang-format off - config_["color_format"] = k4a_image_format_t_to_string.at(k4a_config.color_format); - config_["color_resolution"] = k4a_color_resolution_t_to_string.at(k4a_config.color_resolution); - config_["depth_mode"] = k4a_depth_mode_t_to_string.at(k4a_config.depth_mode); - config_["camera_fps"] = k4a_fps_t_to_string.at(k4a_config.camera_fps); - config_["synchronized_images_only"] = k4a_config.synchronized_images_only ? "true" : "false"; - config_["depth_delay_off_color_usec"] = std::to_string(k4a_config.depth_delay_off_color_usec); - config_["wired_sync_mode"] = k4a_wired_sync_mode_t_to_string.at(k4a_config.wired_sync_mode); - config_["subordinate_delay_off_master_usec"] = std::to_string(k4a_config.subordinate_delay_off_master_usec); - config_["disable_streaming_indicator"] = k4a_config.disable_streaming_indicator ? "true" : "false"; - // clang-format on - if (!IsValidConfig(config_)) { - utility::LogError( - "Internal error, invalid configs. Maybe SDK version is " - "mismatched."); - } -} - -k4a_device_configuration_t AzureKinectSensorConfig::ConvertToNativeConfig() - const { - k4a_device_configuration_t k4a_config; - // clang-format off - k4a_config.color_format = string_to_k4a_image_format_t.at(config_.at("color_format")); - k4a_config.color_resolution = string_to_k4a_color_resolution_t.at(config_.at("color_resolution")); - k4a_config.depth_mode = string_to_k4a_depth_mode_t.at(config_.at("depth_mode")); - k4a_config.camera_fps = string_to_k4a_fps_t.at(config_.at("camera_fps")); - k4a_config.synchronized_images_only = config_.at("synchronized_images_only") == "true"; - k4a_config.depth_delay_off_color_usec = static_cast<int32_t>(std::stoi(config_.at("depth_delay_off_color_usec"))); - k4a_config.wired_sync_mode = string_to_k4a_wired_sync_mode_t.at(config_.at("wired_sync_mode")); - k4a_config.subordinate_delay_off_master_usec = static_cast<uint32_t>(std::stoi(config_.at("subordinate_delay_off_master_usec"))); - k4a_config.disable_streaming_indicator = config_.at("disable_streaming_indicator") == "true"; - // clang-format on - return k4a_config; -} - -} // namespace io -} // namespace open3d
deleted file mode 100644
@@ -1,66 +0,0 @@ -// ---------------------------------------------------------------------------- -// - Open3D: www.open3d.org - -// ---------------------------------------------------------------------------- -// The MIT License (MIT) -// -// Copyright (c) 2018 www.open3d.org -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -// ---------------------------------------------------------------------------- - -#pragma once - -#include <string> -#include <unordered_map> - -#include "Open3D/IO/Sensor/RGBDSensorConfig.h" -#include "Open3D/Utility/IJsonConvertible.h" - -struct _k4a_device_configuration_t; // Alias of k4a_device_configuration_t - -namespace open3d { -namespace io { - -// Alternative implementation of _k4a_device_configuration_t with string values -class AzureKinectSensorConfig : public RGBDSensorConfig { -public: - /// Default constructor, default configs will be used - AzureKinectSensorConfig(); - /// Initialize config with a map - AzureKinectSensorConfig( - const std::unordered_map<std::string, std::string> &config); - bool ConvertToJsonValue(Json::Value &value) const override; - bool ConvertFromJsonValue(const Json::Value &value) override; - -public: - void ConvertFromNativeConfig(const _k4a_device_configuration_t &k4a_config); - _k4a_device_configuration_t ConvertToNativeConfig() const; - -public: - // To avoid including k4a or json header, configs is stored in a map - std::unordered_map<std::string, std::string> config_; - -protected: - static bool IsValidConfig( - const std::unordered_map<std::string, std::string> &config, - bool verbose = true); -}; - -} // namespace io -} // namespace open3d
deleted file mode 100644
@@ -1,847 +0,0 @@ -// ---------------------------------------------------------------------------- -// - Open3D: www.open3d.org - -// ---------------------------------------------------------------------------- -// The MIT License (MIT) -// -// Copyright (c) 2018 www.open3d.org -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -// ---------------------------------------------------------------------------- - -#include <k4a/k4a.h> -#include <k4arecord/playback.h> -#include <k4arecord/record.h> -#include <cstdlib> -#include <cstring> -#include <unordered_map> -#include <vector> - -#ifdef _WIN32 -#include <windows.h> -#else -#include <dlfcn.h> -#include <link.h> -#endif - -#include "Open3D/IO/Sensor/AzureKinect/K4aPlugin.h" -#include "Open3D/IO/Sensor/AzureKinect/PluginMacros.h" -#include "Open3D/Utility/Console.h" -#include "Open3D/Utility/Helper.h" - -namespace open3d { -namespace io { -namespace k4a_plugin { - -#ifdef _WIN32 - -static const std::string k4a_lib_name = "k4a.dll"; -static const std::string k4arecord_lib_name = "k4arecord.dll"; - -static HINSTANCE GetDynamicLibHandle(const std::string& lib_name) { - static std::unordered_map<std::string, HINSTANCE> map_lib_name_to_handle; - - if (map_lib_name_to_handle.count(lib_name) == 0) { - // clang-format off - // To use custom library path for K4a, set environment variable K4A_LIB_DIR - // Exammple: - // set K4A_LIB_DIR=C:\Program Files\Azure Kinect SDK v1.2.0\sdk\windows-desktop\amd64\release\bin - // Note that double qoutes and "\\" are not needed - std::string env_lib_dir = ""; - char const* temp = std::getenv("K4A_LIB_DIR"); - if (temp != nullptr) { - env_lib_dir = std::string(temp); - } - utility::LogDebug("Environment variable K4A_LIB_DIR: {}", env_lib_dir); - - static const std::vector<std::string> k4a_lib_path_hints = { - env_lib_dir, - "", - "C:\\Program Files\\Azure Kinect SDK v1.2.0\\sdk\\windows-desktop\\amd64\\release\\bin" - }; - // clang-format on - - HINSTANCE handle = NULL; - for (const std::string& k4a_lib_path_hint : k4a_lib_path_hints) { - utility::LogDebug("Trying k4a_lib_path_hint: {}", - k4a_lib_path_hint); - std::string full_path = k4a_lib_path_hint + "\\" + lib_name; - handle = LoadLibrary(TEXT(full_path.c_str())); - if (handle != NULL) { - utility::LogDebug("Loaded {}", full_path); - break; - } - } - if (handle == NULL) { - utility::LogError("Cannot load {}", lib_name); - } - map_lib_name_to_handle[lib_name] = handle; - } - return map_lib_name_to_handle.at(lib_name); -} - -#define DEFINE_BRIDGED_FUNC_WITH_COUNT(lib_name, return_type, f_name, \ - num_args, ...) \ - return_type f_name(EXTRACT_TYPES_PARAMS(num_args, __VA_ARGS__)) { \ - typedef return_type (*f_type)( \ - EXTRACT_TYPES_PARAMS(num_args, __VA_ARGS__)); \ - static f_type f = nullptr; \ - \ - if (!f) { \ - f = (f_type)GetProcAddress(GetDynamicLibHandle(lib_name), \ - #f_name); \ - if (f == nullptr) { \ - utility::LogError("Cannot load func {}", #f_name); \ - } else { \ - utility::LogDebug("Loaded func {}", #f_name); \ - } \ - } \ - return f(EXTRACT_PARAMS(num_args, __VA_ARGS__)); \ - } - -#else - -static const std::string k4a_lib_name = "libk4a.so"; -static const std::string k4arecord_lib_name = "libk4arecord.so"; - -static void* GetDynamicLibHandle(const std::string& lib_name) { - static std::unordered_map<std::string, void*> map_lib_name_to_handle; - - if (map_lib_name_to_handle.count(lib_name) == 0) { - // Hack to support Ubuntu 16.04 K4A library loading - // - // Dependency: - // In __init__.py Python file, one of os.environ['LD_LIBRARY_PATH'] is - // set to contain libk4a.so, libk4arecord.so and libdepthengine.so. - // - // Normally LD_LIBRARY_PATH cannot be set at runtime (only possible at - // program load time). Here we explicitly try to load from - // LD_LIBRARY_PATH. - std::vector<std::string> k4a_lib_path_hints; - if (const char* ld_paths_c = std::getenv("LD_LIBRARY_PATH")) { - utility::SplitString(k4a_lib_path_hints, ld_paths_c, ":", true); - } - k4a_lib_path_hints.insert(k4a_lib_path_hints.begin(), ""); - - void* handle = nullptr; - std::string full_path; - for (const std::string& k4a_lib_path_hint : k4a_lib_path_hints) { - if (k4a_lib_path_hint == "") { - full_path = lib_name; - } else { - full_path = k4a_lib_path_hint + "/" + lib_name; - } - handle = dlopen(full_path.c_str(), RTLD_NOW); - if (handle != NULL) { - break; - } - } - if (!handle) { - utility::LogError("Cannot load {}", dlerror()); - } else { - utility::LogDebug("Loaded {}", full_path); - struct link_map* map = nullptr; - if (!dlinfo(handle, RTLD_DI_LINKMAP, &map)) { - if (map != nullptr) { - utility::LogDebug("Library path {}", map->l_name); - } else { - utility::LogWarning("Cannot get link_map"); - } - } else { - utility::LogWarning("Cannot get dlinfo"); - } - } - map_lib_name_to_handle[lib_name] = handle; - } - return map_lib_name_to_handle.at(lib_name); -} - -#define DEFINE_BRIDGED_FUNC_WITH_COUNT(lib_name, return_type, f_name, \ - num_args, ...) \ - return_type f_name(EXTRACT_TYPES_PARAMS(num_args, __VA_ARGS__)) { \ - typedef return_type (*f_type)( \ - EXTRACT_TYPES_PARAMS(num_args, __VA_ARGS__)); \ - static f_type f = nullptr; \ - \ - if (!f) { \ - f = (f_type)dlsym(GetDynamicLibHandle(lib_name), #f_name); \ - if (!f) { \ - utility::LogError("Cannot load {}: {}", #f_name, dlerror()); \ - } \ - } \ - return f(EXTRACT_PARAMS(num_args, __VA_ARGS__)); \ - } - -#endif - -#define DEFINE_BRIDGED_FUNC(lib_name, return_type, f_name, ...) \ - DEFINE_BRIDGED_FUNC_WITH_COUNT(lib_name, return_type, f_name, \ - COUNT_ARGS(__VA_ARGS__), __VA_ARGS__) - -//////////////////////////////////////////////////////////////////////////////// - -DEFINE_BRIDGED_FUNC(k4arecord_lib_name, - k4a_result_t, - k4a_record_create, - const char*, - path, - k4a_device_t, - device, - const k4a_device_configuration_t, - device_config, - k4a_record_t*, - recording_handle) - -DEFINE_BRIDGED_FUNC(k4arecord_lib_name, - k4a_result_t, - k4a_record_add_tag, - k4a_record_t, - recording_handle, - const char*, - name, - const char*, - value) - -DEFINE_BRIDGED_FUNC(k4arecord_lib_name, - k4a_result_t, - k4a_record_add_imu_track, - k4a_record_t, - recording_handle) - -DEFINE_BRIDGED_FUNC(k4arecord_lib_name, - k4a_result_t, - k4a_record_write_header, - k4a_record_t, - recording_handle) - -DEFINE_BRIDGED_FUNC(k4arecord_lib_name, - k4a_result_t, - k4a_record_write_capture, - k4a_record_t, - recording_handle, - k4a_capture_t, - capture_handle) - -DEFINE_BRIDGED_FUNC(k4arecord_lib_name, - k4a_result_t, - k4a_record_write_imu_sample, - k4a_record_t, - recording_handle, - k4a_imu_sample_t, - imu_sample) - -DEFINE_BRIDGED_FUNC(k4arecord_lib_name, - k4a_result_t, - k4a_record_flush, - k4a_record_t, - recording_handle) - -DEFINE_BRIDGED_FUNC(k4arecord_lib_name, - void, - k4a_record_close, - k4a_record_t, - recording_handle) - -//////////////////////////////////////////////////////////////////////////////// - -DEFINE_BRIDGED_FUNC(k4arecord_lib_name, - k4a_result_t, - k4a_playback_open, - const char*, - path, - k4a_playback_t*, - playback_handle) -DEFINE_BRIDGED_FUNC(k4arecord_lib_name, - k4a_buffer_result_t, - k4a_playback_get_raw_calibration, - k4a_playback_t, - playback_handle, - uint8_t*, - data, - size_t*, - data_size) -DEFINE_BRIDGED_FUNC(k4arecord_lib_name, - k4a_result_t, - k4a_playback_get_calibration, - k4a_playback_t, - playback_handle, - k4a_calibration_t*, - calibration) -DEFINE_BRIDGED_FUNC(k4arecord_lib_name, - k4a_result_t, - k4a_playback_get_record_configuration, - k4a_playback_t, - playback_handle, - k4a_record_configuration_t*, - config) -DEFINE_BRIDGED_FUNC(k4arecord_lib_name, - k4a_buffer_result_t, - k4a_playback_get_tag, - k4a_playback_t, - playback_handle, - const char*, - name, - char*, - value, - size_t*, - value_size) -DEFINE_BRIDGED_FUNC(k4arecord_lib_name, - k4a_result_t, - k4a_playback_set_color_conversion, - k4a_playback_t, - playback_handle, - k4a_image_format_t, - target_format) -DEFINE_BRIDGED_FUNC(k4arecord_lib_name, - k4a_stream_result_t, - k4a_playback_get_next_capture, - k4a_playback_t, - playback_handle, - k4a_capture_t*, - capture_handle) -DEFINE_BRIDGED_FUNC(k4arecord_lib_name, - k4a_stream_result_t, - k4a_playback_get_previous_capture, - k4a_playback_t, - playback_handle, - k4a_capture_t*, - capture_handle) -DEFINE_BRIDGED_FUNC(k4arecord_lib_name, - k4a_stream_result_t, - k4a_playback_get_next_imu_sample, - k4a_playback_t, - playback_handle, - k4a_imu_sample_t*, - imu_sample) -DEFINE_BRIDGED_FUNC(k4arecord_lib_name, - k4a_stream_result_t, - k4a_playback_get_previous_imu_sample, - k4a_playback_t, - playback_handle, - k4a_imu_sample_t*, - imu_sample) -DEFINE_BRIDGED_FUNC(k4arecord_lib_name, - k4a_result_t, - k4a_playback_seek_timestamp, - k4a_playback_t, - playback_handle, - int64_t, - offset_usec, - k4a_playback_seek_origin_t, - origin) -DEFINE_BRIDGED_FUNC(k4arecord_lib_name, - uint64_t, - k4a_playback_get_last_timestamp_usec, - k4a_playback_t, - playback_handle) -DEFINE_BRIDGED_FUNC(k4arecord_lib_name, - void, - k4a_playback_close, - k4a_playback_t, - playback_handle) - -//////////////////////////////////////////////////////////////////////////////// - -DEFINE_BRIDGED_FUNC(k4a_lib_name, uint32_t, k4a_device_get_installed_count) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_result_t, - k4a_set_debug_message_handler, - k4a_logging_message_cb_t*, - message_cb, - void*, - message_cb_context, - k4a_log_level_t, - min_level) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_result_t, - k4a_device_open, - uint32_t, - index, - k4a_device_t*, - device_handle) - -DEFINE_BRIDGED_FUNC( - k4a_lib_name, void, k4a_device_close, k4a_device_t, device_handle) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_wait_result_t, - k4a_device_get_capture, - k4a_device_t, - device_handle, - k4a_capture_t*, - capture_handle, - int32_t, - timeout_in_ms) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_wait_result_t, - k4a_device_get_imu_sample, - k4a_device_t, - device_handle, - k4a_imu_sample_t*, - imu_sample, - int32_t, - timeout_in_ms) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_result_t, - k4a_capture_create, - k4a_capture_t*, - capture_handle) - -DEFINE_BRIDGED_FUNC( - k4a_lib_name, void, k4a_capture_release, k4a_capture_t, capture_handle) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - void, - k4a_capture_reference, - k4a_capture_t, - capture_handle) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_image_t, - k4a_capture_get_color_image, - k4a_capture_t, - capture_handle) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_image_t, - k4a_capture_get_depth_image, - k4a_capture_t, - capture_handle) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_image_t, - k4a_capture_get_ir_image, - k4a_capture_t, - capture_handle) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - void, - k4a_capture_set_color_image, - k4a_capture_t, - capture_handle, - k4a_image_t, - image_handle) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - void, - k4a_capture_set_depth_image, - k4a_capture_t, - capture_handle, - k4a_image_t, - image_handle) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - void, - k4a_capture_set_ir_image, - k4a_capture_t, - capture_handle, - k4a_image_t, - image_handle) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - void, - k4a_capture_set_temperature_c, - k4a_capture_t, - capture_handle, - float, - temperature_c) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - float, - k4a_capture_get_temperature_c, - k4a_capture_t, - capture_handle) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_result_t, - k4a_image_create, - k4a_image_format_t, - format, - int, - width_pixels, - int, - height_pixels, - int, - stride_bytes, - k4a_image_t*, - image_handle) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_result_t, - k4a_image_create_from_buffer, - k4a_image_format_t, - format, - int, - width_pixels, - int, - height_pixels, - int, - stride_bytes, - uint8_t*, - buffer, - size_t, - buffer_size, - k4a_memory_destroy_cb_t*, - buffer_release_cb, - void*, - buffer_release_cb_context, - k4a_image_t*, - image_handle) - -DEFINE_BRIDGED_FUNC( - k4a_lib_name, uint8_t*, k4a_image_get_buffer, k4a_image_t, image_handle) - -DEFINE_BRIDGED_FUNC( - k4a_lib_name, size_t, k4a_image_get_size, k4a_image_t, image_handle) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_image_format_t, - k4a_image_get_format, - k4a_image_t, - image_handle) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - int, - k4a_image_get_width_pixels, - k4a_image_t, - image_handle) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - int, - k4a_image_get_height_pixels, - k4a_image_t, - image_handle) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - int, - k4a_image_get_stride_bytes, - k4a_image_t, - image_handle) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - uint64_t, - k4a_image_get_timestamp_usec, - k4a_image_t, - image_handle) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - uint64_t, - k4a_image_get_exposure_usec, - k4a_image_t, - image_handle) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - uint32_t, - k4a_image_get_white_balance, - k4a_image_t, - image_handle) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - uint32_t, - k4a_image_get_iso_speed, - k4a_image_t, - image_handle) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - void, - k4a_image_set_timestamp_usec, - k4a_image_t, - image_handle, - uint64_t, - timestamp_usec) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - void, - k4a_image_set_exposure_time_usec, - k4a_image_t, - image_handle, - uint64_t, - exposure_usec) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - void, - k4a_image_set_white_balance, - k4a_image_t, - image_handle, - uint32_t, - white_balance) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - void, - k4a_image_set_iso_speed, - k4a_image_t, - image_handle, - uint32_t, - iso_speed) - -DEFINE_BRIDGED_FUNC( - k4a_lib_name, void, k4a_image_reference, k4a_image_t, image_handle) - -DEFINE_BRIDGED_FUNC( - k4a_lib_name, void, k4a_image_release, k4a_image_t, image_handle) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_result_t, - k4a_device_start_cameras, - k4a_device_t, - device_handle, - k4a_device_configuration_t*, - config) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - void, - k4a_device_stop_cameras, - k4a_device_t, - device_handle) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_result_t, - k4a_device_start_imu, - k4a_device_t, - device_handle) - -DEFINE_BRIDGED_FUNC( - k4a_lib_name, void, k4a_device_stop_imu, k4a_device_t, device_handle) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_buffer_result_t, - k4a_device_get_serialnum, - k4a_device_t, - device_handle, - char*, - serial_number, - size_t*, - serial_number_size) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_result_t, - k4a_device_get_version, - k4a_device_t, - device_handle, - k4a_hardware_version_t*, - version) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_result_t, - k4a_device_get_color_control_capabilities, - k4a_device_t, - device_handle, - k4a_color_control_command_t, - command, - bool*, - supports_auto, - int32_t*, - min_value, - int32_t*, - max_value, - int32_t*, - step_value, - int32_t*, - default_value, - k4a_color_control_mode_t*, - default_mode) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_result_t, - k4a_device_get_color_control, - k4a_device_t, - device_handle, - k4a_color_control_command_t, - command, - k4a_color_control_mode_t*, - mode, - int32_t*, - value) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_result_t, - k4a_device_set_color_control, - k4a_device_t, - device_handle, - k4a_color_control_command_t, - command, - k4a_color_control_mode_t, - mode, - int32_t, - value) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_buffer_result_t, - k4a_device_get_raw_calibration, - k4a_device_t, - device_handle, - uint8_t*, - data, - size_t*, - data_size) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_result_t, - k4a_device_get_calibration, - k4a_device_t, - device_handle, - const k4a_depth_mode_t, - depth_mode, - const k4a_color_resolution_t, - color_resolution, - k4a_calibration_t*, - calibration) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_result_t, - k4a_device_get_sync_jack, - k4a_device_t, - device_handle, - bool*, - sync_in_jack_connected, - bool*, - sync_out_jack_connected) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_result_t, - k4a_calibration_get_from_raw, - char*, - raw_calibration, - size_t, - raw_calibration_size, - const k4a_depth_mode_t, - depth_mode, - const k4a_color_resolution_t, - color_resolution, - k4a_calibration_t*, - calibration) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_result_t, - k4a_calibration_3d_to_3d, - const k4a_calibration_t*, - calibration, - const k4a_float3_t*, - source_point3d_mm, - const k4a_calibration_type_t, - source_camera, - const k4a_calibration_type_t, - target_camera, - k4a_float3_t*, - target_point3d_mm) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_result_t, - k4a_calibration_2d_to_3d, - const k4a_calibration_t*, - calibration, - const k4a_float2_t*, - source_point2d, - const float, - source_depth_mm, - const k4a_calibration_type_t, - source_camera, - const k4a_calibration_type_t, - target_camera, - k4a_float3_t*, - target_point3d_mm, - int*, - valid) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_result_t, - k4a_calibration_3d_to_2d, - const k4a_calibration_t*, - calibration, - const k4a_float3_t*, - source_point3d_mm, - const k4a_calibration_type_t, - source_camera, - const k4a_calibration_type_t, - target_camera, - k4a_float2_t*, - target_point2d, - int*, - valid) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_result_t, - k4a_calibration_2d_to_2d, - const k4a_calibration_t*, - calibration, - const k4a_float2_t*, - source_point2d, - const float, - source_depth_mm, - const k4a_calibration_type_t, - source_camera, - const k4a_calibration_type_t, - target_camera, - k4a_float2_t*, - target_point2d, - int*, - valid) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_transformation_t, - k4a_transformation_create, - const k4a_calibration_t*, - calibration) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - void, - k4a_transformation_destroy, - k4a_transformation_t, - transformation_handle) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_result_t, - k4a_transformation_depth_image_to_color_camera, - k4a_transformation_t, - transformation_handle, - const k4a_image_t, - depth_image, - k4a_image_t, - transformed_depth_image) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_result_t, - k4a_transformation_color_image_to_depth_camera, - k4a_transformation_t, - transformation_handle, - const k4a_image_t, - depth_image, - const k4a_image_t, - color_image, - k4a_image_t, - transformed_color_image) - -DEFINE_BRIDGED_FUNC(k4a_lib_name, - k4a_result_t, - k4a_transformation_depth_image_to_point_cloud, - k4a_transformation_t, - transformation_handle, - const k4a_image_t, - depth_image, - const k4a_calibration_type_t, - camera, - k4a_image_t, - xyz_image) - -} // namespace k4a_plugin -} // namespace io -} // namespace open3d
deleted file mode 100644
@@ -1,316 +0,0 @@ -// ---------------------------------------------------------------------------- -// - Open3D: www.open3d.org - -// ---------------------------------------------------------------------------- -// The MIT License (MIT) -// -// Copyright (c) 2018 www.open3d.org -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -// ---------------------------------------------------------------------------- - -#pragma once - -// To prevent header dependency propagation -// Do not include this file in any *.h, only in *.cc -#include <k4a/k4a.h> -#include <k4arecord/playback.h> -#include <k4arecord/record.h> - -namespace open3d { -namespace io { -namespace k4a_plugin { - -k4a_result_t k4a_record_create(const char *path, - k4a_device_t device, - const k4a_device_configuration_t device_config, - k4a_record_t *recording_handle); - -k4a_result_t k4a_record_add_tag(k4a_record_t recording_handle, - const char *name, - const char *value); - -k4a_result_t k4a_record_add_imu_track(k4a_record_t recording_handle); - -k4a_result_t k4a_record_write_header(k4a_record_t recording_handle); - -k4a_result_t k4a_record_write_capture(k4a_record_t recording_handle, - k4a_capture_t capture_handle); - -k4a_result_t k4a_record_write_imu_sample(k4a_record_t recording_handle, - k4a_imu_sample_t imu_sample); - -k4a_result_t k4a_record_flush(k4a_record_t recording_handle); - -void k4a_record_close(k4a_record_t recording_handle); - -//////////////////////////////////////////////////////////////////////////////// - -k4a_result_t k4a_playback_open(const char *path, - k4a_playback_t *playback_handle); - -k4a_buffer_result_t k4a_playback_get_raw_calibration( - k4a_playback_t playback_handle, uint8_t *data, size_t *data_size); - -k4a_result_t k4a_playback_get_calibration(k4a_playback_t playback_handle, - k4a_calibration_t *calibration); - -k4a_result_t k4a_playback_get_record_configuration( - k4a_playback_t playback_handle, k4a_record_configuration_t *config); - -k4a_buffer_result_t k4a_playback_get_tag(k4a_playback_t playback_handle, - const char *name, - char *value, - size_t *value_size); - -k4a_result_t k4a_playback_set_color_conversion( - k4a_playback_t playback_handle, k4a_image_format_t target_format); - -k4a_stream_result_t k4a_playback_get_next_capture( - k4a_playback_t playback_handle, k4a_capture_t *capture_handle); - -k4a_stream_result_t k4a_playback_get_previous_capture( - k4a_playback_t playback_handle, k4a_capture_t *capture_handle); - -k4a_stream_result_t k4a_playback_get_next_imu_sample( - k4a_playback_t playback_handle, k4a_imu_sample_t *imu_sample); - -k4a_stream_result_t k4a_playback_get_previous_imu_sample( - k4a_playback_t playback_handle, k4a_imu_sample_t *imu_sample); - -k4a_result_t k4a_playback_seek_timestamp(k4a_playback_t playback_handle, - int64_t offset_usec, - k4a_playback_seek_origin_t origin); - -uint64_t k4a_playback_get_last_timestamp_usec(k4a_playback_t playback_handle); - -void k4a_playback_close(k4a_playback_t playback_handle); - -//////////////////////////////////////////////////////////////////////////////// - -uint32_t k4a_device_get_installed_count(void); - -k4a_result_t k4a_set_debug_message_handler(k4a_logging_message_cb_t *message_cb, - void *message_cb_context, - k4a_log_level_t min_level); - -k4a_result_t k4a_device_open(uint32_t index, k4a_device_t *device_handle); - -void k4a_device_close(k4a_device_t device_handle); - -k4a_wait_result_t k4a_device_get_capture(k4a_device_t device_handle, - k4a_capture_t *capture_handle, - int32_t timeout_in_ms); - -k4a_wait_result_t k4a_device_get_imu_sample(k4a_device_t device_handle, - k4a_imu_sample_t *imu_sample, - int32_t timeout_in_ms); - -k4a_result_t k4a_capture_create(k4a_capture_t *capture_handle); - -void k4a_capture_release(k4a_capture_t capture_handle); - -void k4a_capture_reference(k4a_capture_t capture_handle); - -k4a_image_t k4a_capture_get_color_image(k4a_capture_t capture_handle); - -k4a_image_t k4a_capture_get_depth_image(k4a_capture_t capture_handle); - -k4a_image_t k4a_capture_get_ir_image(k4a_capture_t capture_handle); - -void k4a_capture_set_color_image(k4a_capture_t capture_handle, - k4a_image_t image_handle); - -void k4a_capture_set_depth_image(k4a_capture_t capture_handle, - k4a_image_t image_handle); - -void k4a_capture_set_ir_image(k4a_capture_t capture_handle, - k4a_image_t image_handle); - -void k4a_capture_set_temperature_c(k4a_capture_t capture_handle, - float temperature_c); - -float k4a_capture_get_temperature_c(k4a_capture_t capture_handle); - -k4a_result_t k4a_image_create(k4a_image_format_t format, - int width_pixels, - int height_pixels, - int stride_bytes, - k4a_image_t *image_handle); - -k4a_result_t k4a_image_create_from_buffer( - k4a_image_format_t format, - int width_pixels, - int height_pixels, - int stride_bytes, - uint8_t *buffer, - size_t buffer_size, - k4a_memory_destroy_cb_t *buffer_release_cb, - void *buffer_release_cb_context, - k4a_image_t *image_handle); - -uint8_t *k4a_image_get_buffer(k4a_image_t image_handle); - -size_t k4a_image_get_size(k4a_image_t image_handle); - -k4a_image_format_t k4a_image_get_format(k4a_image_t image_handle); - -int k4a_image_get_width_pixels(k4a_image_t image_handle); - -int k4a_image_get_height_pixels(k4a_image_t image_handle); - -int k4a_image_get_stride_bytes(k4a_image_t image_handle); - -uint64_t k4a_image_get_timestamp_usec(k4a_image_t image_handle); - -uint64_t k4a_image_get_exposure_usec(k4a_image_t image_handle); - -uint32_t k4a_image_get_white_balance(k4a_image_t image_handle); - -uint32_t k4a_image_get_iso_speed(k4a_image_t image_handle); - -void k4a_image_set_timestamp_usec(k4a_image_t image_handle, - uint64_t timestamp_usec); - -void k4a_image_set_exposure_time_usec(k4a_image_t image_handle, - uint64_t exposure_usec); - -void k4a_image_set_white_balance(k4a_image_t image_handle, - uint32_t white_balance); - -void k4a_image_set_iso_speed(k4a_image_t image_handle, uint32_t iso_speed); - -void k4a_image_reference(k4a_image_t image_handle); - -void k4a_image_release(k4a_image_t image_handle); - -k4a_result_t k4a_device_start_cameras(k4a_device_t device_handle, - k4a_device_configuration_t *config); - -void k4a_device_stop_cameras(k4a_device_t device_handle); - -k4a_result_t k4a_device_start_imu(k4a_device_t device_handle); - -void k4a_device_stop_imu(k4a_device_t device_handle); - -k4a_buffer_result_t k4a_device_get_serialnum(k4a_device_t device_handle, - char *serial_number, - size_t *serial_number_size); - -k4a_result_t k4a_device_get_version(k4a_device_t device_handle, - k4a_hardware_version_t *version); - -k4a_result_t k4a_device_get_color_control_capabilities( - k4a_device_t device_handle, - k4a_color_control_command_t command, - bool *supports_auto, - int32_t *min_value, - int32_t *max_value, - int32_t *step_value, - int32_t *default_value, - k4a_color_control_mode_t *default_mode); - -k4a_result_t k4a_device_get_color_control(k4a_device_t device_handle, - k4a_color_control_command_t command, - k4a_color_control_mode_t *mode, - int32_t *value); - -k4a_result_t k4a_device_set_color_control(k4a_device_t device_handle, - k4a_color_control_command_t command, - k4a_color_control_mode_t mode, - int32_t value); - -k4a_buffer_result_t k4a_device_get_raw_calibration(k4a_device_t device_handle, - uint8_t *data, - size_t *data_size); - -k4a_result_t k4a_device_get_calibration( - k4a_device_t device_handle, - const k4a_depth_mode_t depth_mode, - const k4a_color_resolution_t color_resolution, - k4a_calibration_t *calibration); - -k4a_result_t k4a_device_get_sync_jack(k4a_device_t device_handle, - bool *sync_in_jack_connected, - bool *sync_out_jack_connected); - -k4a_result_t k4a_calibration_get_from_raw( - char *raw_calibration, - size_t raw_calibration_size, - const k4a_depth_mode_t depth_mode, - const k4a_color_resolution_t color_resolution, - k4a_calibration_t *calibration); - -k4a_result_t k4a_calibration_3d_to_3d( - const k4a_calibration_t *calibration, - const k4a_float3_t *source_point3d_mm, - const k4a_calibration_type_t source_camera, - const k4a_calibration_type_t target_camera, - k4a_float3_t *target_point3d_mm); - -k4a_result_t k4a_calibration_2d_to_3d( - const k4a_calibration_t *calibration, - const k4a_float2_t *source_point2d, - const float source_depth_mm, - const k4a_calibration_type_t source_camera, - const k4a_calibration_type_t target_camera, - k4a_float3_t *target_point3d_mm, - int *valid); - -k4a_result_t k4a_calibration_3d_to_2d( - const k4a_calibration_t *calibration, - const k4a_float3_t *source_point3d_mm, - const k4a_calibration_type_t source_camera, - const k4a_calibration_type_t target_camera, - k4a_float2_t *target_point2d, - int *valid); - -k4a_result_t k4a_calibration_2d_to_2d( - const k4a_calibration_t *calibration, - const k4a_float2_t *source_point2d, - const float source_depth_mm, - const k4a_calibration_type_t source_camera, - const k4a_calibration_type_t target_camera, - k4a_float2_t *target_point2d, - int *valid); - -k4a_transformation_t k4a_transformation_create( - const k4a_calibration_t *calibration); - -void k4a_transformation_destroy(k4a_transformation_t transformation_handle); - -k4a_result_t k4a_transformation_depth_image_to_color_camera( - k4a_transformation_t transformation_handle, - const k4a_image_t depth_image, - k4a_image_t transformed_depth_image); - -k4a_result_t k4a_transformation_color_image_to_depth_camera( - k4a_transformation_t transformation_handle, - const k4a_image_t depth_image, - const k4a_image_t color_image, - k4a_image_t transformed_color_image); - -k4a_result_t k4a_transformation_depth_image_to_point_cloud( - k4a_transformation_t transformation_handle, - const k4a_image_t depth_image, - const k4a_calibration_type_t camera, - k4a_image_t xyz_image); - -} // namespace k4a_plugin -} // namespace io -} // namespace open3d
deleted file mode 100644
@@ -1,62 +0,0 @@ -// ---------------------------------------------------------------------------- -// - Open3D: www.open3d.org - -// ---------------------------------------------------------------------------- -// The MIT License (MIT) -// -// Copyright (c) 2018 www.open3d.org -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -// ---------------------------------------------------------------------------- - -#include "Open3D/IO/Sensor/AzureKinect/MKVMetadata.h" - -#include <json/json.h> -#include <unordered_map> - -namespace open3d { -namespace io { - -bool MKVMetadata::ConvertToJsonValue(Json::Value &value) const { - intrinsics_.ConvertToJsonValue(value); - - value["serial_number_"] = serial_number_; - value["color_mode"] = color_mode_; - value["depth_mode"] = depth_mode_; - - value["stream_length_usec"] = stream_length_usec_; - value["width"] = width_; - value["height"] = height_; - - return true; -} -bool MKVMetadata::ConvertFromJsonValue(const Json::Value &value) { - intrinsics_.ConvertFromJsonValue(value); - - serial_number_ = value["serial_number"].asString(); - color_mode_ = value["color_mode"].asString(); - depth_mode_ = value["depth_mode"].asString(); - - stream_length_usec_ = value["stream_length_usec"].asUInt64(); - width_ = value["width"].asInt(); - height_ = value["height"].asInt(); - - return true; -} -} // namespace io -} // namespace open3d
deleted file mode 100644
@@ -1,61 +0,0 @@ -// ---------------------------------------------------------------------------- -// - Open3D: www.open3d.org - -// ---------------------------------------------------------------------------- -// The MIT License (MIT) -// -// Copyright (c) 2018 www.open3d.org -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -// ---------------------------------------------------------------------------- - -#pragma once - -#include "Open3D/Camera/PinholeCameraIntrinsic.h" -#include "Open3D/Utility/IJsonConvertible.h" - -enum class SensorType { AZURE_KINECT = 0, REAL_SENSE = 1 }; - -namespace open3d { - -namespace camera { -class PinholeCameraIntrinsic; -} - -namespace io { - -class MKVMetadata : public utility::IJsonConvertible { -public: - bool ConvertToJsonValue(Json::Value &value) const override; - bool ConvertFromJsonValue(const Json::Value &value) override; - -public: - // Shared intrinsics betwee RGB & depth. - // We assume depth image is always warped to the color image system - camera::PinholeCameraIntrinsic intrinsics_; - - std::string serial_number_ = ""; - uint64_t stream_length_usec_ = 0; - int width_; - int height_; - std::string color_mode_; - std::string depth_mode_; -}; - -} // namespace io -} // namespace open3d
deleted file mode 100644
@@ -1,181 +0,0 @@ -// ---------------------------------------------------------------------------- -// - Open3D: www.open3d.org - -// ---------------------------------------------------------------------------- -// The MIT License (MIT) -// -// Copyright (c) 2018 www.open3d.org -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -// ---------------------------------------------------------------------------- - -#include "Open3D/IO/Sensor/AzureKinect/MKVReader.h" - -#include <json/json.h> -#include <k4a/k4a.h> -#include <k4arecord/playback.h> -#include <k4arecord/record.h> -#include <turbojpeg.h> -#include <iostream> - -#include "Open3D/IO/Sensor/AzureKinect/AzureKinectSensor.h" -#include "Open3D/IO/Sensor/AzureKinect/K4aPlugin.h" - -namespace open3d { -namespace io { - -MKVReader::MKVReader() : handle_(nullptr), transformation_(nullptr) {} - -bool MKVReader::IsOpened() { return handle_ != nullptr; } - -std::string MKVReader::GetTagInMetadata(const std::string &tag_name) { - char res_buffer[256]; - size_t res_size = 256; - - k4a_buffer_result_t result = k4a_plugin::k4a_playback_get_tag( - handle_, tag_name.c_str(), res_buffer, &res_size); - if (K4A_BUFFER_RESULT_SUCCEEDED == result) { - return res_buffer; - } else if (K4A_BUFFER_RESULT_TOO_SMALL == result) { - utility::LogError("{} tag's content is too long.", tag_name); - } else { - utility::LogError("{} tag does not exist.", tag_name); - } -} - -bool MKVReader::Open(const std::string &filename) { - if (IsOpened()) { - Close(); - } - - if (K4A_RESULT_SUCCEEDED != - k4a_plugin::k4a_playback_open(filename.c_str(), &handle_)) { - utility::LogWarning("Unable to open file {}", filename); - return false; - } - - metadata_.ConvertFromJsonValue(GetMetadataJson()); - is_eof_ = false; - - return true; -} - -void MKVReader::Close() { k4a_plugin::k4a_playback_close(handle_); } - -Json::Value MKVReader::GetMetadataJson() { - static const std::unordered_map<std::string, std::pair<int, int>> - resolution_to_width_height({{"720P", std::make_pair(1280, 720)}, - {"1080P", std::make_pair(1920, 1080)}, - {"1440P", std::make_pair(2560, 1440)}, - {"1536P", std::make_pair(2048, 1536)}, - {"2160P", std::make_pair(3840, 2160)}, - {"3072P", std::make_pair(4096, 3072)}}); - - if (!IsOpened()) { - utility::LogError("Null file handler. Please call Open()."); - } - - Json::Value value; - - k4a_calibration_t calibration; - if (K4A_RESULT_SUCCEEDED != - k4a_plugin::k4a_playback_get_calibration(handle_, &calibration)) { - utility::LogError("Failed to get calibration"); - } - - camera::PinholeCameraIntrinsic pinhole_camera; - auto color_camera_calibration = calibration.color_camera_calibration; - auto param = color_camera_calibration.intrinsics.parameters.param; - pinhole_camera.SetIntrinsics(color_camera_calibration.resolution_width, - color_camera_calibration.resolution_height, - param.fx, param.fy, param.cx, param.cy); - pinhole_camera.ConvertToJsonValue(value); - - value["serial_number"] = GetTagInMetadata("K4A_DEVICE_SERIAL_NUMBER"); - value["depth_mode"] = GetTagInMetadata("K4A_DEPTH_MODE"); - value["color_mode"] = GetTagInMetadata("K4A_COLOR_MODE"); - - value["stream_length_usec"] = - k4a_plugin::k4a_playback_get_last_timestamp_usec(handle_); - auto color_mode = value["color_mode"].asString(); - size_t pos = color_mode.find('_'); - if (pos == std::string::npos) { - utility::LogError("Unknown color format {}", color_mode); - } - std::string resolution = - std::string(color_mode.begin() + pos + 1, color_mode.end()); - if (resolution_to_width_height.count(resolution) == 0) { - utility::LogError("Unknown resolution format {}", resolution); - } - - auto width_height = resolution_to_width_height.at(resolution); - value["width"] = width_height.first; - value["height"] = width_height.second; - - // For internal usages - transformation_ = k4a_plugin::k4a_transformation_create(&calibration); - - return value; -} - -bool MKVReader::SeekTimestamp(size_t timestamp) { - if (!IsOpened()) { - utility::LogWarning("Null file handler. Please call Open()."); - return false; - } - - if (timestamp >= metadata_.stream_length_usec_) { - utility::LogWarning("Timestamp {} exceeds maximum {} (us).", timestamp, - metadata_.stream_length_usec_); - return false; - } - - if (K4A_RESULT_SUCCEEDED != - k4a_plugin::k4a_playback_seek_timestamp(handle_, timestamp, - K4A_PLAYBACK_SEEK_BEGIN)) { - utility::LogWarning("Unable to go to timestamp {}", timestamp); - return false; - } - return true; -} - -std::shared_ptr<geometry::RGBDImage> MKVReader::NextFrame() { - if (!IsOpened()) { - utility::LogError("Null file handler. Please call Open()."); - } - - k4a_capture_t k4a_capture; - k4a_stream_result_t res = - k4a_plugin::k4a_playback_get_next_capture(handle_, &k4a_capture); - if (K4A_STREAM_RESULT_EOF == res) { - utility::LogInfo("EOF reached"); - is_eof_ = true; - return nullptr; - } else if (K4A_STREAM_RESULT_FAILED == res) { - utility::LogInfo("Empty frame encountered, skip"); - return nullptr; - } - - auto rgbd = - AzureKinectSensor::DecompressCapture(k4a_capture, transformation_); - k4a_plugin::k4a_capture_release(k4a_capture); - - return rgbd; -} -} // namespace io -} // namespace open3d
deleted file mode 100644
@@ -1,66 +0,0 @@ -// ---------------------------------------------------------------------------- -// - Open3D: www.open3d.org - -// ---------------------------------------------------------------------------- -// The MIT License (MIT) -// -// Copyright (c) 2018 www.open3d.org -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -// ---------------------------------------------------------------------------- - -#pragma once - -#include "Open3D/Geometry/RGBDImage.h" -#include "Open3D/IO/Sensor/AzureKinect/MKVMetadata.h" -#include "Open3D/Utility/IJsonConvertible.h" - -struct _k4a_playback_t; // typedef _k4a_playback_t* k4a_playback_t; -struct _k4a_capture_t; // typedef _k4a_capture_t* k4a_capture_t; -struct _k4a_transformation_t; // typedef _k4a_transformation_t* - // k4a_transformation_t; - -namespace open3d { -namespace io { - -class MKVReader { -public: - MKVReader(); - virtual ~MKVReader() {} - - bool IsOpened(); - bool IsEOF() { return is_eof_; } - - bool Open(const std::string &filename); - void Close(); - - MKVMetadata &GetMetadata() { return metadata_; } - bool SeekTimestamp(size_t timestamp); - std::shared_ptr<geometry::RGBDImage> NextFrame(); - -private: - _k4a_playback_t *handle_; - _k4a_transformation_t *transformation_; - MKVMetadata metadata_; - bool is_eof_ = false; - - Json::Value GetMetadataJson(); - std::string GetTagInMetadata(const std::string &tag_name); -}; -} // namespace io -} // namespace open3d
deleted file mode 100644
@@ -1,91 +0,0 @@ -// ---------------------------------------------------------------------------- -// - Open3D: www.open3d.org - -// ---------------------------------------------------------------------------- -// The MIT License (MIT) -// -// Copyright (c) 2018 www.open3d.org -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -// ---------------------------------------------------------------------------- - -#include "Open3D/IO/Sensor/AzureKinect/MKVWriter.h" - -#include <k4a/k4a.h> -#include <k4arecord/playback.h> -#include <k4arecord/record.h> - -#include "Open3D/IO/Sensor/AzureKinect/K4aPlugin.h" - -namespace open3d { -namespace io { - -MKVWriter::MKVWriter() : handle_(nullptr) {} - -bool MKVWriter::Open(const std::string &filename, - const _k4a_device_configuration_t &config, - k4a_device_t device) { - if (IsOpened()) { - Close(); - } - - if (K4A_RESULT_SUCCEEDED != k4a_plugin::k4a_record_create(filename.c_str(), - device, config, - &handle_)) { - utility::LogWarning("Unable to open file {}", filename); - return false; - } - - return true; -} - -bool MKVWriter::IsOpened() { return handle_ != nullptr; } - -bool MKVWriter::SetMetadata(const MKVMetadata &metadata) { - metadata_ = metadata; - - if (K4A_RESULT_SUCCEEDED != k4a_plugin::k4a_record_write_header(handle_)) { - utility::LogWarning("Unable to write header"); - return false; - } - return true; -} - -void MKVWriter::Close() { - if (K4A_RESULT_SUCCEEDED != k4a_plugin::k4a_record_flush(handle_)) { - utility::LogWarning("Unable to flush before writing"); - } - k4a_plugin::k4a_record_close(handle_); -} - -bool MKVWriter::NextFrame(k4a_capture_t capture) { - if (!IsOpened()) { - utility::LogWarning("Null file handler. Please call Open()."); - return false; - } - - if (K4A_RESULT_SUCCEEDED != - k4a_plugin::k4a_record_write_capture(handle_, capture)) { - utility::LogWarning("Unable to write frame to mkv."); - return false; - } - - return true; -} -} // namespace io -} // namespace open3d
deleted file mode 100644
@@ -1,62 +0,0 @@ -// ---------------------------------------------------------------------------- -// - Open3D: www.open3d.org - -// ---------------------------------------------------------------------------- -// The MIT License (MIT) -// -// Copyright (c) 2018 www.open3d.org -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -// ---------------------------------------------------------------------------- - -#pragma once - -#include "Open3D/Geometry/RGBDImage.h" -#include "Open3D/IO/Sensor/AzureKinect/MKVMetadata.h" -#include "Open3D/Utility/IJsonConvertible.h" - -struct _k4a_device_configuration_t; // Alias of k4a_device_configuration_t -struct _k4a_device_t; // typedef _k4a_device_t* k4a_device_t; -struct _k4a_capture_t; // typedef _k4a_capture_t* k4a_capture_t; -struct _k4a_record_t; // typedef _k4a_record_t* k4a_record_t; - -namespace open3d { -namespace io { - -class MKVWriter { -public: - MKVWriter(); - virtual ~MKVWriter() {} - - bool IsOpened(); - - /* We assume device is already set properly according to config */ - bool Open(const std::string &filename, - const _k4a_device_configuration_t &config, - _k4a_device_t *device); - void Close(); - - bool SetMetadata(const MKVMetadata &metadata); - bool NextFrame(_k4a_capture_t *); - -private: - _k4a_record_t *handle_; - MKVMetadata metadata_; -}; -} // namespace io -} // namespace open3d
deleted file mode 100644
@@ -1,235 +0,0 @@ -// ---------------------------------------------------------------------------- -// - Open3D: www.open3d.org - -// ---------------------------------------------------------------------------- -// The MIT License (MIT) -// -// Copyright (c) 2018 www.open3d.org -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -// ---------------------------------------------------------------------------- - -#pragma once - -// clang-format off -#define ARGS_1(a1, ...) a1 -#define ARGS_2(a1, a2, ...) a2 -#define ARGS_3(a1, a2, a3, ...) a3 -#define ARGS_4(a1, a2, a3, a4, ...) a4 -#define ARGS_5(a1, a2, a3, a4, a5, ...) a5 -#define ARGS_6(a1, a2, a3, a4, a5, a6, ...) a6 -#define ARGS_7(a1, a2, a3, a4, a5, a6, a7, ...) a7 -#define ARGS_8(a1, a2, a3, a4, a5, a6, a7, a8, ...) a8 -#define ARGS_9(a1, a2, a3, a4, a5, a6, a7, a8, a9, ...) a9 -#define ARGS_10(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, ...) a10 -#define ARGS_11(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, ...) a11 -#define ARGS_12(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, ...) a12 -#define ARGS_13(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, ...) a13 -#define ARGS_14(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, ...) a14 -#define ARGS_15(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, ...) a15 -#define ARGS_16(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, ...) a16 -#define ARGS_17(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, ...) a17 -#define ARGS_18(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, ...) a18 -#define ARGS_19(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, ...) a19 -#define ARGS_20(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, ...) a20 -#define ARGS_21(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, ...) a21 -// clang-format on - -#define EXPAND(x) x // MSVC fix - -// Count __VA_ARGS__ for MSVC https://stackoverflow.com/a/26685339/1255535 -#ifdef _MSC_VER - -#define __NARGS(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, \ - _15, _16, _17, _18, _19, _20, _21, VAL, ...) \ - VAL -#define NARGS_1(...) \ - EXPAND(__NARGS(__VA_ARGS__, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, \ - 8, 7, 6, 5, 4, 3, 2, 1, 0)) -#define AUGMENTER(...) unused, __VA_ARGS__ -#define COUNT_ARGS(...) NARGS_1(AUGMENTER(__VA_ARGS__)) - -#else -#define COUNT_ARGS(...) \ - __NARGS(0, ##__VA_ARGS__, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, \ - 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) -#define __NARGS(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, \ - _14, _15, _16, _17, _18, _19, _20, _21, N, ...) \ - N - -#endif - -// Convert to list of "arg_type arg_name" -// Converts: -// float, a1, int, a2, short, a3, double, a4 -// To: -// float a1, int a2, short a3, double a4 -// clang-format off -#define EXTRACT_TYPES_PARAMS_0(...) - -// Workaround: with older compilers ##__VA_ARGS__ may not eliminate unnecessary -// comma when __VA_ARGS__ is empty. -// In this case, COUNT_ARGS() will be 1 where it should be 0. -#define EXTRACT_TYPES_PARAMS_1(...) - -#define EXTRACT_TYPES_PARAMS_2(...) \ - EXPAND(ARGS_1(__VA_ARGS__)) EXPAND(ARGS_2(__VA_ARGS__)) - -#define EXTRACT_TYPES_PARAMS_4(...) \ - EXPAND(ARGS_1(__VA_ARGS__)) EXPAND(ARGS_2(__VA_ARGS__)), \ - EXPAND(ARGS_3(__VA_ARGS__)) EXPAND(ARGS_4(__VA_ARGS__)) - -#define EXTRACT_TYPES_PARAMS_6(...) \ - EXPAND(ARGS_1(__VA_ARGS__)) EXPAND(ARGS_2(__VA_ARGS__)), \ - EXPAND(ARGS_3(__VA_ARGS__)) EXPAND(ARGS_4(__VA_ARGS__)), \ - EXPAND(ARGS_5(__VA_ARGS__)) EXPAND(ARGS_6(__VA_ARGS__)) - -#define EXTRACT_TYPES_PARAMS_8(...) \ - EXPAND(ARGS_1 (__VA_ARGS__)) EXPAND(ARGS_2 (__VA_ARGS__)), \ - EXPAND(ARGS_3 (__VA_ARGS__)) EXPAND(ARGS_4 (__VA_ARGS__)), \ - EXPAND(ARGS_5 (__VA_ARGS__)) EXPAND(ARGS_6 (__VA_ARGS__)), \ - EXPAND(ARGS_7 (__VA_ARGS__)) EXPAND(ARGS_8 (__VA_ARGS__)) - -#define EXTRACT_TYPES_PARAMS_10(...) \ - EXPAND(ARGS_1 (__VA_ARGS__)) EXPAND(ARGS_2 (__VA_ARGS__)), \ - EXPAND(ARGS_3 (__VA_ARGS__)) EXPAND(ARGS_4 (__VA_ARGS__)), \ - EXPAND(ARGS_5 (__VA_ARGS__)) EXPAND(ARGS_6 (__VA_ARGS__)), \ - EXPAND(ARGS_7 (__VA_ARGS__)) EXPAND(ARGS_8 (__VA_ARGS__)), \ - EXPAND(ARGS_9 (__VA_ARGS__)) EXPAND(ARGS_10(__VA_ARGS__)) - -#define EXTRACT_TYPES_PARAMS_12(...) \ - EXPAND(ARGS_1 (__VA_ARGS__)) EXPAND(ARGS_2 (__VA_ARGS__)), \ - EXPAND(ARGS_3 (__VA_ARGS__)) EXPAND(ARGS_4 (__VA_ARGS__)), \ - EXPAND(ARGS_5 (__VA_ARGS__)) EXPAND(ARGS_6 (__VA_ARGS__)), \ - EXPAND(ARGS_7 (__VA_ARGS__)) EXPAND(ARGS_8 (__VA_ARGS__)), \ - EXPAND(ARGS_9 (__VA_ARGS__)) EXPAND(ARGS_10(__VA_ARGS__)), \ - EXPAND(ARGS_11(__VA_ARGS__)) EXPAND(ARGS_12(__VA_ARGS__)) - -#define EXTRACT_TYPES_PARAMS_14(...) \ - EXPAND(ARGS_1 (__VA_ARGS__)) EXPAND(ARGS_2 (__VA_ARGS__)), \ - EXPAND(ARGS_3 (__VA_ARGS__)) EXPAND(ARGS_4 (__VA_ARGS__)), \ - EXPAND(ARGS_5 (__VA_ARGS__)) EXPAND(ARGS_6 (__VA_ARGS__)), \ - EXPAND(ARGS_7 (__VA_ARGS__)) EXPAND(ARGS_8 (__VA_ARGS__)), \ - EXPAND(ARGS_9 (__VA_ARGS__)) EXPAND(ARGS_10(__VA_ARGS__)), \ - EXPAND(ARGS_11(__VA_ARGS__)) EXPAND(ARGS_12(__VA_ARGS__)), \ - EXPAND(ARGS_13(__VA_ARGS__)) EXPAND(ARGS_14(__VA_ARGS__)) - -#define EXTRACT_TYPES_PARAMS_16(...) \ - EXPAND(ARGS_1 (__VA_ARGS__)) EXPAND(ARGS_2 (__VA_ARGS__)), \ - EXPAND(ARGS_3 (__VA_ARGS__)) EXPAND(ARGS_4 (__VA_ARGS__)), \ - EXPAND(ARGS_5 (__VA_ARGS__)) EXPAND(ARGS_6 (__VA_ARGS__)), \ - EXPAND(ARGS_7 (__VA_ARGS__)) EXPAND(ARGS_8 (__VA_ARGS__)), \ - EXPAND(ARGS_9 (__VA_ARGS__)) EXPAND(ARGS_10(__VA_ARGS__)), \ - EXPAND(ARGS_11(__VA_ARGS__)) EXPAND(ARGS_12(__VA_ARGS__)), \ - EXPAND(ARGS_13(__VA_ARGS__)) EXPAND(ARGS_14(__VA_ARGS__)), \ - EXPAND(ARGS_15(__VA_ARGS__)) EXPAND(ARGS_16(__VA_ARGS__)) - -#define EXTRACT_TYPES_PARAMS_18(...) \ - EXPAND(ARGS_1 (__VA_ARGS__)) EXPAND(ARGS_2 (__VA_ARGS__)), \ - EXPAND(ARGS_3 (__VA_ARGS__)) EXPAND(ARGS_4 (__VA_ARGS__)), \ - EXPAND(ARGS_5 (__VA_ARGS__)) EXPAND(ARGS_6 (__VA_ARGS__)), \ - EXPAND(ARGS_7 (__VA_ARGS__)) EXPAND(ARGS_8 (__VA_ARGS__)), \ - EXPAND(ARGS_9 (__VA_ARGS__)) EXPAND(ARGS_10(__VA_ARGS__)), \ - EXPAND(ARGS_11(__VA_ARGS__)) EXPAND(ARGS_12(__VA_ARGS__)), \ - EXPAND(ARGS_13(__VA_ARGS__)) EXPAND(ARGS_14(__VA_ARGS__)), \ - EXPAND(ARGS_15(__VA_ARGS__)) EXPAND(ARGS_16(__VA_ARGS__)), \ - EXPAND(ARGS_17(__VA_ARGS__)) EXPAND(ARGS_18(__VA_ARGS__)) - -#define EXTRACT_TYPES_PARAMS_20(...) \ - EXPAND(ARGS_1 (__VA_ARGS__)) EXPAND(ARGS_2 (__VA_ARGS__)), \ - EXPAND(ARGS_3 (__VA_ARGS__)) EXPAND(ARGS_4 (__VA_ARGS__)), \ - EXPAND(ARGS_5 (__VA_ARGS__)) EXPAND(ARGS_6 (__VA_ARGS__)), \ - EXPAND(ARGS_7 (__VA_ARGS__)) EXPAND(ARGS_8 (__VA_ARGS__)), \ - EXPAND(ARGS_9 (__VA_ARGS__)) EXPAND(ARGS_10(__VA_ARGS__)), \ - EXPAND(ARGS_11(__VA_ARGS__)) EXPAND(ARGS_12(__VA_ARGS__)), \ - EXPAND(ARGS_13(__VA_ARGS__)) EXPAND(ARGS_14(__VA_ARGS__)), \ - EXPAND(ARGS_15(__VA_ARGS__)) EXPAND(ARGS_16(__VA_ARGS__)), \ - EXPAND(ARGS_17(__VA_ARGS__)) EXPAND(ARGS_18(__VA_ARGS__)), \ - EXPAND(ARGS_19(__VA_ARGS__)) EXPAND(ARGS_20(__VA_ARGS__)) -// clang-format on - -// Convert to list of "arg_type arg_name" caller -#define EXTRACT_TYPES_PARAMS(num_args, ...) \ - EXTRACT_TYPES_PARAMS_##num_args(__VA_ARGS__) - -// Convert to list of "arg_name" -// Converts: -// float, a1, int, a2, short, a3, double, a4 -// To: -// a1, a2, a3, a4 -// clang-format off -#define EXTRACT_PARAMS_0(...) - -// Workaround: with older compilers ##__VA_ARGS__ may not eliminate unnecessary -// comma when __VA_ARGS__ is empty. -// In this case, COUNT_ARGS() will be 1 where it should be 0. -#define EXTRACT_PARAMS_1(...) - -#define EXTRACT_PARAMS_2(...) \ - EXPAND(ARGS_2(__VA_ARGS__)) - -#define EXTRACT_PARAMS_4(...) \ - EXPAND(ARGS_2(__VA_ARGS__)), EXPAND(ARGS_4(__VA_ARGS__)) - -#define EXTRACT_PARAMS_6(...) \ - EXPAND(ARGS_2(__VA_ARGS__)), EXPAND(ARGS_4(__VA_ARGS__)), \ - EXPAND(ARGS_6(__VA_ARGS__)) - -#define EXTRACT_PARAMS_8(...) \ - EXPAND(ARGS_2(__VA_ARGS__)), EXPAND(ARGS_4(__VA_ARGS__)), \ - EXPAND(ARGS_6(__VA_ARGS__)), EXPAND(ARGS_8(__VA_ARGS__)) - -#define EXTRACT_PARAMS_10(...) \ - EXPAND(ARGS_2 (__VA_ARGS__)), EXPAND(ARGS_4 (__VA_ARGS__)), \ - EXPAND(ARGS_6 (__VA_ARGS__)), EXPAND(ARGS_8 (__VA_ARGS__)), \ - EXPAND(ARGS_10(__VA_ARGS__)) - -#define EXTRACT_PARAMS_12(...) \ - EXPAND(ARGS_2 (__VA_ARGS__)), EXPAND(ARGS_4 (__VA_ARGS__)), \ - EXPAND(ARGS_6 (__VA_ARGS__)), EXPAND(ARGS_8 (__VA_ARGS__)), \ - EXPAND(ARGS_10(__VA_ARGS__)), EXPAND(ARGS_12(__VA_ARGS__)) - -#define EXTRACT_PARAMS_14(...) \ - EXPAND(ARGS_2 (__VA_ARGS__)), EXPAND(ARGS_4 (__VA_ARGS__)), \ - EXPAND(ARGS_6 (__VA_ARGS__)), EXPAND(ARGS_8 (__VA_ARGS__)), \ - EXPAND(ARGS_10(__VA_ARGS__)), EXPAND(ARGS_12(__VA_ARGS__)), \ - EXPAND(ARGS_14(__VA_ARGS__)) - -#define EXTRACT_PARAMS_16(...) \ - EXPAND(ARGS_2 (__VA_ARGS__)), EXPAND(ARGS_4 (__VA_ARGS__)), \ - EXPAND(ARGS_6 (__VA_ARGS__)), EXPAND(ARGS_8 (__VA_ARGS__)), \ - EXPAND(ARGS_10(__VA_ARGS__)), EXPAND(ARGS_12(__VA_ARGS__)), \ - EXPAND(ARGS_14(__VA_ARGS__)), EXPAND(ARGS_16(__VA_ARGS__)) - -#define EXTRACT_PARAMS_18(...) \ - EXPAND(ARGS_2 (__VA_ARGS__)), EXPAND(ARGS_4 (__VA_ARGS__)), \ - EXPAND(ARGS_6 (__VA_ARGS__)), EXPAND(ARGS_8 (__VA_ARGS__)), \ - EXPAND(ARGS_10(__VA_ARGS__)), EXPAND(ARGS_12(__VA_ARGS__)), \ - EXPAND(ARGS_14(__VA_ARGS__)), EXPAND(ARGS_16(__VA_ARGS__)), \ - EXPAND(ARGS_18(__VA_ARGS__)) - -#define EXTRACT_PARAMS_20(...) \ - EXPAND(ARGS_2 (__VA_ARGS__)), EXPAND(ARGS_4 (__VA_ARGS__)), \ - EXPAND(ARGS_6 (__VA_ARGS__)), EXPAND(ARGS_8 (__VA_ARGS__)), \ - EXPAND(ARGS_10(__VA_ARGS__)), EXPAND(ARGS_12(__VA_ARGS__)), \ - EXPAND(ARGS_14(__VA_ARGS__)), EXPAND(ARGS_16(__VA_ARGS__)), \ - EXPAND(ARGS_18(__VA_ARGS__)), EXPAND(ARGS_20(__VA_ARGS__)) -// clang-format on - -// Convert to list of "arg_name" caller -#define EXTRACT_PARAMS(num_args, ...) EXTRACT_PARAMS_##num_args(__VA_ARGS__)
@@ -65,6 +65,7 @@ #include "Open3D/Utility/FileSystem.h" #include "Open3D/Utility/Helper.h" #include "Open3D/Utility/Timer.h" +/* #include "Open3D/Visualization/Utility/DrawGeometry.h" #include "Open3D/Visualization/Utility/SelectionPolygon.h" #include "Open3D/Visualization/Utility/SelectionPolygonVolume.h" @@ -76,14 +77,17 @@ #include "Open3D/Visualization/Visualizer/VisualizerWithEditing.h" #include "Open3D/Visualization/Visualizer/VisualizerWithKeyCallback.h" #include "Open3D/Visualization/Visualizer/VisualizerWithVertexSelection.h" +*/ // clang-format off +/* @BUILD_AZURE_KINECT_COMMENT@#include "Open3D/IO/Sensor/AzureKinect/AzureKinectRecorder.h" @BUILD_AZURE_KINECT_COMMENT@#include "Open3D/IO/Sensor/AzureKinect/AzureKinectSensorConfig.h" @BUILD_AZURE_KINECT_COMMENT@#include "Open3D/IO/Sensor/AzureKinect/AzureKinectSensor.h" @BUILD_AZURE_KINECT_COMMENT@#include "Open3D/IO/Sensor/AzureKinect/MKVMetadata.h" @BUILD_AZURE_KINECT_COMMENT@#include "Open3D/IO/Sensor/AzureKinect/MKVReader.h" @BUILD_AZURE_KINECT_COMMENT@#include "Open3D/IO/Sensor/AzureKinect/MKVWriter.h" +*/ @BUILD_AZURE_KINECT_COMMENT@#include "Open3D/IO/Sensor/RGBDRecorder.h" @BUILD_AZURE_KINECT_COMMENT@#include "Open3D/IO/Sensor/RGBDSensorConfig.h" @BUILD_AZURE_KINECT_COMMENT@#include "Open3D/IO/Sensor/RGBDSensor.h"
|