├── 3rdparty └── android │ ├── boost-build.sh │ ├── boost-fetch.sh │ ├── functions.shinc │ ├── libusb-build.sh │ ├── libusb-fetch.sh │ ├── ndk-modules │ ├── OpenNI │ │ └── Android.mk │ ├── Sensor │ │ └── Android.mk │ ├── boost │ │ └── Android.mk │ └── tbb │ │ └── Android.mk │ ├── openni-build.sh │ ├── openni-fetch.sh │ ├── patches │ ├── boost.patch │ ├── libusb.patch │ ├── openni │ │ ├── android-install-path-var.patch │ │ ├── build-flags.patch │ │ ├── dynamic-linker.patch │ │ ├── format-args.patch │ │ ├── java-bindings-bugs.patch │ │ ├── paths.patch │ │ ├── series │ │ ├── setschedparam.patch │ │ ├── substitute-libusb.patch │ │ ├── update-android-project.patch │ │ ├── usb-race-condition.patch │ │ └── useless-android-files.patch │ └── sensor │ │ ├── bayer-buffer.patch │ │ ├── build-flags.patch │ │ ├── dynamic-linker.patch │ │ ├── file-log-disable.patch │ │ ├── kinect.patch │ │ ├── magic-handling.patch │ │ ├── rules.patch │ │ └── series │ ├── tbb-build.sh │ └── tbb-fetch.sh ├── LICENSE ├── README.md └── apps ├── android ├── BodyParts │ ├── .gitignore │ ├── AndroidManifest.xml │ ├── README.txt │ ├── assets │ │ └── ni │ │ │ ├── data │ │ │ ├── GlobalDefaults.ini │ │ │ └── GlobalDefaultsKinect.ini │ │ │ └── dir.txt │ ├── build.sh │ ├── jni │ │ ├── Android.mk │ │ ├── Application.mk │ │ └── bodyparts │ │ │ ├── Android.mk │ │ │ ├── body_parts_recognizer.cpp │ │ │ ├── body_parts_recognizer.h │ │ │ ├── cloud.cpp │ │ │ ├── cloud.h │ │ │ ├── file_grabber.cpp │ │ │ ├── grabber.h │ │ │ ├── jni_helper.hpp │ │ │ ├── openni_grabber.cpp │ │ │ ├── org_pointclouds_bodyparts_Application.cpp │ │ │ ├── org_pointclouds_bodyparts_Application.h │ │ │ ├── org_pointclouds_bodyparts_BodyPartsRecognizer.cpp │ │ │ ├── org_pointclouds_bodyparts_BodyPartsRecognizer.h │ │ │ ├── org_pointclouds_bodyparts_Cloud.cpp │ │ │ ├── org_pointclouds_bodyparts_Cloud.h │ │ │ ├── org_pointclouds_bodyparts_Grabber.cpp │ │ │ ├── org_pointclouds_bodyparts_Grabber.h │ │ │ ├── stopwatch.cpp │ │ │ └── stopwatch.h │ ├── project.properties │ ├── res │ │ ├── drawable-hdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-ldpi │ │ │ └── ic_launcher.png │ │ ├── drawable-mdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-xhdpi │ │ │ └── ic_launcher.png │ │ ├── layout │ │ │ ├── color_list_item.xml │ │ │ └── main.xml │ │ ├── menu │ │ │ └── main_menu.xml │ │ └── values │ │ │ └── strings.xml │ ├── src │ │ └── org │ │ │ └── pointclouds │ │ │ └── bodyparts │ │ │ ├── Application.java │ │ │ ├── BodyPartLabel.java │ │ │ ├── BodyPartLabelAdapter.java │ │ │ ├── BodyPartsRecognizer.java │ │ │ ├── Cloud.java │ │ │ ├── Grabber.java │ │ │ ├── Main.java │ │ │ ├── MainLoop.java │ │ │ └── ProxyFeedback.java │ └── tools │ │ ├── CMakeLists.txt │ │ ├── pcd2rgbd.cpp │ │ └── treetxt2bin.cpp ├── KiwiPCL │ ├── AndroidManifest.xml │ ├── CMakeLists.txt │ ├── FindFlann.cmake │ ├── README │ ├── assets │ │ ├── inputCloud0.pcd │ │ ├── inputCloud1.pcd │ │ ├── kiwi.png │ │ ├── vesShader_frag.glsl │ │ └── vesShader_vert.glsl │ ├── build │ │ └── my.sh │ ├── compile.sh │ ├── configure_ant.sh │ ├── jni │ │ ├── Android.mk │ │ ├── KiwiNative.cpp │ │ ├── myFunctions.cpp │ │ ├── myFunctions.h │ │ ├── pcl_demo.cpp │ │ ├── pcl_demo.h │ │ ├── profiler.cpp │ │ └── vtkAndroidOutputWindow.h │ ├── project.properties │ ├── res │ │ ├── drawable-hdpi │ │ │ ├── alert_dialog_icon.png │ │ │ ├── info_icon.png │ │ │ └── kiwi_small_icon.png │ │ ├── drawable-mdpi │ │ │ ├── alert_dialog_icon.png │ │ │ └── kiwi_small_icon.png │ │ ├── drawable │ │ │ ├── icon.png │ │ │ ├── info.xml │ │ │ ├── info_active.png │ │ │ ├── info_inactive.png │ │ │ ├── kitwarelogo.png │ │ │ ├── opendata.xml │ │ │ ├── opendata_active.png │ │ │ ├── opendata_inactive.png │ │ │ ├── reset.xml │ │ │ ├── reset_active.png │ │ │ └── reset_inactive.png │ │ ├── layout │ │ │ ├── datasetlistactivity.xml │ │ │ ├── infoactivity.xml │ │ │ └── kiwivieweractivity.xml │ │ ├── values-v11 │ │ │ └── styles.xml │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── run.sh │ ├── show_log.sh │ ├── src │ │ ├── com │ │ │ └── itseez │ │ │ │ └── icpdemo │ │ │ │ ├── DatasetListActivity.java │ │ │ │ ├── InfoActivity.java │ │ │ │ ├── KiwiGLSurfaceView.java │ │ │ │ ├── KiwiNative.java │ │ │ │ └── KiwiViewerActivity.java │ │ └── org │ │ │ └── metalev │ │ │ └── multitouch │ │ │ └── controller │ │ │ └── MultiTouchController.java │ ├── tools.sh │ └── vesKiwi.patch ├── KiwiPCLKinect │ ├── AndroidManifest.xml │ ├── CMakeLists.txt │ ├── FindFlann.cmake │ ├── README │ ├── assets │ │ ├── inputCloud0.pcd │ │ ├── inputCloud1.pcd │ │ ├── kiwi.png │ │ ├── ni │ │ │ ├── data │ │ │ │ ├── GlobalDefaults.ini │ │ │ │ └── GlobalDefaultsKinect.ini │ │ │ └── dir.txt │ │ ├── vesShader_frag.glsl │ │ └── vesShader_vert.glsl │ ├── build.sh │ ├── build │ │ └── my.sh │ ├── compile.sh │ ├── configure_ant.sh │ ├── jni │ │ ├── Android.mk │ │ ├── Application.mk │ │ ├── KiwiNative.cpp │ │ ├── myFunctions.cpp │ │ ├── myFunctions.h │ │ ├── onirec │ │ │ ├── Android.mk │ │ │ ├── com_itseez_icpdemo_Application.cpp │ │ │ ├── com_itseez_icpdemo_Application.h │ │ │ ├── com_itseez_onirec_Application.cpp │ │ │ ├── com_itseez_onirec_Application.h │ │ │ ├── com_itseez_onirec_CaptureThreadManager.cpp │ │ │ └── com_itseez_onirec_CaptureThreadManager.h │ │ ├── pcl_demo.cpp │ │ ├── pcl_demo.h │ │ ├── profiler.cpp │ │ └── vtkAndroidOutputWindow.h │ ├── project.properties │ ├── res │ │ ├── drawable-hdpi │ │ │ ├── alert_dialog_icon.png │ │ │ ├── info_icon.png │ │ │ └── kiwi_small_icon.png │ │ ├── drawable-mdpi │ │ │ ├── alert_dialog_icon.png │ │ │ └── kiwi_small_icon.png │ │ ├── drawable │ │ │ ├── icon.png │ │ │ ├── info.xml │ │ │ ├── info_active.png │ │ │ ├── info_inactive.png │ │ │ ├── kitwarelogo.png │ │ │ ├── opendata.xml │ │ │ ├── opendata_active.png │ │ │ ├── opendata_inactive.png │ │ │ ├── reset.xml │ │ │ ├── reset_active.png │ │ │ └── reset_inactive.png │ │ ├── layout │ │ │ ├── datasetlistactivity.xml │ │ │ ├── infoactivity.xml │ │ │ └── kiwivieweractivity.xml │ │ ├── values-v11 │ │ │ └── styles.xml │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── run.sh │ ├── show_log.sh │ ├── src │ │ ├── com │ │ │ └── itseez │ │ │ │ └── icpdemo │ │ │ │ ├── Application.java │ │ │ │ ├── CaptureThreadManager.java │ │ │ │ ├── DatasetListActivity.java │ │ │ │ ├── InfoActivity.java │ │ │ │ ├── KiwiGLSurfaceView.java │ │ │ │ ├── KiwiNative.java │ │ │ │ └── KiwiViewerActivity.java │ │ └── org │ │ │ ├── libusb │ │ │ └── UsbHelper.java │ │ │ └── metalev │ │ │ └── multitouch │ │ │ └── controller │ │ │ └── MultiTouchController.java │ ├── tools.sh │ └── vesKiwi.patch ├── ONIRecorder │ ├── .gitignore │ ├── AndroidManifest.xml │ ├── README.txt │ ├── assets │ │ └── ni │ │ │ ├── data │ │ │ └── GlobalDefaults.ini │ │ │ └── dir.txt │ ├── build.sh │ ├── jni │ │ ├── Android.mk │ │ ├── Application.mk │ │ └── onirec │ │ │ ├── Android.mk │ │ │ ├── org_pointclouds_onirec_Application.cpp │ │ │ ├── org_pointclouds_onirec_Application.h │ │ │ ├── org_pointclouds_onirec_CaptureThreadManager.cpp │ │ │ ├── org_pointclouds_onirec_CaptureThreadManager.h │ │ │ ├── org_pointclouds_onirec_grab_NativeBuffer.cpp │ │ │ └── org_pointclouds_onirec_grab_NativeBuffer.h │ ├── project.properties │ ├── res │ │ ├── drawable │ │ │ └── icon.png │ │ ├── layout │ │ │ └── main.xml │ │ ├── menu │ │ │ └── main_menu.xml │ │ ├── values │ │ │ └── strings.xml │ │ └── xml │ │ │ └── preferences.xml │ └── src │ │ └── org │ │ └── pointclouds │ │ └── onirec │ │ ├── Application.java │ │ ├── CaptureThreadManager.java │ │ ├── MainActivity.java │ │ ├── MapModeWrapper.java │ │ ├── PreferencesActivity.java │ │ ├── RecordingPicker.java │ │ ├── Timer.java │ │ └── grab │ │ ├── ColorGenerator.java │ │ ├── Context.java │ │ ├── ContextFactory.java │ │ ├── DepthGenerator.java │ │ ├── DummyColorGenerator.java │ │ ├── DummyContextFactory.java │ │ ├── DummyDepthGenerator.java │ │ ├── DummyGenerator.java │ │ ├── Generator.java │ │ ├── LiveContextFactory.java │ │ ├── NativeBuffer.java │ │ ├── OpenNIColorGenerator.java │ │ ├── OpenNIContext.java │ │ ├── OpenNIDepthGenerator.java │ │ ├── OpenNIGenerator.java │ │ └── RecordingContextFactory.java ├── OpenNIRecorder │ ├── .classpath │ ├── .cproject │ ├── .project │ ├── .settings │ │ ├── org.eclipse.cdt.core.prefs │ │ └── org.eclipse.jdt.core.prefs │ ├── AndroidManifest.xml │ ├── README │ ├── assets │ │ ├── courier+lucida_256.abc │ │ ├── courier+lucida_256.dds │ │ ├── direct.frag │ │ ├── direct.vert │ │ ├── multi.frag │ │ ├── multi.vert │ │ ├── overlay.frag │ │ ├── overlay.vert │ │ ├── utahcond+bold_1024.abc │ │ └── utahcond+bold_1024.dds │ ├── build_depends.sh │ ├── default.properties │ ├── fix_sd_permission.sh │ ├── install.sh │ ├── jni │ │ ├── Android.mk │ │ ├── Application.mk │ │ ├── FingerTracker.cpp │ │ ├── FingerTracker.h │ │ ├── FrameBuffer.cpp │ │ ├── FrameBuffer.h │ │ ├── Ne10.mk │ │ ├── OpenniWrapper.cpp │ │ ├── OpenniWrapper.h │ │ ├── PCLWrapper.cpp │ │ ├── PCLWrapper.h │ │ ├── capturescr.c │ │ ├── capturescr.h │ │ ├── common.h │ │ ├── config.h │ │ ├── engine.cpp │ │ ├── engine.h │ │ ├── format.h │ │ ├── kinect.cpp │ │ ├── kinect.h │ │ ├── libfreenect │ │ │ ├── cameras.c │ │ │ ├── core.c │ │ │ ├── freenect_internal.h │ │ │ ├── libfreenect-audio.h │ │ │ ├── libfreenect.h │ │ │ ├── libfreenect.hpp │ │ │ ├── libfreenect_sync.h │ │ │ ├── loader.c │ │ │ ├── loader.h │ │ │ ├── sync.c │ │ │ ├── tilt.c │ │ │ ├── usb_libusb10.c │ │ │ └── usb_libusb10.h │ │ ├── libusb │ │ │ ├── config.h │ │ │ ├── core_usb.c │ │ │ ├── descriptor.c │ │ │ ├── io.c │ │ │ ├── libusb.h │ │ │ ├── libusbi.h │ │ │ ├── linux_usbfs.c │ │ │ └── linux_usbfs.h │ │ ├── main.cpp │ │ ├── matrix.cpp │ │ ├── matrix.h │ │ ├── multi.cpp │ │ ├── pixelflinger.h │ │ ├── quicklz │ │ │ ├── quicklz.c │ │ │ └── quicklz.h │ │ ├── renderer.cpp │ │ ├── renderer.h │ │ ├── test_png.c │ │ ├── test_png.h │ │ ├── threadpool │ │ │ ├── threadpool.c │ │ │ └── threadpool.h │ │ └── vec4.h │ ├── opencv_binary │ │ └── get_binary.sh │ ├── openni_binary │ │ ├── GlobalDefaults.ini │ │ ├── README │ │ ├── SamplesConfig.xml │ │ ├── build_openni_script.sh │ │ ├── data │ │ │ └── ni │ │ │ │ ├── licenses.xml │ │ │ │ └── modules.xml │ │ ├── modules.xml │ │ └── push_libs.sh │ ├── pcl_binary │ │ ├── build_pcl_android.sh │ │ └── patch_pcl_svn.sh │ ├── platform.xml │ ├── png_binary │ │ └── get_png.sh │ ├── proguard.cfg │ ├── project.properties │ ├── pull_data.pl │ ├── res │ │ ├── drawable │ │ │ └── icon.png │ │ └── values │ │ │ └── strings.xml │ ├── run.sh │ ├── src │ │ ├── com.tgz │ │ └── do_not_remove.txt │ ├── stop.sh │ ├── uninstall.sh │ └── vold.fstab ├── PCLAndroidSample │ ├── AndroidManifest.xml │ ├── CMakeLists.txt │ ├── jni │ │ ├── hello-pcl.cpp │ │ └── hello-pcl.h │ └── src │ │ └── org │ │ └── pointclouds │ │ └── PCLAndroidSample │ │ └── HelloPCL.java ├── PointCloudStreaming │ ├── AndroidManifest.xml │ ├── CMakeLists.txt │ ├── README │ ├── assets │ │ ├── appConfig.txt │ │ ├── vesShader_frag.glsl │ │ └── vesShader_vert.glsl │ ├── clean.sh │ ├── compile.sh │ ├── configure_ant.sh │ ├── configure_cmake.sh │ ├── install.sh │ ├── jni │ │ ├── CMakeLists.txt │ │ └── PointCloudStreaming.cpp │ ├── res │ │ ├── drawable │ │ │ └── pcl_logo.png │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── show_log.sh │ └── tools.sh ├── README ├── android_dependencies │ ├── FindStandardMathLibrary.cmake.patch │ └── install_dependencies.sh └── script.sh └── ios └── HelloPCL ├── CMakeLists.txt ├── EAGLView.h ├── EAGLView.mm ├── ES2Renderer.h ├── ES2Renderer.mm ├── GLViewController.h ├── GLViewController.m ├── InfoView.h ├── InfoView.m ├── InfoView.xib ├── Kiwi-Info.plist ├── Kiwi-Prefix.pch ├── LoadDataController.h ├── LoadDataController.m ├── MainWindow.xib ├── TitleBarViewContainer.h ├── TitleBarViewContainer.m ├── TitleBarViewContainer.xib ├── cmake_command.sh ├── data └── pointcloud.pcd ├── images ├── Default-Landscape~ipad.png ├── Default-Portrait~ipad.png ├── Kiwi_K.png ├── fullscreen_32.png ├── kiwi_icon_114.png ├── kiwi_icon_57.png ├── kiwi_icon_72.png └── opendata_32.png ├── kiwiAppDelegate.h ├── kiwiAppDelegate.mm ├── main.m ├── vesKiwiPCLApp.h ├── vesKiwiPCLDemo.cpp ├── vesKiwiPCLDemo.h ├── vtkPCLConversions.cxx ├── vtkPCLConversions.h ├── vtkPCLSACSegmentationPlane.cxx ├── vtkPCLSACSegmentationPlane.h ├── vtkPCLVoxelGrid.cxx └── vtkPCLVoxelGrid.h /3rdparty/android/boost-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | . ./functions.shinc 6 | 7 | require_standalone_toolchain 8 | 9 | (cd src/boost && 10 | ./b2 toolset=gcc-androidarmv7a abi=aapcs variant=release debug-symbols=on \ 11 | threading=multi link=static -s NO_BZIP2=1 -j 4) 12 | 13 | rm -rf ndk-modules/boost/include/* ndk-modules/boost/lib/armeabi-v7a/* 14 | 15 | cp -a src/boost/boost ndk-modules/boost/include 16 | cp src/boost/stage/lib/*.a ndk-modules/boost/lib/armeabi-v7a 17 | ar cr ndk-modules/boost/lib/armeabi-v7a/dummy.a 18 | -------------------------------------------------------------------------------- /3rdparty/android/boost-fetch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | ver=1.52.0 6 | ver_und=$(echo $ver | tr '.' '_') 7 | 8 | rm -rf src/boost 9 | mkdir src/boost 10 | cd src/boost 11 | 12 | wget -vO- \ 13 | "http://downloads.sourceforge.net/project/boost/boost/$ver/boost_$ver_und.tar.bz2?use_mirror=autoselect" \ 14 | | tar -xj --strip-components=1 15 | 16 | patch -p1 -i ../../patches/boost.patch 17 | 18 | ./bootstrap.sh --without-libraries=python,mpi,locale --without-icu 19 | -------------------------------------------------------------------------------- /3rdparty/android/functions.shinc: -------------------------------------------------------------------------------- 1 | will_normalize_eol() { 2 | if type dos2unix > /dev/null; then 3 | DOS2UNIX=dos2unix 4 | elif type fromdos > /dev/null; then 5 | DOS2UNIX=fromdos 6 | else 7 | echo "You will need either dos2unix or fromdos for this to work." 8 | exit 1 9 | fi 10 | } 11 | 12 | normalize_eol() { 13 | find . -type f '(' \ 14 | -name '*.h' -o -name '*.c' -o -name '*.cpp' -o -name '*.java' -o -name '*.py' \ 15 | -o -name '*.sh' -o -name '*.ini' ')' \ 16 | -exec $DOS2UNIX {} ';' 17 | } 18 | 19 | apply_patch_series() { 20 | cat "$1" | while read patchname; do 21 | case "$patchname" in 22 | \#*) 23 | ;; # ignore comments 24 | *) 25 | patch -p1 -i $(dirname "$1")/$patchname 26 | ;; 27 | esac 28 | done 29 | } 30 | 31 | require_standalone_toolchain() { 32 | type arm-linux-androideabi-gcc > /dev/null || { 33 | cat << EOF 34 | Please first create a standalone toolchain using the NDK script 35 | make-standalone-toolchain.sh and add it to your PATH. For more information, 36 | see STANDALONE-TOOLCHAIN.html in Android NDK documentation. 37 | EOF 38 | exit 1 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /3rdparty/android/libusb-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | . ./functions.shinc 6 | 7 | require_standalone_toolchain 8 | 9 | (cd src/libusb/android && bash build.sh armeabi-v7a) 10 | 11 | rm -rf ndk-modules/libusb-1.0 12 | cp -a src/libusb/android/ndk-modules/libusb-1.0 ndk-modules 13 | -------------------------------------------------------------------------------- /3rdparty/android/libusb-fetch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | rm -rf src/config src/libusb 6 | 7 | git clone git://git.savannah.gnu.org/config.git src/config 8 | git clone git://git.libusb.org/libusb.git src/libusb 9 | 10 | cd src/libusb 11 | git checkout 1.0.9 12 | patch -p1 -i ../../patches/libusb.patch 13 | 14 | libtoolize --copy --force && aclocal && autoheader && autoconf && automake -a -c 15 | 16 | cp ../config/config.guess ../config/config.sub . 17 | 18 | (cd android/LibusbSupport && android update lib-project -p . --target android-14) 19 | -------------------------------------------------------------------------------- /3rdparty/android/ndk-modules/OpenNI/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | ifeq ($(NDK_DEBUG),1) 4 | openni_conf := debug 5 | else ifeq ($(NDK_DEBUG),true) 6 | openni_conf := debug 7 | else 8 | openni_conf := release 9 | endif 10 | 11 | # OpenNI ============================================= 12 | include $(CLEAR_VARS) 13 | LOCAL_MODULE := OpenNI 14 | 15 | LOCAL_SRC_FILES := lib/$(openni_conf)/$(TARGET_ARCH_ABI)/libOpenNI.so 16 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include 17 | LOCAL_SHARED_LIBRARIES := libusb-1.0 18 | 19 | include $(PREBUILT_SHARED_LIBRARY) 20 | #===================================================== 21 | 22 | # OpenNI.jni ============================================= 23 | include $(CLEAR_VARS) 24 | LOCAL_MODULE := OpenNI.jni 25 | 26 | LOCAL_SRC_FILES := lib/$(openni_conf)/$(TARGET_ARCH_ABI)/libOpenNI.jni.so 27 | LOCAL_SHARED_LIBRARIES := OpenNI 28 | 29 | include $(PREBUILT_SHARED_LIBRARY) 30 | #========================================================= 31 | 32 | # nimCodecs ============================================= 33 | include $(CLEAR_VARS) 34 | LOCAL_MODULE := nimCodecs 35 | 36 | LOCAL_SRC_FILES := lib/$(openni_conf)/$(TARGET_ARCH_ABI)/libnimCodecs.so 37 | LOCAL_SHARED_LIBRARIES := OpenNI 38 | 39 | include $(PREBUILT_SHARED_LIBRARY) 40 | #======================================================== 41 | 42 | # nimMockNodes ============================================= 43 | include $(CLEAR_VARS) 44 | LOCAL_MODULE := nimMockNodes 45 | 46 | LOCAL_SRC_FILES := lib/$(openni_conf)/$(TARGET_ARCH_ABI)/libnimMockNodes.so 47 | LOCAL_SHARED_LIBRARIES := OpenNI 48 | 49 | include $(PREBUILT_SHARED_LIBRARY) 50 | #=========================================================== 51 | 52 | # nimRecorder ============================================= 53 | include $(CLEAR_VARS) 54 | LOCAL_MODULE := nimRecorder 55 | 56 | LOCAL_SRC_FILES := lib/$(openni_conf)/$(TARGET_ARCH_ABI)/libnimRecorder.so 57 | LOCAL_SHARED_LIBRARIES := OpenNI 58 | 59 | include $(PREBUILT_SHARED_LIBRARY) 60 | #========================================================== 61 | 62 | $(call import-module,libusb-1.0) 63 | -------------------------------------------------------------------------------- /3rdparty/android/ndk-modules/Sensor/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | ifeq ($(NDK_DEBUG),1) 4 | sensor_conf := debug 5 | else ifeq ($(NDK_DEBUG),true) 6 | sensor_conf := debug 7 | else 8 | sensor_conf := release 9 | endif 10 | 11 | # XnCore ============================================= 12 | include $(CLEAR_VARS) 13 | LOCAL_MODULE := XnCore 14 | 15 | LOCAL_SRC_FILES := lib/$(sensor_conf)/$(TARGET_ARCH_ABI)/libXnCore.so 16 | LOCAL_SHARED_LIBRARIES := OpenNI 17 | 18 | include $(PREBUILT_SHARED_LIBRARY) 19 | #===================================================== 20 | 21 | # XnDDK ============================================= 22 | include $(CLEAR_VARS) 23 | LOCAL_MODULE := XnDDK 24 | 25 | LOCAL_SRC_FILES := lib/$(sensor_conf)/$(TARGET_ARCH_ABI)/libXnDDK.so 26 | LOCAL_SHARED_LIBRARIES := OpenNI XnCore XnFormats 27 | 28 | include $(PREBUILT_SHARED_LIBRARY) 29 | #==================================================== 30 | 31 | # XnDeviceFile ============================================= 32 | include $(CLEAR_VARS) 33 | LOCAL_MODULE := XnDeviceFile 34 | 35 | LOCAL_SRC_FILES := lib/$(sensor_conf)/$(TARGET_ARCH_ABI)/libXnDeviceFile.so 36 | LOCAL_SHARED_LIBRARIES := OpenNI XnCore XnFormats XnDDK 37 | 38 | include $(PREBUILT_SHARED_LIBRARY) 39 | #=========================================================== 40 | 41 | # XnDeviceSensorV2 ============================================= 42 | include $(CLEAR_VARS) 43 | LOCAL_MODULE := XnDeviceSensorV2 44 | 45 | LOCAL_SRC_FILES := lib/$(sensor_conf)/$(TARGET_ARCH_ABI)/libXnDeviceSensorV2.so 46 | LOCAL_SHARED_LIBRARIES := OpenNI XnCore XnFormats XnDDK 47 | 48 | include $(PREBUILT_SHARED_LIBRARY) 49 | #=============================================================== 50 | 51 | # XnFormats ============================================= 52 | include $(CLEAR_VARS) 53 | LOCAL_MODULE := XnFormats 54 | 55 | LOCAL_SRC_FILES := lib/$(sensor_conf)/$(TARGET_ARCH_ABI)/libXnFormats.so 56 | LOCAL_SHARED_LIBRARIES := OpenNI XnCore 57 | 58 | include $(PREBUILT_SHARED_LIBRARY) 59 | #=============================================================== 60 | 61 | $(call import-module,OpenNI) 62 | -------------------------------------------------------------------------------- /3rdparty/android/ndk-modules/boost/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | # Header-only Boost libraries =================== 4 | include $(CLEAR_VARS) 5 | LOCAL_MODULE := boost 6 | 7 | LOCAL_SRC_FILES := lib/$(TARGET_ARCH_ABI)/dummy.a 8 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include 9 | 10 | include $(PREBUILT_STATIC_LIBRARY) 11 | #================================================ 12 | 13 | # Boost.Filesystem ============================================ 14 | include $(CLEAR_VARS) 15 | LOCAL_MODULE := boost_filesystem 16 | 17 | LOCAL_SRC_FILES := lib/$(TARGET_ARCH_ABI)/libboost_filesystem.a 18 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include 19 | LOCAL_STATIC_LIBRARIES := boost_system 20 | 21 | include $(PREBUILT_STATIC_LIBRARY) 22 | #============================================================== 23 | 24 | # Boost.System ============================================ 25 | include $(CLEAR_VARS) 26 | LOCAL_MODULE := boost_system 27 | 28 | LOCAL_SRC_FILES := lib/$(TARGET_ARCH_ABI)/libboost_system.a 29 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include 30 | 31 | include $(PREBUILT_STATIC_LIBRARY) 32 | #========================================================== 33 | -------------------------------------------------------------------------------- /3rdparty/android/ndk-modules/tbb/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | ifeq ($(NDK_DEBUG),1) 4 | tbb_conf := debug 5 | else ifeq ($(NDK_DEBUG),true) 6 | tbb_conf := debug 7 | else 8 | tbb_conf := release 9 | endif 10 | 11 | ifeq ($(tbb_conf),debug) 12 | tbb_suffix := _debug 13 | else 14 | tbb_suffix := 15 | endif 16 | 17 | include $(CLEAR_VARS) 18 | LOCAL_MODULE := tbb 19 | 20 | LOCAL_SRC_FILES := lib/$(tbb_conf)/$(TARGET_ARCH_ABI)/libtbb$(tbb_suffix).so 21 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include 22 | 23 | include $(PREBUILT_SHARED_LIBRARY) 24 | 25 | include $(CLEAR_VARS) 26 | LOCAL_MODULE := tbbmalloc 27 | 28 | LOCAL_SRC_FILES := lib/$(tbb_conf)/$(TARGET_ARCH_ABI)/libtbbmalloc$(tbb_suffix).so 29 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include 30 | 31 | include $(PREBUILT_SHARED_LIBRARY) 32 | -------------------------------------------------------------------------------- /3rdparty/android/openni-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | NDK_MODULE_PATH=$(cd ndk-modules; pwd) 6 | export NDK_MODULE_PATH 7 | 8 | rm -rf "$NDK_MODULE_PATH"/OpenNI/include/* \ 9 | "$NDK_MODULE_PATH"/OpenNI/lib/debug/armeabi-v7a/* \ 10 | "$NDK_MODULE_PATH"/OpenNI/lib/release/armeabi-v7a/* 11 | 12 | cp -a src/OpenNI/Include/* "$NDK_MODULE_PATH/OpenNI/include" 13 | 14 | openni_libs="OpenNI OpenNI.jni nimCodecs nimMockNodes nimRecorder" 15 | 16 | rm -f src/OpenNI/Platform/Android/obj/local/armeabi-v7a/lib*.so 17 | 18 | (cd src/OpenNI/Platform/Android; ndk-build -j2) 19 | 20 | for libname in $openni_libs; do 21 | cp src/OpenNI/Platform/Android/obj/local/armeabi-v7a/lib$libname.so \ 22 | "$NDK_MODULE_PATH/OpenNI/lib/release/armeabi-v7a" 23 | done 24 | 25 | rm -f src/OpenNI/Platform/Android/obj/local/armeabi-v7a/lib*.so 26 | 27 | (cd src/OpenNI/Platform/Android; ndk-build -j2 NDK_DEBUG=1) 28 | 29 | for libname in $openni_libs; do 30 | cp src/OpenNI/Platform/Android/obj/local/armeabi-v7a/lib$libname.so \ 31 | "$NDK_MODULE_PATH/OpenNI/lib/debug/armeabi-v7a" 32 | done 33 | 34 | rm -rf "$NDK_MODULE_PATH"/Sensor/lib/debug/armeabi-v7a/* \ 35 | "$NDK_MODULE_PATH"/Sensor/lib/release/armeabi-v7a/* 36 | 37 | sensor_libs="XnCore XnDDK XnDeviceFile XnDeviceSensorV2 XnFormats" 38 | 39 | rm -f src/Sensor/Platform/Android/obj/local/armeabi-v7a/lib*.so 40 | 41 | (cd src/Sensor/Platform/Android; ndk-build -j2) 42 | 43 | for libname in $sensor_libs; do 44 | cp src/Sensor/Platform/Android/obj/local/armeabi-v7a/lib$libname.so \ 45 | "$NDK_MODULE_PATH/Sensor/lib/release/armeabi-v7a" 46 | done 47 | 48 | rm -f src/Sensor/Platform/Android/obj/local/armeabi-v7a/lib*.so 49 | 50 | (cd src/Sensor/Platform/Android; ndk-build -j2 NDK_DEBUG=1) 51 | 52 | for libname in $sensor_libs; do 53 | cp src/Sensor/Platform/Android/obj/local/armeabi-v7a/lib$libname.so \ 54 | "$NDK_MODULE_PATH/Sensor/lib/debug/armeabi-v7a" 55 | done 56 | -------------------------------------------------------------------------------- /3rdparty/android/openni-fetch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | . ./functions.shinc 6 | 7 | will_normalize_eol 8 | 9 | rm -rf src/OpenNI src/Sensor 10 | 11 | echo 'Downloading OpenNI...' 12 | 13 | mkdir src/OpenNI 14 | cd src/OpenNI 15 | wget -vO- http://github.com/OpenNI/OpenNI/archive/Stable-1.5.2.23.tar.gz | tar -xz --strip-components=1 16 | 17 | echo 'Normalizing EOL characters to LF...' 18 | 19 | normalize_eol 20 | 21 | echo 'Patching...' 22 | 23 | apply_patch_series ../../patches/openni/series 24 | 25 | rm -rv Wrappers/OpenNI.java/res 26 | 27 | echo 'Updating Android project...' 28 | 29 | android update lib-project -p Wrappers/OpenNI.java --target android-14 30 | 31 | cd ../.. 32 | 33 | echo 'Downloading Sensor...' 34 | 35 | mkdir src/Sensor 36 | cd src/Sensor 37 | wget -vO- http://github.com/PrimeSense/Sensor/archive/Unstable-5.1.0.41.tar.gz | tar -xz --strip-components=1 38 | 39 | echo 'Normalizing EOL characters to LF...' 40 | 41 | normalize_eol 42 | 43 | echo 'Patching...' 44 | 45 | apply_patch_series ../../patches/sensor/series 46 | 47 | cd ../.. 48 | 49 | echo 'Done.' 50 | -------------------------------------------------------------------------------- /3rdparty/android/patches/openni/android-install-path-var.patch: -------------------------------------------------------------------------------- 1 | Make the install location environment variable mandatory on Android and change the suffix. 2 | 3 | From: Roman Donchenko 4 | 5 | 6 | --- 7 | Source/OpenNI/XnOpenNI.cpp | 6 +++--- 8 | 1 file changed, 3 insertions(+), 3 deletions(-) 9 | 10 | diff --git a/Source/OpenNI/XnOpenNI.cpp b/Source/OpenNI/XnOpenNI.cpp 11 | index de4d7e7..3ceae9e 100644 12 | --- a/Source/OpenNI/XnOpenNI.cpp 13 | +++ b/Source/OpenNI/XnOpenNI.cpp 14 | @@ -6995,7 +6995,7 @@ XN_C_API XnStatus xnScriptNodeRun(XnNodeHandle hScript, XnEnumerationErrors* pEr 15 | #elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_MACOSX) 16 | #define XN_OPEN_NI_FILES_LOCATION "/etc/openni/" 17 | #elif (XN_PLATFORM == XN_PLATFORM_ANDROID_ARM) 18 | - #define XN_OPEN_NI_FILES_LOCATION "/data/ni/" 19 | + #define XN_OPEN_NI_FILES_LOCATION "/data/" 20 | #else 21 | #error "Unsupported platform!" 22 | #endif 23 | @@ -7007,8 +7007,8 @@ XnStatus xnGetOpenNIConfFilesPath(XnChar* strDest, XnUInt32 nBufSize) 24 | nRetVal = xnOSGetEnvironmentVariable(XN_OPEN_NI_INSTALL_PATH_ENV, strDest, nBufSize); 25 | if (nRetVal == XN_STATUS_OS_ENV_VAR_NOT_FOUND) 26 | { 27 | - #if (XN_PLATFORM == XN_PLATFORM_WIN32) 28 | - // we don't allow environment variable not to be defined on Windows. 29 | + #if (XN_PLATFORM == XN_PLATFORM_WIN32 || XN_PLATFORM == XN_PLATFORM_ANDROID_ARM) 30 | + // we don't allow environment variable not to be defined on Windows or Android. 31 | return nRetVal; 32 | #else 33 | // use root FS 34 | -------------------------------------------------------------------------------- /3rdparty/android/patches/openni/build-flags.patch: -------------------------------------------------------------------------------- 1 | Remove build flags that are redundant and disable optimization flags when 2 | 3 | From: Roman Donchenko 4 | 5 | debugging is enabled. 6 | --- 7 | Platform/Android/jni/Application.mk | 7 ++++--- 8 | 1 file changed, 4 insertions(+), 3 deletions(-) 9 | 10 | diff --git a/Platform/Android/jni/Application.mk b/Platform/Android/jni/Application.mk 11 | index 6d2da24..91e2646 100644 12 | --- a/Platform/Android/jni/Application.mk 13 | +++ b/Platform/Android/jni/Application.mk 14 | @@ -5,12 +5,13 @@ APP_PLATFORM := android-9 15 | 16 | # Build ARMv7-A machine code. 17 | APP_ABI := armeabi-v7a 18 | -APP_CFLAGS := -O3 -ftree-vectorize -ffast-math -funroll-loops 19 | 20 | -APP_CFLAGS += -fPIC 21 | +ifndef NDK_DEBUG 22 | +APP_CFLAGS := -O3 -ftree-vectorize -ffast-math -funroll-loops 23 | +endif 24 | 25 | ifeq ($(APP_ABI),armeabi-v7a) 26 | - APP_CFLAGS += -march=armv7-a -mfloat-abi=softfp -mtune=cortex-a9 -mfp=vfpv3-d16 -mfpu=vfp 27 | + APP_CFLAGS += -mtune=cortex-a9 28 | 29 | # optionally add NEON to compilation flags. 30 | # to activate, run: "ndk-build USE_NEON=1" 31 | -------------------------------------------------------------------------------- /3rdparty/android/patches/openni/dynamic-linker.patch: -------------------------------------------------------------------------------- 1 | Remove the --dynamic-linker option (which doesn't exist) from build options. 2 | 3 | From: Roman Donchenko 4 | 5 | 6 | --- 7 | .../Samples/SamplesAssistant/jni/Android.mk | 2 +- 8 | Platform/Android/jni/OpenNI.jni/Android.mk | 2 +- 9 | Platform/Android/jni/OpenNI/Android.mk | 2 +- 10 | 3 files changed, 3 insertions(+), 3 deletions(-) 11 | 12 | diff --git a/Platform/Android/Samples/SamplesAssistant/jni/Android.mk b/Platform/Android/Samples/SamplesAssistant/jni/Android.mk 13 | index e4b980d..9515e8d 100644 14 | --- a/Platform/Android/Samples/SamplesAssistant/jni/Android.mk 15 | +++ b/Platform/Android/Samples/SamplesAssistant/jni/Android.mk 16 | @@ -25,7 +25,7 @@ LOCAL_C_INCLUDES := \ 17 | 18 | LOCAL_CFLAGS:= -fvisibility=hidden -DXN_EXPORTS 19 | 20 | -LOCAL_LDFLAGS += -Wl,--export-dynamic --dynamic-linker 21 | +LOCAL_LDFLAGS += -Wl,--export-dynamic 22 | 23 | LOCAL_LDLIBS := -llog 24 | LOCAL_LDLIBS += $(OPENNI_DIR)/Platform/Android/libs/armeabi-v7a/libOpenNI.so 25 | diff --git a/Platform/Android/jni/OpenNI.jni/Android.mk b/Platform/Android/jni/OpenNI.jni/Android.mk 26 | index 30b332c..30ce781 100644 27 | --- a/Platform/Android/jni/OpenNI.jni/Android.mk 28 | +++ b/Platform/Android/jni/OpenNI.jni/Android.mk 29 | @@ -22,7 +22,7 @@ LOCAL_C_INCLUDES := \ 30 | 31 | LOCAL_CFLAGS:= -fvisibility=hidden -DXN_EXPORTS 32 | 33 | -LOCAL_LDFLAGS += -Wl,--export-dynamic --dynamic-linker 34 | +LOCAL_LDFLAGS += -Wl,--export-dynamic 35 | 36 | LOCAL_LDLIBS := -llog 37 | 38 | diff --git a/Platform/Android/jni/OpenNI/Android.mk b/Platform/Android/jni/OpenNI/Android.mk 39 | index 47b0911..355cb74 100644 40 | --- a/Platform/Android/jni/OpenNI/Android.mk 41 | +++ b/Platform/Android/jni/OpenNI/Android.mk 42 | @@ -27,7 +27,7 @@ LOCAL_C_INCLUDES := \ 43 | 44 | LOCAL_CFLAGS:= -fvisibility=hidden -DXN_EXPORTS 45 | 46 | -LOCAL_LDFLAGS += -Wl,--export-dynamic --dynamic-linker 47 | +LOCAL_LDFLAGS += -Wl,--export-dynamic 48 | 49 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../../../Include 50 | LOCAL_SHARED_LIBRARIES := libusb-1.0 51 | -------------------------------------------------------------------------------- /3rdparty/android/patches/openni/paths.patch: -------------------------------------------------------------------------------- 1 | Move configuration files to a more conventional location. 2 | 3 | From: Roman Donchenko 4 | 5 | This patch is originally from , 6 | modified by me. 7 | --- 8 | Platform/Linux/CreateRedist/install.sh | 2 +- 9 | Source/OpenNI/XnOpenNI.cpp | 4 ++-- 10 | 2 files changed, 3 insertions(+), 3 deletions(-) 11 | 12 | diff --git a/Platform/Linux/CreateRedist/install.sh b/Platform/Linux/CreateRedist/install.sh 13 | index cdeff3f..9ac3482 100755 14 | --- a/Platform/Linux/CreateRedist/install.sh 15 | +++ b/Platform/Linux/CreateRedist/install.sh 16 | @@ -74,7 +74,7 @@ fi 17 | INSTALL_LIB=$rootfs/usr/lib 18 | INSTALL_BIN=$rootfs/usr/bin 19 | INSTALL_INC=$rootfs/usr/include/ni 20 | -INSTALL_VAR=$rootfs/var/lib/ni 21 | +INSTALL_VAR=$rootfs/etc/openni 22 | INSTALL_JAR=$rootfs/usr/share/java 23 | 24 | # make all calls into OpenNI run in this filesystem 25 | diff --git a/Source/OpenNI/XnOpenNI.cpp b/Source/OpenNI/XnOpenNI.cpp 26 | index 92063cf..de4d7e7 100644 27 | --- a/Source/OpenNI/XnOpenNI.cpp 28 | +++ b/Source/OpenNI/XnOpenNI.cpp 29 | @@ -6991,9 +6991,9 @@ XN_C_API XnStatus xnScriptNodeRun(XnNodeHandle hScript, XnEnumerationErrors* pEr 30 | #if (XN_PLATFORM == XN_PLATFORM_WIN32) 31 | #define XN_OPEN_NI_FILES_LOCATION "\\Data\\" 32 | #elif (CE4100) 33 | - #define XN_OPEN_NI_FILES_LOCATION "/usr/etc/ni/" 34 | + #define XN_OPEN_NI_FILES_LOCATION "/etc/openni/" 35 | #elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_MACOSX) 36 | - #define XN_OPEN_NI_FILES_LOCATION "/var/lib/ni/" 37 | + #define XN_OPEN_NI_FILES_LOCATION "/etc/openni/" 38 | #elif (XN_PLATFORM == XN_PLATFORM_ANDROID_ARM) 39 | #define XN_OPEN_NI_FILES_LOCATION "/data/ni/" 40 | #else 41 | -------------------------------------------------------------------------------- /3rdparty/android/patches/openni/series: -------------------------------------------------------------------------------- 1 | # This series applies on GIT commit 021e30e843cc5b0f58448e8fd723746bc3fb16ac 2 | paths.patch 3 | format-args.patch 4 | substitute-libusb.patch 5 | dynamic-linker.patch 6 | android-install-path-var.patch 7 | java-bindings-bugs.patch 8 | setschedparam.patch 9 | usb-race-condition.patch 10 | update-android-project.patch 11 | useless-android-files.patch 12 | build-flags.patch 13 | -------------------------------------------------------------------------------- /3rdparty/android/patches/openni/setschedparam.patch: -------------------------------------------------------------------------------- 1 | Fix usage of pthread_setschedparam. 2 | 3 | From: Roman Donchenko 4 | 5 | 6 | --- 7 | Source/OpenNI/Linux/LinuxThreads.cpp | 4 ++-- 8 | 1 file changed, 2 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/Source/OpenNI/Linux/LinuxThreads.cpp b/Source/OpenNI/Linux/LinuxThreads.cpp 11 | index 980236c..8b9b6b2 100644 12 | --- a/Source/OpenNI/Linux/LinuxThreads.cpp 13 | +++ b/Source/OpenNI/Linux/LinuxThreads.cpp 14 | @@ -157,7 +157,7 @@ XN_C_API XnStatus xnOSSetThreadPriority(XN_THREAD_HANDLE ThreadHandle, XnThreadP 15 | memset(¶m, 0, sizeof(param)); 16 | 17 | #ifndef XN_PLATFORM_HAS_NO_SCHED_PARAM 18 | - param.__sched_priority = 5; 19 | + param.sched_priority = 5; 20 | #endif 21 | nPolicy = SCHED_RR; 22 | } 23 | @@ -169,7 +169,7 @@ XN_C_API XnStatus xnOSSetThreadPriority(XN_THREAD_HANDLE ThreadHandle, XnThreadP 24 | rc = pthread_setschedparam(*ThreadHandle, nPolicy, ¶m); 25 | if (rc != 0) 26 | { 27 | - xnLogWarning(XN_MASK_OS, "Failed to set thread priority (%d)", errno); 28 | + xnLogWarning(XN_MASK_OS, "Failed to set thread priority (%d)", rc); 29 | return (XN_STATUS_OS_THREAD_SET_PRIORITY_FAILED); 30 | } 31 | 32 | -------------------------------------------------------------------------------- /3rdparty/android/patches/sensor/build-flags.patch: -------------------------------------------------------------------------------- 1 | Remove build flags that are redundant and disable optimization flags when debugging is enabled. 2 | 3 | From: Roman Donchenko 4 | 5 | 6 | --- 7 | Platform/Android/jni/Application.mk | 7 ++++--- 8 | 1 file changed, 4 insertions(+), 3 deletions(-) 9 | 10 | diff --git a/Platform/Android/jni/Application.mk b/Platform/Android/jni/Application.mk 11 | index 6d2da24..91e2646 100644 12 | --- a/Platform/Android/jni/Application.mk 13 | +++ b/Platform/Android/jni/Application.mk 14 | @@ -5,12 +5,13 @@ APP_PLATFORM := android-9 15 | 16 | # Build ARMv7-A machine code. 17 | APP_ABI := armeabi-v7a 18 | -APP_CFLAGS := -O3 -ftree-vectorize -ffast-math -funroll-loops 19 | 20 | -APP_CFLAGS += -fPIC 21 | +ifndef NDK_DEBUG 22 | +APP_CFLAGS := -O3 -ftree-vectorize -ffast-math -funroll-loops 23 | +endif 24 | 25 | ifeq ($(APP_ABI),armeabi-v7a) 26 | - APP_CFLAGS += -march=armv7-a -mfloat-abi=softfp -mtune=cortex-a9 -mfp=vfpv3-d16 -mfpu=vfp 27 | + APP_CFLAGS += -mtune=cortex-a9 28 | 29 | # optionally add NEON to compilation flags. 30 | # to activate, run: "ndk-build USE_NEON=1" 31 | -------------------------------------------------------------------------------- /3rdparty/android/patches/sensor/file-log-disable.patch: -------------------------------------------------------------------------------- 1 | Disable file logging by default. This patch originally from 2 | 3 | From: Roman Donchenko 4 | 5 | . 6 | --- 7 | Data/GlobalDefaults.ini | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/Data/GlobalDefaults.ini b/Data/GlobalDefaults.ini 11 | index 0f53683..87dbe3b 100644 12 | --- a/Data/GlobalDefaults.ini 13 | +++ b/Data/GlobalDefaults.ini 14 | @@ -6,7 +6,7 @@ LogMasks=ALL 15 | ; 0 - No (default), 1 - Yes 16 | ;LogWriteToConsole=1 17 | ; 0 - No (default), 1 - Yes 18 | -LogWriteToFile=1 19 | +;LogWriteToFile=1 20 | ; 0 - No (default), 1 - Yes 21 | ;LogWriteLineInfo=0 22 | ; leave empty for nothing (default). ALL - all masks 23 | -------------------------------------------------------------------------------- /3rdparty/android/patches/sensor/series: -------------------------------------------------------------------------------- 1 | # This series applies on GIT commit a9ff82b695861dd4a1e766ba8a287c471c076850 2 | dynamic-linker.patch 3 | kinect.patch 4 | file-log-disable.patch 5 | magic-handling.patch 6 | bayer-buffer.patch 7 | rules.patch 8 | build-flags.patch 9 | -------------------------------------------------------------------------------- /3rdparty/android/tbb-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | . ./functions.shinc 6 | 7 | require_standalone_toolchain 8 | 9 | compiler_path=`which arm-linux-androideabi-g++` 10 | sysroot=`dirname $compiler_path`/../sysroot 11 | 12 | (cd src/tbb && make target=android arch=arm SYSROOT=$sysroot) 13 | 14 | rm -rf ndk-mobules/tbb/include/* 15 | rm -rf ndk-modules/tbb/lib/debug/armeabi-v7a/* 16 | rm -rf ndk-modules/tbb/lib/release/armeabi-v7a/* 17 | 18 | cp -a src/tbb/include/tbb ndk-modules/tbb/include 19 | cp src/tbb/build/linux_arm_gcc_android_cc*_NDKunknown_kernelunknown_debug/*.so \ 20 | ndk-modules/tbb/lib/debug/armeabi-v7a 21 | cp src/tbb/build/linux_arm_gcc_android_cc*_NDKunknown_kernelunknown_release/*.so \ 22 | ndk-modules/tbb/lib/release/armeabi-v7a 23 | -------------------------------------------------------------------------------- /3rdparty/android/tbb-fetch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | ver=41_20121003oss 6 | 7 | rm -rf src/tbb 8 | 9 | mkdir src/tbb 10 | cd src/tbb 11 | 12 | wget -vO- \ 13 | "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb${ver}_src.tgz" \ 14 | | tar -xz --strip-components=2 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, Point Cloud Library (PCL) 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | Redistributions in binary form must reproduce the above copyright notice, this 11 | list of conditions and the following disclaimer in the documentation and/or 12 | other materials provided with the distribution. 13 | 14 | Neither the name of the {organization} nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 22 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 25 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | mobile 2 | ====== 3 | 4 | PCL related code for Android/iOS mobile apps 5 | -------------------------------------------------------------------------------- /apps/android/BodyParts/.gitignore: -------------------------------------------------------------------------------- 1 | libs 2 | obj 3 | gen 4 | tools/build 5 | -------------------------------------------------------------------------------- /apps/android/BodyParts/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /apps/android/BodyParts/README.txt: -------------------------------------------------------------------------------- 1 | This is a demo app that uses a random decision forest to recognize human 2 | body parts on a range image. It can either read from prerecorded images or 3 | from a Kinect. 4 | 5 | In the tools directory you will find two programs (build them normally with 6 | CMake): 7 | 8 | * treetxt2bin - converts the random trees from /gpu/people/data/results into 9 | a compact binary format. 10 | * pcd2rgbd - converts a cloud in PCD format into a (slightly more) compact 11 | binary format. 12 | 13 | Before building the demo, you have to convert the trees with treetxt2bin 14 | and put them into either the assets/trees directory here, or the trees 15 | directory on your device's storage. The former option is more convenient for 16 | distribution, the latter for development. 17 | 18 | To view prerecorded images, convert them with pcd2rgbd and put them in the 19 | rgbd directory on your device's storage. 20 | 21 | To build the demo, you will need libusb, OpenNI, Boost and TBB. To build 22 | them, go to /3rdparty/android and run the provided scripts: 23 | 24 | ./{libusb,openni,boost,tbb}-{fetch,build}.sh 25 | 26 | After that, run the following in this directory ( means the full path 27 | to the working copy root): 28 | 29 | export NDK_MODULE_PATH=/3rdparty/android/ndk-modules 30 | ndk-build 31 | android update project -p . -n BodyParts 32 | ant debug 33 | -------------------------------------------------------------------------------- /apps/android/BodyParts/assets/ni/dir.txt: -------------------------------------------------------------------------------- 1 | data/GlobalDefaultsKinect.ini 2 | data/GlobalDefaults.ini 3 | -------------------------------------------------------------------------------- /apps/android/BodyParts/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | export NDK_MODULE_PATH=$(cd ../../../3rdparty/android/ndk-modules; pwd) 4 | ndk-build 5 | android update project -p . -n BodyParts 6 | ant debug 7 | -------------------------------------------------------------------------------- /apps/android/BodyParts/jni/Android.mk: -------------------------------------------------------------------------------- 1 | include $(call all-subdir-makefiles) 2 | 3 | $(call import-module,OpenNI) 4 | $(call import-module,Sensor) 5 | $(call import-module,boost) 6 | $(call import-module,tbb) 7 | -------------------------------------------------------------------------------- /apps/android/BodyParts/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_ABI := armeabi-v7a 2 | APP_STL := gnustl_static 3 | APP_CPPFLAGS := -frtti -fexceptions 4 | APP_MODULES := bodyparts OpenNI XnDeviceSensorV2 5 | APP_PLATFORM := android-12 6 | -------------------------------------------------------------------------------- /apps/android/BodyParts/jni/bodyparts/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE := bodyparts 6 | LOCAL_SRC_FILES := body_parts_recognizer.cpp openni_grabber.cpp org_pointclouds_bodyparts_BodyPartsRecognizer.cpp \ 7 | file_grabber.cpp org_pointclouds_bodyparts_Grabber.cpp stopwatch.cpp \ 8 | org_pointclouds_bodyparts_Cloud.cpp org_pointclouds_bodyparts_Application.cpp cloud.cpp 9 | LOCAL_LDLIBS := -llog 10 | LOCAL_STATIC_LIBRARIES := boost boost_filesystem tbb 11 | LOCAL_SHARED_LIBRARIES := OpenNI 12 | 13 | include $(BUILD_SHARED_LIBRARY) 14 | -------------------------------------------------------------------------------- /apps/android/BodyParts/jni/bodyparts/body_parts_recognizer.h: -------------------------------------------------------------------------------- 1 | #ifndef BODY_PARTS_RECOGNIZER_ 2 | #define BODY_PARTS_RECOGNIZER_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | 10 | #include "cloud.h" 11 | 12 | typedef boost::uint8_t Label; 13 | 14 | struct Labels 15 | { 16 | static const Label Lfoot = 0; 17 | static const Label Lleg = 1; 18 | static const Label Lknee = 2; 19 | static const Label Lthigh = 3; 20 | static const Label Rfoot = 4; 21 | static const Label Rleg = 5; 22 | static const Label Rknee = 6; 23 | static const Label Rthigh = 7; 24 | static const Label Rhips = 8; 25 | static const Label Lhips = 9; 26 | static const Label Neck = 10; 27 | static const Label Rarm = 11; 28 | static const Label Relbow = 12; 29 | static const Label Rforearm = 13; 30 | static const Label Rhand = 14; 31 | static const Label Larm = 15; 32 | static const Label Lelbow = 16; 33 | static const Label Lforearm = 17; 34 | static const Label Lhand = 18; 35 | static const Label FaceLB = 19; 36 | static const Label FaceRB = 20; 37 | static const Label FaceLT = 21; 38 | static const Label FaceRT = 22; 39 | static const Label Rchest = 23; 40 | static const Label Lchest = 24; 41 | static const Label Lshoulder = 25; 42 | static const Label Rshoulder = 26; 43 | static const Label Groundplane = 27; 44 | static const Label Ceiling = 28; 45 | static const Label Background = 29; 46 | static const Label Reserved = 30; 47 | static const Label NOLABEL = 31; 48 | static const unsigned NUM_LABELS = 32; 49 | }; 50 | 51 | DECLARE_CLOUD_TAG(TagBPLabel, Label) 52 | 53 | struct DecisionTreeCPU; 54 | 55 | struct BodyPartsRecognizer 56 | { 57 | private: 58 | typedef DecisionTreeCPU Tree; 59 | std::vector > trees; 60 | 61 | public: 62 | BodyPartsRecognizer(std::size_t num_trees, const char * trees[]); 63 | void recognize(Cloud & cloud) const; 64 | }; 65 | 66 | #endif // BODY_PARTS_RECOGNIZER_ 67 | -------------------------------------------------------------------------------- /apps/android/BodyParts/jni/bodyparts/cloud.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | #include "cloud.h" 6 | 7 | namespace bc = boost::container; 8 | 9 | template 10 | ChannelRef::ChannelRef(int width, int height, Format * data) 11 | : width(width), height(height), size(width * height), data(data) 12 | { } 13 | 14 | typedef boost::container::flat_map::iterator storage_iterator; 15 | 16 | void 17 | Cloud::resize(int width, int height) 18 | { 19 | if (width == width_ && height == height_) return; 20 | 21 | for (storage_iterator it = storage_.begin(); it != storage_.end(); ++it) 22 | operator delete[](it->second); 23 | 24 | storage_.clear(); 25 | width_ = width; 26 | height_ = height; 27 | } 28 | 29 | template ChannelRef 30 | Cloud::get(const std::type_info * key) 31 | { 32 | return ChannelRef(width_, height_, getRaw(key)); 33 | } 34 | 35 | template Format * 36 | Cloud::getRaw(const std::type_info * key) 37 | { 38 | storage_iterator pos = storage_.lower_bound(key); 39 | if (pos != storage_.end() && pos->first == key) return static_cast(pos->second); 40 | 41 | Format * new_data = static_cast(operator new[](width_ * height_ * sizeof(Format))); 42 | storage_.insert(pos, std::make_pair(key, new_data)); 43 | 44 | return new_data; 45 | } 46 | 47 | Cloud::~Cloud() 48 | { 49 | resize(0, 0); 50 | } 51 | 52 | #define DEFINE_FORMAT(Format) \ 53 | template ChannelRef Cloud::get(const std::type_info * key); \ 54 | template Format * Cloud::getRaw(const std::type_info * key); 55 | 56 | DEFINE_FORMAT(bool) 57 | 58 | DEFINE_FORMAT(unsigned char) 59 | DEFINE_FORMAT(signed char) 60 | DEFINE_FORMAT(unsigned short) 61 | DEFINE_FORMAT(signed short) 62 | DEFINE_FORMAT(unsigned int) 63 | DEFINE_FORMAT(signed int) 64 | 65 | DEFINE_FORMAT(RGB) 66 | -------------------------------------------------------------------------------- /apps/android/BodyParts/jni/bodyparts/cloud.h: -------------------------------------------------------------------------------- 1 | #ifndef CLOUD_H_ 2 | #define CLOUD_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | template 12 | struct ChannelRef 13 | { 14 | const int width; 15 | const int height; 16 | const int size; 17 | 18 | Format * const data; 19 | 20 | const Format & at(int row, int column) const { return data[row * width + column]; } 21 | Format & at(int row, int column) { return data[row * width + column]; } 22 | 23 | Format atDef(int row, int column, Format def) const { 24 | if (row < 0 || row >= height || column < 0 || column >= width) return def; 25 | return at(row, column); 26 | } 27 | 28 | ChannelRef(int width, int height, Format * data); 29 | }; 30 | 31 | struct TypeInfoComparator 32 | { 33 | bool operator () (const std::type_info * t1, const std::type_info * t2) const { return (*t1).before(*t2); } 34 | }; 35 | 36 | struct Cloud : boost::noncopyable 37 | { 38 | template ChannelRef 39 | get() 40 | { 41 | return get(&typeid(Tag)); 42 | } 43 | 44 | void 45 | resize(int width, int height); 46 | 47 | int 48 | getWidth() const { return width_; } 49 | 50 | int 51 | getHeight() const { return height_; } 52 | 53 | ~Cloud(); 54 | 55 | private: 56 | int width_, height_; 57 | boost::container::flat_map storage_; 58 | 59 | template ChannelRef 60 | get(const std::type_info * key); 61 | 62 | template Format * 63 | getRaw(const std::type_info * key); 64 | }; 65 | 66 | #define DECLARE_CLOUD_TAG(tag, format) struct tag { typedef format format_type; }; 67 | 68 | struct RGB 69 | { 70 | boost::uint8_t r, g, b, dummy; 71 | }; 72 | 73 | typedef boost::int16_t Depth; 74 | 75 | DECLARE_CLOUD_TAG(TagColor, RGB) 76 | DECLARE_CLOUD_TAG(TagDepth, Depth) 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /apps/android/BodyParts/jni/bodyparts/file_grabber.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "grabber.h" 6 | 7 | namespace fs = boost::filesystem; 8 | 9 | class FileGrabber : public Grabber 10 | { 11 | std::vector file_list; 12 | std::size_t current_file; 13 | 14 | public: 15 | explicit FileGrabber(const std::string & directory); 16 | 17 | virtual bool isConnected() const { return !file_list.empty(); } 18 | 19 | virtual void getFrame(Cloud & frame); 20 | 21 | virtual void start() {} 22 | virtual void stop() {} 23 | }; 24 | 25 | FileGrabber::FileGrabber(const std::string & directory) 26 | : current_file(0) 27 | { 28 | __android_log_write(ANDROID_LOG_DEBUG, "FileGrabber", "Iteratin'"); 29 | for (fs::directory_iterator iter = fs::directory_iterator(directory); 30 | iter != fs::directory_iterator(); ++iter) 31 | { 32 | if (iter->status().type() != fs::regular_file) 33 | continue; 34 | file_list.push_back(iter->path()); 35 | } 36 | } 37 | 38 | void FileGrabber::getFrame(Cloud & frame) 39 | { 40 | fs::ifstream is(file_list[current_file], std::ios::binary); 41 | 42 | boost::uint32_t width, height; 43 | is.read(reinterpret_cast(&width), sizeof width); 44 | is.read(reinterpret_cast(&height), sizeof height); 45 | 46 | frame.resize(width, height); 47 | 48 | ChannelRef rgb = frame.get(); 49 | ChannelRef depth = frame.get(); 50 | 51 | is.read(reinterpret_cast(rgb.data), width * height * sizeof *rgb.data); 52 | is.read(reinterpret_cast(depth.data), width * height * sizeof *depth.data); 53 | 54 | ++current_file; 55 | if (current_file >= file_list.size()) 56 | current_file = 0; 57 | } 58 | 59 | Grabber * Grabber::createFileGrabber(const std::string & directory) 60 | { 61 | return new FileGrabber(directory); 62 | } 63 | -------------------------------------------------------------------------------- /apps/android/BodyParts/jni/bodyparts/grabber.h: -------------------------------------------------------------------------------- 1 | #ifndef GRABBER_H_ 2 | #define GRABBER_H_ 3 | 4 | #include 5 | 6 | #include "cloud.h" 7 | 8 | struct Grabber 9 | { 10 | static Grabber * createOpenNIGrabber(); 11 | static Grabber * createFileGrabber(const std::string & directory); 12 | 13 | virtual ~Grabber() {} 14 | 15 | virtual bool isConnected() const = 0; 16 | 17 | virtual void getFrame(Cloud & frame) = 0; 18 | 19 | virtual void start() = 0; 20 | virtual void stop() = 0; 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /apps/android/BodyParts/jni/bodyparts/jni_helper.hpp: -------------------------------------------------------------------------------- 1 | #ifndef JNI_HELPER_ 2 | #define JNI_HELPER_ 3 | 4 | #include 5 | 6 | template 7 | struct JNIHelper 8 | { 9 | static jfieldID fld_ptr; 10 | }; 11 | 12 | template 13 | jfieldID JNIHelper::fld_ptr; 14 | 15 | template T * 16 | getPtr(JNIEnv * env, jobject object) 17 | { 18 | return reinterpret_cast (env->GetLongField (object, JNIHelper::fld_ptr)); 19 | } 20 | 21 | template void 22 | setPtr(JNIEnv * env, jobject object, T * ptr) 23 | { 24 | env->SetLongField (object, JNIHelper::fld_ptr, reinterpret_cast(ptr)); 25 | } 26 | 27 | template void 28 | cachePtrID(JNIEnv * env, jclass clazz) 29 | { 30 | JNIHelper::fld_ptr = env->GetFieldID (clazz, "ptr", "J"); 31 | } 32 | 33 | template void 34 | freePtr(JNIEnv * env, jobject object) 35 | { 36 | T * ptr = getPtr (env, object); 37 | if (!ptr) return; 38 | 39 | delete ptr; 40 | 41 | setPtr (env, object, 0); 42 | } 43 | 44 | #endif // JNI_HELPER_ 45 | -------------------------------------------------------------------------------- /apps/android/BodyParts/jni/bodyparts/org_pointclouds_bodyparts_Application.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "org_pointclouds_bodyparts_Application.h" 4 | 5 | JNIEXPORT void JNICALL 6 | Java_org_pointclouds_bodyparts_Application_setenv 7 | (JNIEnv * env, jclass, jstring name, jstring value) 8 | { 9 | const char * name_chars = env->GetStringUTFChars(name, NULL); 10 | const char * value_chars = env->GetStringUTFChars(value, NULL); 11 | 12 | setenv(name_chars, value_chars, 1); 13 | 14 | env->ReleaseStringUTFChars(value, value_chars); 15 | env->ReleaseStringUTFChars(name, name_chars); 16 | } 17 | 18 | -------------------------------------------------------------------------------- /apps/android/BodyParts/jni/bodyparts/org_pointclouds_bodyparts_Application.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class org_pointclouds_bodyparts_Application */ 4 | 5 | #ifndef _Included_org_pointclouds_bodyparts_Application 6 | #define _Included_org_pointclouds_bodyparts_Application 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: org_pointclouds_bodyparts_Application 12 | * Method: setenv 13 | * Signature: (Ljava/lang/String;Ljava/lang/String;)V 14 | */ 15 | JNIEXPORT void JNICALL Java_org_pointclouds_bodyparts_Application_setenv 16 | (JNIEnv *, jclass, jstring, jstring); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /apps/android/BodyParts/jni/bodyparts/org_pointclouds_bodyparts_BodyPartsRecognizer.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class org_pointclouds_bodyparts_BodyPartsRecognizer */ 4 | 5 | #ifndef _Included_org_pointclouds_bodyparts_BodyPartsRecognizer 6 | #define _Included_org_pointclouds_bodyparts_BodyPartsRecognizer 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: org_pointclouds_bodyparts_BodyPartsRecognizer 12 | * Method: cacheIds 13 | * Signature: ()V 14 | */ 15 | JNIEXPORT void JNICALL Java_org_pointclouds_bodyparts_BodyPartsRecognizer_cacheIds 16 | (JNIEnv *, jclass); 17 | 18 | /* 19 | * Class: org_pointclouds_bodyparts_BodyPartsRecognizer 20 | * Method: create 21 | * Signature: ([[B)V 22 | */ 23 | JNIEXPORT void JNICALL Java_org_pointclouds_bodyparts_BodyPartsRecognizer_create 24 | (JNIEnv *, jobject, jobjectArray); 25 | 26 | /* 27 | * Class: org_pointclouds_bodyparts_BodyPartsRecognizer 28 | * Method: free 29 | * Signature: ()V 30 | */ 31 | JNIEXPORT void JNICALL Java_org_pointclouds_bodyparts_BodyPartsRecognizer_free 32 | (JNIEnv *, jobject); 33 | 34 | /* 35 | * Class: org_pointclouds_bodyparts_BodyPartsRecognizer 36 | * Method: recognize 37 | * Signature: (Lorg/pointclouds/bodyparts/Cloud;)[B 38 | */ 39 | JNIEXPORT jbyteArray JNICALL Java_org_pointclouds_bodyparts_BodyPartsRecognizer_recognize 40 | (JNIEnv *, jobject, jobject); 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | #endif 46 | -------------------------------------------------------------------------------- /apps/android/BodyParts/jni/bodyparts/org_pointclouds_bodyparts_Cloud.cpp: -------------------------------------------------------------------------------- 1 | #include "org_pointclouds_bodyparts_Cloud.h" 2 | #include "jni_helper.hpp" 3 | #include "cloud.h" 4 | 5 | namespace 6 | { 7 | jmethodID meth_ctor; 8 | } 9 | 10 | JNIEXPORT void JNICALL 11 | Java_org_pointclouds_bodyparts_Cloud_cacheIds 12 | (JNIEnv * env, jclass clazz) 13 | { 14 | cachePtrID (env, clazz); 15 | meth_ctor = env->GetMethodID (clazz, "", "(J)V"); 16 | } 17 | 18 | JNIEXPORT void JNICALL 19 | Java_org_pointclouds_bodyparts_Cloud_create 20 | (JNIEnv * env, jobject object) 21 | { 22 | Cloud * ptr = new Cloud; 23 | 24 | setPtr (env, object, ptr); 25 | } 26 | 27 | JNIEXPORT void JNICALL 28 | Java_org_pointclouds_bodyparts_Cloud_free 29 | (JNIEnv * env, jobject object) 30 | { 31 | freePtr (env, object); 32 | } 33 | 34 | JNIEXPORT void JNICALL 35 | Java_org_pointclouds_bodyparts_Cloud_readColors 36 | (JNIEnv * env, jobject object, jintArray colors) 37 | { 38 | Cloud * ptr = getPtr (env, object); 39 | ChannelRef rgb = ptr->get(); 40 | 41 | jint * colors_elements = env->GetIntArrayElements (colors, NULL); 42 | 43 | for (int i = 0; i < rgb.size; ++i) 44 | colors_elements[i] = (0xFF << 24) | (rgb.data[i].r << 16) | (rgb.data[i].g << 8) | (rgb.data[i].b << 0); 45 | 46 | env->ReleaseIntArrayElements (colors, colors_elements, 0); 47 | } 48 | 49 | JNIEXPORT jint JNICALL 50 | Java_org_pointclouds_bodyparts_Cloud_getHeight 51 | (JNIEnv * env, jobject object) 52 | { 53 | Cloud * ptr = getPtr (env, object); 54 | return ptr->getHeight(); 55 | } 56 | 57 | JNIEXPORT jint JNICALL 58 | Java_org_pointclouds_bodyparts_Cloud_getWidth 59 | (JNIEnv * env, jobject object) 60 | { 61 | Cloud * ptr = getPtr (env, object); 62 | return ptr->getWidth(); 63 | } 64 | -------------------------------------------------------------------------------- /apps/android/BodyParts/jni/bodyparts/org_pointclouds_bodyparts_Cloud.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class org_pointclouds_bodyparts_Cloud */ 4 | 5 | #ifndef _Included_org_pointclouds_bodyparts_Cloud 6 | #define _Included_org_pointclouds_bodyparts_Cloud 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: org_pointclouds_bodyparts_Cloud 12 | * Method: cacheIds 13 | * Signature: ()V 14 | */ 15 | JNIEXPORT void JNICALL Java_org_pointclouds_bodyparts_Cloud_cacheIds 16 | (JNIEnv *, jclass); 17 | 18 | /* 19 | * Class: org_pointclouds_bodyparts_Cloud 20 | * Method: create 21 | * Signature: ()V 22 | */ 23 | JNIEXPORT void JNICALL Java_org_pointclouds_bodyparts_Cloud_create 24 | (JNIEnv *, jobject); 25 | 26 | /* 27 | * Class: org_pointclouds_bodyparts_Cloud 28 | * Method: free 29 | * Signature: ()V 30 | */ 31 | JNIEXPORT void JNICALL Java_org_pointclouds_bodyparts_Cloud_free 32 | (JNIEnv *, jobject); 33 | 34 | /* 35 | * Class: org_pointclouds_bodyparts_Cloud 36 | * Method: readColors 37 | * Signature: ([I)V 38 | */ 39 | JNIEXPORT void JNICALL Java_org_pointclouds_bodyparts_Cloud_readColors 40 | (JNIEnv *, jobject, jintArray); 41 | 42 | /* 43 | * Class: org_pointclouds_bodyparts_Cloud 44 | * Method: getHeight 45 | * Signature: ()I 46 | */ 47 | JNIEXPORT jint JNICALL Java_org_pointclouds_bodyparts_Cloud_getHeight 48 | (JNIEnv *, jobject); 49 | 50 | /* 51 | * Class: org_pointclouds_bodyparts_Cloud 52 | * Method: getWidth 53 | * Signature: ()I 54 | */ 55 | JNIEXPORT jint JNICALL Java_org_pointclouds_bodyparts_Cloud_getWidth 56 | (JNIEnv *, jobject); 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | #endif 62 | -------------------------------------------------------------------------------- /apps/android/BodyParts/jni/bodyparts/stopwatch.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "stopwatch.h" 4 | 5 | long long Stopwatch::getTime() 6 | { 7 | timespec ts; 8 | clock_gettime (CLOCK_MONOTONIC, &ts); 9 | return ts.tv_sec * 1000000000LL + ts.tv_nsec; 10 | } 11 | 12 | Stopwatch::Stopwatch() 13 | { 14 | start_time = getTime (); 15 | } 16 | 17 | int Stopwatch::elapsedMs() 18 | { 19 | return (getTime () - start_time) / 1000000; 20 | } 21 | -------------------------------------------------------------------------------- /apps/android/BodyParts/jni/bodyparts/stopwatch.h: -------------------------------------------------------------------------------- 1 | #ifndef STOPWATCH_H_ 2 | #define STOPWATCH_H_ 3 | 4 | class Stopwatch 5 | { 6 | private: 7 | long long start_time; 8 | static long long getTime(); 9 | 10 | public: 11 | Stopwatch(); 12 | int elapsedMs(); 13 | }; 14 | 15 | #endif // STOPWATCH_H_ 16 | -------------------------------------------------------------------------------- /apps/android/BodyParts/project.properties: -------------------------------------------------------------------------------- 1 | target=android-14 2 | android.library.reference.1=../../../3rdparty/android/src/libusb/android/LibusbSupport 3 | -------------------------------------------------------------------------------- /apps/android/BodyParts/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PointCloudLibrary/mobile/ce2f5c48907e019961eda43db480f6295e421315/apps/android/BodyParts/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /apps/android/BodyParts/res/drawable-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PointCloudLibrary/mobile/ce2f5c48907e019961eda43db480f6295e421315/apps/android/BodyParts/res/drawable-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /apps/android/BodyParts/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PointCloudLibrary/mobile/ce2f5c48907e019961eda43db480f6295e421315/apps/android/BodyParts/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /apps/android/BodyParts/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PointCloudLibrary/mobile/ce2f5c48907e019961eda43db480f6295e421315/apps/android/BodyParts/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /apps/android/BodyParts/res/layout/color_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /apps/android/BodyParts/res/menu/main_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /apps/android/BodyParts/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Body Parts 4 | Open folder 5 | Open device 6 | Close 7 | Couldn\'t find a directory with RGBD files. 8 | Failed to open the data source. 9 | Lost the data source. 10 | No usable devices found. 11 | USB device permission denied. 12 | Idle. 13 | Opening… 14 | Open. 15 | Closing… 16 | Requesting permission… 17 | Frame 18 | Loop 19 | %1$s ms 20 | 21 | -------------------------------------------------------------------------------- /apps/android/BodyParts/src/org/pointclouds/bodyparts/BodyPartLabel.java: -------------------------------------------------------------------------------- 1 | package org.pointclouds.bodyparts; 2 | 3 | import android.graphics.Color; 4 | 5 | public enum BodyPartLabel { 6 | LFOOT(Color.rgb(50, 34, 22)), 7 | LLEG(Color.rgb(24, 247, 196)), 8 | LKNEE(Color.rgb(33, 207, 189)), 9 | LTHIGH(Color.rgb(254, 194, 127)), 10 | RFOOT(Color.rgb(88, 115, 175)), 11 | RLEG(Color.rgb(158, 91, 64)), 12 | RKNEE(Color.rgb(14, 90, 2)), 13 | RTHIGH(Color.rgb(100, 156, 227)), 14 | RHIPS(Color.rgb(243, 167, 17)), 15 | LHIPS(Color.rgb(145, 194, 184)), 16 | NECK(Color.rgb(234, 171, 147)), 17 | RARM(Color.rgb(220, 112, 93)), 18 | RELBOW(Color.rgb(93, 132, 163)), 19 | RFOREARM(Color.rgb(122, 4, 85)), 20 | RHAND(Color.rgb(75, 168, 46)), 21 | LARM(Color.rgb(15, 5, 108)), 22 | LELBOW(Color.rgb(180, 125, 107)), 23 | LFOREARM(Color.rgb(157, 77, 167)), 24 | LHAND(Color.rgb(214, 89, 73)), 25 | FACELB(Color.rgb(52, 183, 58)), 26 | FACERB(Color.rgb(54, 155, 75)), 27 | FACELT(Color.rgb(249, 61, 187)), 28 | FACERT(Color.rgb(143, 57, 11)), 29 | RCHEST(Color.rgb(246, 198, 0)), 30 | LCHEST(Color.rgb(202, 177, 251)), 31 | LSHOULDER(Color.rgb(229, 115, 80)), 32 | RSHOULDER(Color.rgb(159, 185, 1)), 33 | GROUND_PLANE(Color.rgb(186, 213, 229)), 34 | CEILING(Color.rgb(82, 47, 144)), 35 | BACKGROUND(Color.argb(0, 140, 69, 139)), 36 | RESERVED(Color.rgb(189, 115, 117)), 37 | NO_LABEL(Color.rgb(80, 57, 150)); 38 | 39 | public final int color; 40 | 41 | BodyPartLabel(int color) { 42 | this.color = color; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /apps/android/BodyParts/src/org/pointclouds/bodyparts/BodyPartsRecognizer.java: -------------------------------------------------------------------------------- 1 | package org.pointclouds.bodyparts; 2 | 3 | public class BodyPartsRecognizer { 4 | @SuppressWarnings("UnusedDeclaration") 5 | private long ptr; 6 | 7 | private static native void cacheIds(); 8 | 9 | private native void create(byte[][] trees); 10 | 11 | @Override 12 | protected void finalize() throws Throwable { 13 | free(); 14 | super.finalize(); 15 | } 16 | 17 | public native void free(); 18 | 19 | static { 20 | System.loadLibrary("bodyparts"); 21 | cacheIds(); 22 | } 23 | 24 | public BodyPartsRecognizer(byte[][] trees) { 25 | create(trees); 26 | } 27 | 28 | public native byte[] recognize(Cloud image); 29 | } 30 | -------------------------------------------------------------------------------- /apps/android/BodyParts/src/org/pointclouds/bodyparts/Cloud.java: -------------------------------------------------------------------------------- 1 | package org.pointclouds.bodyparts; 2 | 3 | public class Cloud { 4 | private long ptr; 5 | 6 | private static native void cacheIds(); 7 | 8 | @Override 9 | protected void finalize() throws Throwable { 10 | free(); 11 | super.finalize(); 12 | } 13 | 14 | @SuppressWarnings("UnusedDeclaration") 15 | private Cloud(long ptr) 16 | { 17 | this.ptr = ptr; 18 | } 19 | 20 | private native void create(); 21 | public native void free(); 22 | 23 | public native void readColors(int[] colors); 24 | 25 | public native int getHeight(); 26 | 27 | public native int getWidth(); 28 | 29 | static { 30 | System.loadLibrary("bodyparts"); 31 | cacheIds(); 32 | } 33 | 34 | public Cloud() 35 | { 36 | create(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /apps/android/BodyParts/src/org/pointclouds/bodyparts/Grabber.java: -------------------------------------------------------------------------------- 1 | package org.pointclouds.bodyparts; 2 | 3 | public class Grabber { 4 | @SuppressWarnings("UnusedDeclaration") 5 | private long ptr; 6 | 7 | private static native void cacheIds(); 8 | 9 | @Override 10 | protected void finalize() throws Throwable { 11 | free(); 12 | super.finalize(); 13 | } 14 | 15 | static { 16 | System.loadLibrary("bodyparts"); 17 | cacheIds(); 18 | } 19 | 20 | private Grabber() {} 21 | 22 | public native void free(); 23 | 24 | public static native Grabber createOpenNIGrabber(); 25 | public static native Grabber createFileGrabber(String directory); 26 | 27 | public native boolean isConnected(); 28 | 29 | public native void getFrame(Cloud frame); 30 | 31 | public native void start(); 32 | public native void stop(); 33 | } 34 | -------------------------------------------------------------------------------- /apps/android/BodyParts/src/org/pointclouds/bodyparts/ProxyFeedback.java: -------------------------------------------------------------------------------- 1 | package org.pointclouds.bodyparts; 2 | 3 | import android.app.Activity; 4 | import android.graphics.Bitmap; 5 | 6 | class ProxyFeedback implements MainLoop.Feedback { 7 | Activity activity; 8 | MainLoop.Feedback underlying; 9 | 10 | ProxyFeedback(Activity activity, MainLoop.Feedback underlying) { 11 | this.activity = activity; 12 | this.underlying = underlying; 13 | } 14 | 15 | public void replaceUnderlying(MainLoop.Feedback newUnderlying) { 16 | underlying = newUnderlying; 17 | } 18 | 19 | @Override 20 | public void initFinished(final boolean success) { 21 | activity.runOnUiThread(new Runnable() { 22 | @Override 23 | public void run() { 24 | underlying.initFinished(success); 25 | } 26 | }); 27 | } 28 | 29 | @Override 30 | public void closeFinished() { 31 | activity.runOnUiThread(new Runnable() { 32 | @Override 33 | public void run() { 34 | underlying.closeFinished(); 35 | } 36 | }); 37 | } 38 | 39 | @Override 40 | public void grabberBroken() { 41 | activity.runOnUiThread(new Runnable() { 42 | @Override 43 | public void run() { 44 | underlying.grabberBroken(); 45 | } 46 | }); 47 | } 48 | 49 | @Override 50 | public void newFrame(final long timeMs, final Bitmap frame) { 51 | activity.runOnUiThread(new Runnable() { 52 | @Override 53 | public void run() { 54 | underlying.newFrame(timeMs, frame); 55 | } 56 | }); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /apps/android/BodyParts/tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | project(AndroidPeopleTools) 3 | 4 | add_executable(treetxt2bin treetxt2bin.cpp) 5 | add_executable(pcd2rgbd pcd2rgbd.cpp) 6 | 7 | find_package(Boost REQUIRED) 8 | include_directories(${Boost_INCLUDE_DIRS}) 9 | 10 | find_package(PCL REQUIRED COMPONENTS io) 11 | include_directories(${PCL_INCLUDE_DIRS}) 12 | target_link_libraries(pcd2rgbd ${PCL_IO_LIBRARIES}) 13 | -------------------------------------------------------------------------------- /apps/android/BodyParts/tools/pcd2rgbd.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | struct RGBDHeader 10 | { 11 | boost::uint32_t width; 12 | boost::uint32_t height; 13 | }; 14 | 15 | struct RGB 16 | { 17 | boost::uint8_t r, g, b; 18 | boost::uint8_t dummy; // ensure alignment 19 | }; 20 | 21 | int 22 | main(int argc, char * argv[]) 23 | { 24 | if (argc != 3) 25 | { 26 | std::cerr << "Usage " << argv[0] << " cloud.pcd image.rgbd\n"; 27 | return (EXIT_FAILURE); 28 | } 29 | 30 | pcl::PointCloud::Ptr cloud (new pcl::PointCloud); 31 | 32 | if (pcl::io::loadPCDFile (argv[1], *cloud) == -1) 33 | { 34 | std::cerr << "Failed to open " << argv[1] << ".\n"; 35 | return (EXIT_FAILURE); 36 | } 37 | 38 | if (!cloud->isOrganized ()) 39 | { 40 | std::cerr << "Expected an organized cloud.\n"; 41 | return (EXIT_FAILURE); 42 | } 43 | 44 | std::ofstream rgbd_file (argv[2], std::ios::out | std::ios::binary); 45 | 46 | if (!rgbd_file) 47 | { 48 | std::cerr << "Couldn't open " << argv[2] << ".\n"; 49 | return (EXIT_FAILURE); 50 | } 51 | 52 | RGBDHeader header = { cloud->width, cloud->height }; 53 | rgbd_file.write (reinterpret_cast (&header), sizeof header); 54 | 55 | for (unsigned i = 0; i < cloud->size(); ++i) 56 | { 57 | RGB pixel = { 58 | cloud->at(i).r, cloud->at(i).g, cloud->at(i).b, 0, 59 | }; 60 | rgbd_file.write(reinterpret_cast (&pixel), sizeof pixel); 61 | } 62 | 63 | for (unsigned i = 0; i < cloud->size(); ++i) 64 | { 65 | boost::int16_t pixel(cloud->at(i).z * 1000); 66 | rgbd_file.write(reinterpret_cast (&pixel), sizeof pixel); 67 | } 68 | 69 | if (!rgbd_file) 70 | { 71 | std::cerr << "Write error.\n"; 72 | return (EXIT_FAILURE); 73 | } 74 | 75 | return (EXIT_SUCCESS); 76 | } 77 | -------------------------------------------------------------------------------- /apps/android/KiwiPCL/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | project(HelloPCLWorld) 4 | 5 | #notice the "recycling" of CMAKE_C_FLAGS 6 | #this is necessary to pick up android flags 7 | set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic" ) 8 | 9 | find_package(Boost 1.45.0 REQUIRED COMPONENTS date_time system filesystem thread iostreams) 10 | find_package(PCL REQUIRED COMPONENTS common io octree kdtree features search) 11 | find_package(VTK REQUIRED) 12 | 13 | include(${VTK_USE_FILE}) 14 | include_directories(${Boost_INCLUDE_DIRS}) 15 | 16 | list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}) 17 | message (STATUS ${CMAKE_MODULE_PATH}) 18 | find_package(VES REQUIRED) 19 | find_package(Flann REQUIRED) 20 | 21 | include_directories(${VES_INCLUDE_DIRS}) 22 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/jni) 23 | 24 | message(STATUS VES libraries: ${VES_LIBRARIES}) 25 | set(deps GLESv2 EGL android log ${VES_LIBRARIES} ) 26 | 27 | include_directories( ${PCL_INCLUDE_DIRS} ) 28 | 29 | set(the_target KiwiNative) 30 | 31 | add_library(${the_target} SHARED jni/KiwiNative.cpp jni/myFunctions.cpp jni/profiler.cpp jni/pcl_demo.cpp) 32 | 33 | message(STATUS ${PCL_LIBRARIES}) 34 | 35 | target_link_libraries(${the_target} ${BOOST_LIBRARIES} 36 | ${BOOST_FILESYSTEM_LIBRARY} log ${FLANN_LIBRARIES} ${PCL_LIBRARIES} ${deps}) 37 | 38 | 39 | -------------------------------------------------------------------------------- /apps/android/KiwiPCL/FindFlann.cmake: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Find Flann 3 | # 4 | # This sets the following variables: 5 | # FLANN_FOUND - True if FLANN was found. 6 | # FLANN_INCLUDE_DIRS - Directories containing the FLANN include files. 7 | # FLANN_LIBRARIES - Libraries needed to use FLANN. 8 | # FLANN_DEFINITIONS - Compiler flags for FLANN. 9 | 10 | find_package(PkgConfig) 11 | pkg_check_modules(PC_FLANN flann) 12 | set(FLANN_DEFINITIONS ${PC_FLANN_CFLAGS_OTHER}) 13 | 14 | find_path(FLANN_INCLUDE_DIR flann/flann.hpp 15 | HINTS ${PC_FLANN_INCLUDEDIR} ${PC_FLANN_INCLUDE_DIRS}) 16 | 17 | find_library(FLANN_LIBRARY flann 18 | HINTS ${PC_FLANN_LIBDIR} ${PC_FLANN_LIBRARY_DIRS}) 19 | 20 | set(FLANN_INCLUDE_DIRS ${FLANN_INCLUDE_DIR}) 21 | set(FLANN_LIBRARIES ${FLANN_LIBRARY}) 22 | 23 | include(FindPackageHandleStandardArgs) 24 | find_package_handle_standard_args(Flann DEFAULT_MSG 25 | FLANN_LIBRARY FLANN_INCLUDE_DIR) 26 | 27 | mark_as_advanced(FLANN_LIBRARY FLANN_INCLUDE_DIR) 28 | 29 | -------------------------------------------------------------------------------- /apps/android/KiwiPCL/README: -------------------------------------------------------------------------------- 1 | INSTRUCTIONS: 2 | 3 | This instruction assumes that you have: 4 | 0) installed Android SDK, Android NDK. 5 | 1) compiled VES (including VTK, KiwiViewer) for Android (http://vtk.org/Wiki/VES/Developers_Guide) 6 | 2) compiled Point Cloud Library for Android in conjunction with VTK, VES, and Kiwi (http://vtk.org/Wiki/VES/Point_Cloud_Library) 7 | 8 | Steps 9 | 1st - patch VES Library, rebuild VES library. 10 | 11 | cd PATH_TO_VES_DIR 12 | git apply vesKiwi.patch 13 | 14 | Change dependencies in the next files: 15 | build/my.sh 16 | Replace all “/home/andrey/...” to your own path to libraries. 17 | 18 | 19 | Next, from this directory execute the following commands: 20 | 21 | # configure ant: 22 | ./configure_ant.sh 23 | # configure cmake: 24 | build/my.sh 25 | 26 | # build native: 27 | cd build 28 | make 29 | #build java: 30 | ant debug 31 | 32 | # run on a device 33 | ant debug install 34 | -------------------------------------------------------------------------------- /apps/android/KiwiPCL/assets/inputCloud0.pcd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PointCloudLibrary/mobile/ce2f5c48907e019961eda43db480f6295e421315/apps/android/KiwiPCL/assets/inputCloud0.pcd -------------------------------------------------------------------------------- /apps/android/KiwiPCL/assets/inputCloud1.pcd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PointCloudLibrary/mobile/ce2f5c48907e019961eda43db480f6295e421315/apps/android/KiwiPCL/assets/inputCloud1.pcd -------------------------------------------------------------------------------- /apps/android/KiwiPCL/assets/kiwi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PointCloudLibrary/mobile/ce2f5c48907e019961eda43db480f6295e421315/apps/android/KiwiPCL/assets/kiwi.png -------------------------------------------------------------------------------- /apps/android/KiwiPCL/assets/vesShader_frag.glsl: -------------------------------------------------------------------------------- 1 | /*======================================================================== 2 | VES --- VTK OpenGL ES Rendering Toolkit 3 | 4 | http://www.kitware.com/ves 5 | 6 | Copyright 2011 Kitware, Inc. 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | ========================================================================*/ 20 | /// \file vesShader_frag.glsl 21 | /// 22 | /// \ingroup shaders 23 | 24 | varying lowp vec4 varColor; 25 | 26 | void main() 27 | { 28 | gl_FragColor = varColor; 29 | } 30 | -------------------------------------------------------------------------------- /apps/android/KiwiPCL/compile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source tools.sh 4 | 5 | cd $build_dir 6 | make || exit 7 | 8 | cd $app_dir 9 | $ANT -buildfile $app_dir/build.xml -Dbuilddir=$build_dir debug || exit 10 | -------------------------------------------------------------------------------- /apps/android/KiwiPCL/configure_ant.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source tools.sh 4 | 5 | $ANDROID update project --name KiwiViewer --path $app_dir --target android-16 6 | -------------------------------------------------------------------------------- /apps/android/KiwiPCL/jni/Android.mk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PointCloudLibrary/mobile/ce2f5c48907e019961eda43db480f6295e421315/apps/android/KiwiPCL/jni/Android.mk -------------------------------------------------------------------------------- /apps/android/KiwiPCL/jni/myFunctions.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | #include 11 | 12 | 13 | 14 | //convenient typedefs 15 | 16 | typedef pcl::PointXYZ PointT; 17 | typedef pcl::PointCloud PointCloud; 18 | typedef pcl::PointNormal PointNormalT; 19 | typedef pcl::PointCloud PointCloudWithNormals; 20 | 21 | 22 | timespec diff(timespec, timespec); 23 | class MyReg 24 | { 25 | public: 26 | int width_orig; 27 | int height_orig; 28 | int width_ds; 29 | int height_ds; 30 | timespec time1, time2; 31 | 32 | MyReg(); 33 | ~MyReg() {}; 34 | 35 | void OldDownSampling (const PointCloud::Ptr cloud_src, const PointCloud::Ptr cloud_tgt, PointCloud::Ptr src, PointCloud::Ptr tgt ); 36 | void DownSampling(const PointCloud::Ptr cloud_src, const PointCloud::Ptr cloud_tgt, PointCloud::Ptr src, PointCloud::Ptr tgt ); 37 | void Filter(PointCloud::Ptr src, PointCloud::Ptr tgt); 38 | void ZNormalization(pcl::PointCloud::Ptr src, pcl::PointCloud::Ptr tgt); 39 | void Normals(pcl::PointCloud::Ptr points_with_normals_src, pcl::PointCloud::Ptr points_with_normals_tgt,PointCloud::Ptr src, PointCloud::Ptr tgt); 40 | void OldNormals(pcl::PointCloud::Ptr points_with_normals_src, pcl::PointCloud::Ptr points_with_normals_tgt,PointCloud::Ptr src, PointCloud::Ptr tgt); 41 | void MatrixEstimation(pcl::PointCloud::Ptr points_with_normals_src, pcl::PointCloud::Ptr points_with_normals_tgt, Eigen::Matrix4f &GlobalTransf); 42 | 43 | }; 44 | 45 | 46 | -------------------------------------------------------------------------------- /apps/android/KiwiPCL/jni/pcl_demo.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | 14 | void loadPCLPointCloud(); 15 | void simplePclRegistration(); 16 | void ICP_PCL(); 17 | void ICP(); 18 | -------------------------------------------------------------------------------- /apps/android/KiwiPCL/jni/profiler.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | 7 | 8 | 9 | 10 | timespec diff(timespec start, timespec end) 11 | { 12 | timespec temp; 13 | if ((end.tv_nsec-start.tv_nsec)<0) { 14 | temp.tv_sec = end.tv_sec-start.tv_sec-1; 15 | temp.tv_nsec = 1000000000+end.tv_nsec-start.tv_nsec; 16 | 17 | } else { 18 | temp.tv_sec = end.tv_sec-start.tv_sec; 19 | temp.tv_nsec = end.tv_nsec-start.tv_nsec; 20 | } 21 | return temp; 22 | } 23 | -------------------------------------------------------------------------------- /apps/android/KiwiPCL/jni/vtkAndroidOutputWindow.h: -------------------------------------------------------------------------------- 1 | /*======================================================================== 2 | VES --- VTK OpenGL ES Rendering Toolkit 3 | 4 | http://www.kitware.com/ves 5 | 6 | Copyright 2011 Kitware, Inc. 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | ========================================================================*/ 20 | 21 | #include 22 | #include 23 | 24 | class vtkAndroidOutputWindow : public vtkOutputWindow 25 | { 26 | public: 27 | vtkTypeMacro(vtkAndroidOutputWindow, vtkOutputWindow); 28 | static vtkAndroidOutputWindow* New(); 29 | 30 | void DisplayDebugText(const char* t) 31 | { 32 | LOGI(t); 33 | } 34 | 35 | void DisplayWarningText(const char* t) 36 | { 37 | LOGW(t); 38 | } 39 | 40 | void DisplayErrorText(const char* t) 41 | { 42 | LOGE(t); 43 | } 44 | 45 | void DisplayText(const char* t) 46 | { 47 | LOGI(t); 48 | } 49 | 50 | void DisplayGenericWarningText(const char* t) 51 | { 52 | LOGW(t); 53 | } 54 | 55 | static void Install() 56 | { 57 | vtkAndroidOutputWindow* window = vtkAndroidOutputWindow::New(); 58 | vtkOutputWindow::SetInstance(window); 59 | } 60 | 61 | private: 62 | vtkAndroidOutputWindow() { } 63 | 64 | vtkAndroidOutputWindow(const vtkAndroidOutputWindow&); 65 | void operator=(const vtkAndroidOutputWindow&); 66 | 67 | }; 68 | 69 | vtkStandardNewMacro(vtkAndroidOutputWindow); 70 | -------------------------------------------------------------------------------- /apps/android/KiwiPCL/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-16 15 | -------------------------------------------------------------------------------- /apps/android/KiwiPCL/res/drawable-hdpi/alert_dialog_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PointCloudLibrary/mobile/ce2f5c48907e019961eda43db480f6295e421315/apps/android/KiwiPCL/res/drawable-hdpi/alert_dialog_icon.png -------------------------------------------------------------------------------- /apps/android/KiwiPCL/res/drawable-hdpi/info_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PointCloudLibrary/mobile/ce2f5c48907e019961eda43db480f6295e421315/apps/android/KiwiPCL/res/drawable-hdpi/info_icon.png -------------------------------------------------------------------------------- /apps/android/KiwiPCL/res/drawable-hdpi/kiwi_small_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PointCloudLibrary/mobile/ce2f5c48907e019961eda43db480f6295e421315/apps/android/KiwiPCL/res/drawable-hdpi/kiwi_small_icon.png -------------------------------------------------------------------------------- /apps/android/KiwiPCL/res/drawable-mdpi/alert_dialog_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PointCloudLibrary/mobile/ce2f5c48907e019961eda43db480f6295e421315/apps/android/KiwiPCL/res/drawable-mdpi/alert_dialog_icon.png -------------------------------------------------------------------------------- /apps/android/KiwiPCL/res/drawable-mdpi/kiwi_small_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PointCloudLibrary/mobile/ce2f5c48907e019961eda43db480f6295e421315/apps/android/KiwiPCL/res/drawable-mdpi/kiwi_small_icon.png -------------------------------------------------------------------------------- /apps/android/KiwiPCL/res/drawable/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PointCloudLibrary/mobile/ce2f5c48907e019961eda43db480f6295e421315/apps/android/KiwiPCL/res/drawable/icon.png -------------------------------------------------------------------------------- /apps/android/KiwiPCL/res/drawable/info.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 10 | 14 | 17 | 18 | -------------------------------------------------------------------------------- /apps/android/KiwiPCL/res/drawable/info_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PointCloudLibrary/mobile/ce2f5c48907e019961eda43db480f6295e421315/apps/android/KiwiPCL/res/drawable/info_active.png -------------------------------------------------------------------------------- /apps/android/KiwiPCL/res/drawable/info_inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PointCloudLibrary/mobile/ce2f5c48907e019961eda43db480f6295e421315/apps/android/KiwiPCL/res/drawable/info_inactive.png -------------------------------------------------------------------------------- /apps/android/KiwiPCL/res/drawable/kitwarelogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PointCloudLibrary/mobile/ce2f5c48907e019961eda43db480f6295e421315/apps/android/KiwiPCL/res/drawable/kitwarelogo.png -------------------------------------------------------------------------------- /apps/android/KiwiPCL/res/drawable/opendata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 10 | 14 | 17 | -------------------------------------------------------------------------------- /apps/android/KiwiPCL/res/drawable/opendata_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PointCloudLibrary/mobile/ce2f5c48907e019961eda43db480f6295e421315/apps/android/KiwiPCL/res/drawable/opendata_active.png -------------------------------------------------------------------------------- /apps/android/KiwiPCL/res/drawable/opendata_inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PointCloudLibrary/mobile/ce2f5c48907e019961eda43db480f6295e421315/apps/android/KiwiPCL/res/drawable/opendata_inactive.png -------------------------------------------------------------------------------- /apps/android/KiwiPCL/res/drawable/reset.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 10 | 14 | 17 | -------------------------------------------------------------------------------- /apps/android/KiwiPCL/res/drawable/reset_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PointCloudLibrary/mobile/ce2f5c48907e019961eda43db480f6295e421315/apps/android/KiwiPCL/res/drawable/reset_active.png -------------------------------------------------------------------------------- /apps/android/KiwiPCL/res/drawable/reset_inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PointCloudLibrary/mobile/ce2f5c48907e019961eda43db480f6295e421315/apps/android/KiwiPCL/res/drawable/reset_inactive.png -------------------------------------------------------------------------------- /apps/android/KiwiPCL/res/layout/datasetlistactivity.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /apps/android/KiwiPCL/res/layout/kiwivieweractivity.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 13 | 14 | 21 | 22 | 29 | 30 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /apps/android/KiwiPCL/res/values-v11/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 |