├── .gitignore
├── OpenKinect-Processing
├── .classpath
├── .gitignore
├── .project
├── additional_libs
│ ├── jna.jar
│ └── processing_3.10a
│ │ ├── core.jar
│ │ ├── gluegen-rt-natives-linux-amd64.jar
│ │ ├── gluegen-rt-natives-linux-armv6hf.jar
│ │ ├── gluegen-rt-natives-linux-i586.jar
│ │ ├── gluegen-rt-natives-macosx-universal.jar
│ │ ├── gluegen-rt-natives-windows-amd64.jar
│ │ ├── gluegen-rt-natives-windows-i586.jar
│ │ ├── gluegen-rt.jar
│ │ ├── jogl-all-natives-linux-amd64.jar
│ │ ├── jogl-all-natives-linux-armv6hf.jar
│ │ ├── jogl-all-natives-linux-i586.jar
│ │ ├── jogl-all-natives-macosx-universal.jar
│ │ ├── jogl-all-natives-windows-amd64.jar
│ │ ├── jogl-all-natives-windows-i586.jar
│ │ └── jogl-all.jar
├── data
│ └── kinectThreshold.txt
├── examples
│ ├── Kinect_v1
│ │ ├── AveragePointTracking
│ │ │ ├── AveragePointTracking.pde
│ │ │ └── KinectTracker.pde
│ │ ├── DepthThreshold
│ │ │ └── DepthThreshold.pde
│ │ ├── MultiKinect
│ │ │ └── MultiKinect.pde
│ │ ├── PointCloud
│ │ │ └── PointCloud.pde
│ │ ├── PointCloudOGL
│ │ │ ├── PointCloudOGL.pde
│ │ │ └── data
│ │ │ │ ├── frag.glsl
│ │ │ │ └── vert.glsl
│ │ └── RGBDepthTest
│ │ │ └── RGBDepthTest.pde
│ ├── Kinect_v2
│ │ ├── AveragePointTracking2
│ │ │ ├── AveragePointTracking2.pde
│ │ │ └── KinectTracker.pde
│ │ ├── CameraPointCloud2
│ │ │ ├── CameraParams.pde
│ │ │ └── CameraPointCloud2.pde
│ │ ├── ColorPointCloud2
│ │ │ ├── ColorPointCloud2.pde
│ │ │ └── data
│ │ │ │ ├── frag.glsl
│ │ │ │ └── vert.glsl
│ │ ├── DepthPointCloud2
│ │ │ ├── CameraParams.pde
│ │ │ ├── DepthPointCloud2.pde
│ │ │ └── data
│ │ │ │ ├── frag.glsl
│ │ │ │ └── vert.glsl
│ │ ├── DepthThreshold2
│ │ │ └── DepthThreshold2.pde
│ │ ├── MultiKinect2
│ │ │ └── MultiKinect2.pde
│ │ └── RGBDepthTest2
│ │ │ └── RGBDepthTest2.pde
│ └── MultiKinectVersion
│ │ └── MultiKinectVersion.pde
├── lib
│ ├── jna.jar
│ ├── v1
│ │ ├── linux-armv6hf
│ │ │ └── libfreenect.so
│ │ ├── linux
│ │ │ ├── libfreenect.a
│ │ │ ├── libfreenect.so
│ │ │ ├── libfreenect.so.0.5
│ │ │ └── libfreenect.so.0.5.2
│ │ ├── mac
│ │ │ ├── libfreenect.dylib
│ │ │ └── libusb-1.0.0.dylib
│ │ └── msvc
│ │ │ ├── freenect.dll
│ │ │ ├── libusb-1.0.dll
│ │ │ └── pthreadVC2.dll
│ └── v2
│ │ ├── linux
│ │ ├── libfreenect2.so
│ │ ├── libfreenect2.so.0.2
│ │ ├── libfreenect2.so.0.2.0
│ │ ├── libturbojpeg.so.0
│ │ └── libturbojpeg.so.0.1.0
│ │ ├── mac
│ │ ├── libJNILibfreenect2.dylib
│ │ ├── libturbojpeg.a
│ │ ├── libturbojpeg.dylib
│ │ └── libusb-1.0.0.dylib
│ │ └── msvc
│ │ ├── OpenCL.lib
│ │ ├── libJNILibfreenect2.dll
│ │ ├── libusb-1.0.dll
│ │ ├── libusb-1.0.lib
│ │ ├── turbojpeg.dll
│ │ └── turbojpeg.lib
├── resources
│ ├── README.md
│ ├── build.properties
│ ├── build.xml
│ ├── code
│ │ ├── .gitignore
│ │ ├── ExampleTaglet.class
│ │ ├── ExampleTaglet.java
│ │ ├── ant-contrib-1.0b3.jar
│ │ └── doc.sh
│ ├── library.properties
│ └── stylesheet.css
├── src
│ └── org
│ │ └── openkinect
│ │ ├── freenect
│ │ ├── Context.java
│ │ ├── DepthFormat.java
│ │ ├── DepthHandler.java
│ │ ├── Device.java
│ │ ├── DeviceFlags.java
│ │ ├── FrameMode.java
│ │ ├── Freenect.java
│ │ ├── LedStatus.java
│ │ ├── LogHandler.java
│ │ ├── LogLevel.java
│ │ ├── Resolution.java
│ │ ├── TiltStatus.java
│ │ ├── VideoFormat.java
│ │ └── VideoHandler.java
│ │ ├── freenect2
│ │ └── Device.java
│ │ ├── processing
│ │ ├── DepthImage.java
│ │ ├── Kinect.java
│ │ ├── Kinect2.java
│ │ ├── LibraryPath.java
│ │ ├── RGBImage.java
│ │ └── TestIt.java
│ │ └── tests
│ │ ├── DepthThreshold2.java
│ │ ├── FrameTest.java
│ │ ├── MultiKinectV1.java
│ │ ├── PointCloudOGL2.java
│ │ ├── PointCloudTest.java
│ │ ├── RGBDepthTest2.java
│ │ ├── RegisteredTest.java
│ │ └── data
│ │ ├── frag.glsl
│ │ └── vert.glsl
└── web
│ ├── index.html
│ └── stylesheet.css
├── README.md
└── build_openKinect2
├── C++
├── libs
│ ├── libTurboJpeg
│ │ ├── include
│ │ │ └── turbojpeg.h
│ │ └── lib
│ │ │ └── osx
│ │ │ ├── libturbojpeg.a
│ │ │ └── libturbojpeg.dylib
│ ├── libfreenect2
│ │ └── include
│ │ │ └── libfreenect2.h
│ ├── libusb
│ │ ├── include
│ │ │ └── libusb
│ │ │ │ ├── hotplug.h
│ │ │ │ ├── libusb.h
│ │ │ │ ├── libusbi.h
│ │ │ │ ├── os
│ │ │ │ ├── darwin_usb.h
│ │ │ │ ├── linux_usbfs.h
│ │ │ │ ├── poll_posix.h
│ │ │ │ ├── poll_windows.h
│ │ │ │ ├── threads_posix.h
│ │ │ │ ├── threads_windows.h
│ │ │ │ ├── wince_usb.h
│ │ │ │ ├── windows_common.h
│ │ │ │ └── windows_usb.h
│ │ │ │ ├── version.h
│ │ │ │ └── version_nano.h
│ │ └── lib
│ │ │ ├── msvc
│ │ │ └── libusb-1.0.dll
│ │ │ └── osx
│ │ │ └── usb-1.0.0-superspeed.a
│ └── protonect
│ │ ├── include
│ │ ├── OpenCL
│ │ │ └── cl.hpp
│ │ └── libfreenect2
│ │ │ ├── async_packet_processor.h
│ │ │ ├── config.h
│ │ │ ├── config.h.in
│ │ │ ├── data_callback.h
│ │ │ ├── depth_packet_processor.h
│ │ │ ├── depth_packet_stream_parser.h
│ │ │ ├── double_buffer.h
│ │ │ ├── frame_listener.hpp
│ │ │ ├── frame_listener_impl.h
│ │ │ ├── libfreenect2.hpp
│ │ │ ├── packet_pipeline.h
│ │ │ ├── packet_processor.h
│ │ │ ├── protocol
│ │ │ ├── command.h
│ │ │ ├── command_transaction.h
│ │ │ ├── response.h
│ │ │ └── usb_control.h
│ │ │ ├── registration.h
│ │ │ ├── resource.h
│ │ │ ├── rgb_packet_processor.h
│ │ │ ├── rgb_packet_stream_parser.h
│ │ │ ├── threading.h
│ │ │ └── usb
│ │ │ ├── event_loop.h
│ │ │ └── transfer_pool.h
│ │ └── src
│ │ ├── command_transaction.cpp
│ │ ├── depth_packet_processor.cpp
│ │ ├── depth_packet_stream_parser.cpp
│ │ ├── double_buffer.cpp
│ │ ├── event_loop.cpp
│ │ ├── frame_listener_impl.cpp
│ │ ├── generate_resources.cpp
│ │ ├── libfreenect2.cpp
│ │ ├── opencl_depth_packet_processor.cl
│ │ ├── opencl_depth_packet_processor.cpp
│ │ ├── packet_pipeline.cpp
│ │ ├── registration.cpp
│ │ ├── resource.cpp
│ │ ├── resources.inc.h
│ │ ├── rgb_packet_processor.cpp
│ │ ├── rgb_packet_stream_parser.cpp
│ │ ├── shader
│ │ ├── debug.fs
│ │ ├── default.vs
│ │ ├── filter1.fs
│ │ ├── filter2.fs
│ │ ├── stage1.fs
│ │ └── stage2.fs
│ │ ├── test_opengl_depth_packet_processor.cpp
│ │ ├── tinythread
│ │ ├── tinythread.cpp
│ │ └── tinythread.h
│ │ ├── transfer_pool.cpp
│ │ ├── turbo_jpeg_rgb_packet_processor.cpp
│ │ └── usb_control.cpp
├── src
│ ├── JNILibfreenect2.cpp
│ ├── JNILibfreenect2.h
│ ├── org_openkinect_freenect2_Device.cpp
│ └── org_openkinect_freenect2_Device.h
├── vc2013
│ ├── Debug
│ │ └── libJNIlibfreenect2.dll
│ ├── libJNIlibfreenect2.sln
│ ├── libJNIlibfreenect2
│ │ ├── ReadMe.txt
│ │ ├── dllmain.cpp
│ │ ├── libJNIlibfreenect2.cpp
│ │ ├── libJNIlibfreenect2.vcxproj
│ │ ├── libJNIlibfreenect2.vcxproj.filters
│ │ ├── libJNIlibfreenect2.vcxproj.user
│ │ ├── stdafx.cpp
│ │ ├── stdafx.h
│ │ └── targetver.h
│ └── x64
│ │ └── Release
│ │ ├── libJNILibfreenect2.dll
│ │ ├── libJNILibfreenect2.exp
│ │ └── libJNILibfreenect2.lib
└── xcode
│ └── JNILibfreenect2.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ ├── xcshareddata
│ │ ├── JNILibfreenect2.xccheckout
│ │ └── JNILibfreenect2.xcscmblueprint
│ └── xcuserdata
│ │ └── tom.xcuserdatad
│ │ ├── UserInterfaceState.xcuserstate
│ │ └── WorkspaceSettings.xcsettings
│ └── xcuserdata
│ └── tom.xcuserdatad
│ ├── xcdebugger
│ └── Breakpoints_v2.xcbkptlist
│ └── xcschemes
│ ├── JNILibfreenect2.xcscheme
│ └── xcschememanagement.plist
├── C++CmakeLinux
├── CMakeLists.txt
├── README.md
└── src
│ ├── JNILibfreenect2.cpp
│ ├── JNILibfreenect2.h
│ ├── org_openkinect_freenect2_Device.cpp
│ └── org_openkinect_freenect2_Device.h
├── openKinectv2
├── .classpath
├── .project
├── .settings
│ └── org.eclipse.jdt.core.prefs
├── bin
│ ├── examples
│ │ ├── FrameTest.class
│ │ ├── MultipleKinects.class
│ │ ├── PointCloud.class
│ │ └── RegisteredTest.class
│ └── openKinectv2
│ │ ├── Device.class
│ │ ├── OpenKinectv2.class
│ │ └── color.glsl
├── lib
│ ├── libJNILibfreenect2.dll
│ ├── libJNILibfreenect2.dylib
│ ├── libturbojpeg.a
│ ├── libturbojpeg.dylib
│ ├── processing_2.2.1
│ │ ├── core.jar
│ │ ├── gluegen-rt-natives-linux-amd64.jar
│ │ ├── gluegen-rt-natives-linux-armv6hf.jar
│ │ ├── gluegen-rt-natives-linux-i586.jar
│ │ ├── gluegen-rt-natives-macosx-universal.jar
│ │ ├── gluegen-rt-natives-windows-amd64.jar
│ │ ├── gluegen-rt-natives-windows-i586.jar
│ │ ├── gluegen-rt.jar
│ │ ├── jogl-all-natives-linux-amd64.jar
│ │ ├── jogl-all-natives-linux-armv6hf.jar
│ │ ├── jogl-all-natives-linux-i586.jar
│ │ ├── jogl-all-natives-macosx-universal.jar
│ │ ├── jogl-all-natives-windows-amd64.jar
│ │ ├── jogl-all-natives-windows-i586.jar
│ │ └── jogl-all.jar
│ └── usb-1.0.0-superspeed.a
└── src
│ ├── examples
│ ├── FrameTest.java
│ ├── MultipleKinects.java
│ ├── PointCloud.java
│ └── RegisteredTest.java
│ └── openKinectv2
│ ├── Device.java
│ ├── OpenKinectv2.java
│ └── color.glsl
└── protonectTest
├── libs
├── Protonect.cpp
├── TurboJpeg
│ ├── include
│ │ └── turbojpeg.h
│ └── lib
│ │ └── osx
│ │ └── libturbojpeg.dylib
├── libfreenect2
│ └── include
│ │ └── libfreenect2.h
├── libusb
│ ├── include
│ │ └── libusb
│ │ │ ├── hotplug.h
│ │ │ ├── libusb.h
│ │ │ ├── libusbi.h
│ │ │ ├── os
│ │ │ ├── darwin_usb.h
│ │ │ ├── linux_usbfs.h
│ │ │ ├── poll_posix.h
│ │ │ ├── poll_windows.h
│ │ │ ├── threads_posix.h
│ │ │ ├── threads_windows.h
│ │ │ ├── wince_usb.h
│ │ │ ├── windows_common.h
│ │ │ └── windows_usb.h
│ │ │ ├── version.h
│ │ │ └── version_nano.h
│ └── lib
│ │ └── osx
│ │ └── usb-1.0.0-superspeed.a
└── protonect
│ ├── include
│ └── libfreenect2
│ │ ├── async_packet_processor.h
│ │ ├── config.h
│ │ ├── config.h.in
│ │ ├── data_callback.h
│ │ ├── depth_packet_processor.h
│ │ ├── depth_packet_stream_parser.h
│ │ ├── double_buffer.h
│ │ ├── frame_listener.hpp
│ │ ├── frame_listener_impl.h
│ │ ├── libfreenect2.hpp
│ │ ├── packet_pipeline.h
│ │ ├── packet_processor.h
│ │ ├── protocol
│ │ ├── command.h
│ │ ├── command_transaction.h
│ │ ├── response.h
│ │ └── usb_control.h
│ │ ├── registration.h
│ │ ├── resource.h
│ │ ├── rgb_packet_processor.h
│ │ ├── rgb_packet_stream_parser.h
│ │ ├── threading.h
│ │ ├── tinythread
│ │ ├── tinythread.cpp
│ │ └── tinythread.h
│ │ └── usb
│ │ ├── event_loop.h
│ │ └── transfer_pool.h
│ └── lib
│ ├── libfreenect2.a
│ └── libfreenect2.dylib
├── src
└── main.cpp
└── xcode
└── ProtonectTest.xcodeproj
├── project.pbxproj
├── project.xcworkspace
├── contents.xcworkspacedata
├── xcshareddata
│ └── ProtonectTest.xccheckout
└── xcuserdata
│ └── tom.xcuserdatad
│ └── UserInterfaceState.xcuserstate
└── xcuserdata
└── tom.xcuserdatad
└── xcschemes
├── ProtonectTest.xcscheme
└── xcschememanagement.plist
/.gitignore:
--------------------------------------------------------------------------------
1 | #MAC OS X
2 |
3 | *.DS_Store
4 |
5 | *.build
6 |
7 | *.mode2v3
8 |
9 | build_openKinect2/Java/lib/JNILibfreenect2.build
10 |
11 | build_openKinect2/openKinectv2/lib/libJNILibfreenect2.dylib.dSYM
12 |
13 | *.dSYM
14 |
15 | *.dylib.dSYM
16 |
17 |
18 | #ECLIPSE
19 |
20 | *.metadata
21 |
22 | *.recommenders
23 |
24 | build_openKinect2/.metadata
25 |
26 | build_openKinect2/.recommenders
27 |
28 | build_openKinect2/openKinectv2/.settings
29 |
30 | build_openKinect2/openKinectv2/bin/java.policy.applet
31 |
32 | *.lock
33 |
34 | *.build
35 |
36 | *.fdt
37 |
38 | *.fnm
39 |
40 | *.frq
41 |
42 | *.gen
43 |
44 | *.tis
45 |
46 | *.tii
47 |
48 | *.tis
49 |
50 | *.prx
51 |
52 | *.tii
53 |
54 | *.fdt
55 |
56 | *.lock
57 |
58 | *.lock
59 |
60 |
61 | #NETBEANS
62 |
63 | /OpenKinect-Processing/nbproject/private/
64 |
65 | /OpenKinect-Processing/build/
66 |
67 | /OpenKinect-Processing/dist/
68 |
69 |
70 | #VISUAL STUDIO
71 |
72 |
73 | *.log
74 |
75 | *.tlog
76 |
77 | *.obj
78 |
79 | *.pdb
80 |
81 | *.ipch
82 |
83 | *.opensdf
84 |
85 | *.sdf
86 |
87 | *.ilk
88 |
89 | *.pch
90 |
91 | *.idb
92 |
93 | *.suo
94 |
--------------------------------------------------------------------------------
/OpenKinect-Processing/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/OpenKinect-Processing/.gitignore:
--------------------------------------------------------------------------------
1 | distribution
2 | /bin/
3 | /bin/
4 |
--------------------------------------------------------------------------------
/OpenKinect-Processing/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | OpenKinect-Processing
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.jdt.core.javanature
16 |
17 |
18 |
--------------------------------------------------------------------------------
/OpenKinect-Processing/additional_libs/jna.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/jna.jar
--------------------------------------------------------------------------------
/OpenKinect-Processing/additional_libs/processing_3.10a/core.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/core.jar
--------------------------------------------------------------------------------
/OpenKinect-Processing/additional_libs/processing_3.10a/gluegen-rt-natives-linux-amd64.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/gluegen-rt-natives-linux-amd64.jar
--------------------------------------------------------------------------------
/OpenKinect-Processing/additional_libs/processing_3.10a/gluegen-rt-natives-linux-armv6hf.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/gluegen-rt-natives-linux-armv6hf.jar
--------------------------------------------------------------------------------
/OpenKinect-Processing/additional_libs/processing_3.10a/gluegen-rt-natives-linux-i586.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/gluegen-rt-natives-linux-i586.jar
--------------------------------------------------------------------------------
/OpenKinect-Processing/additional_libs/processing_3.10a/gluegen-rt-natives-macosx-universal.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/gluegen-rt-natives-macosx-universal.jar
--------------------------------------------------------------------------------
/OpenKinect-Processing/additional_libs/processing_3.10a/gluegen-rt-natives-windows-amd64.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/gluegen-rt-natives-windows-amd64.jar
--------------------------------------------------------------------------------
/OpenKinect-Processing/additional_libs/processing_3.10a/gluegen-rt-natives-windows-i586.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/gluegen-rt-natives-windows-i586.jar
--------------------------------------------------------------------------------
/OpenKinect-Processing/additional_libs/processing_3.10a/gluegen-rt.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/gluegen-rt.jar
--------------------------------------------------------------------------------
/OpenKinect-Processing/additional_libs/processing_3.10a/jogl-all-natives-linux-amd64.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/jogl-all-natives-linux-amd64.jar
--------------------------------------------------------------------------------
/OpenKinect-Processing/additional_libs/processing_3.10a/jogl-all-natives-linux-armv6hf.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/jogl-all-natives-linux-armv6hf.jar
--------------------------------------------------------------------------------
/OpenKinect-Processing/additional_libs/processing_3.10a/jogl-all-natives-linux-i586.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/jogl-all-natives-linux-i586.jar
--------------------------------------------------------------------------------
/OpenKinect-Processing/additional_libs/processing_3.10a/jogl-all-natives-macosx-universal.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/jogl-all-natives-macosx-universal.jar
--------------------------------------------------------------------------------
/OpenKinect-Processing/additional_libs/processing_3.10a/jogl-all-natives-windows-amd64.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/jogl-all-natives-windows-amd64.jar
--------------------------------------------------------------------------------
/OpenKinect-Processing/additional_libs/processing_3.10a/jogl-all-natives-windows-i586.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/jogl-all-natives-windows-i586.jar
--------------------------------------------------------------------------------
/OpenKinect-Processing/additional_libs/processing_3.10a/jogl-all.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/jogl-all.jar
--------------------------------------------------------------------------------
/OpenKinect-Processing/data/kinectThreshold.txt:
--------------------------------------------------------------------------------
1 | 630
2 |
--------------------------------------------------------------------------------
/OpenKinect-Processing/examples/Kinect_v1/AveragePointTracking/AveragePointTracking.pde:
--------------------------------------------------------------------------------
1 | // Daniel Shiffman
2 | // Tracking the average location beyond a given depth threshold
3 | // Thanks to Dan O'Sullivan
4 |
5 | // https://github.com/shiffman/OpenKinect-for-Processing
6 | // http://shiffman.net/p5/kinect/
7 |
8 | import org.openkinect.freenect.*;
9 | import org.openkinect.processing.*;
10 |
11 | // The kinect stuff is happening in another class
12 | KinectTracker tracker;
13 | Kinect kinect;
14 |
15 |
16 | void setup() {
17 | size(640, 520);
18 | kinect = new Kinect(this);
19 | tracker = new KinectTracker();
20 | }
21 |
22 | void draw() {
23 | background(255);
24 |
25 | // Run the tracking analysis
26 | tracker.track();
27 | // Show the image
28 | tracker.display();
29 |
30 | // Let's draw the raw location
31 | PVector v1 = tracker.getPos();
32 | fill(50, 100, 250, 200);
33 | noStroke();
34 | ellipse(v1.x, v1.y, 20, 20);
35 |
36 | // Let's draw the "lerped" location
37 | PVector v2 = tracker.getLerpedPos();
38 | fill(100, 250, 50, 200);
39 | noStroke();
40 | ellipse(v2.x, v2.y, 20, 20);
41 |
42 | // Display some info
43 | int t = tracker.getThreshold();
44 | fill(0);
45 | text("threshold: " + t + " " + "framerate: " + int(frameRate) + " " +
46 | "UP increase threshold, DOWN decrease threshold", 10, 500);
47 | }
48 |
49 | // Adjust the threshold with key presses
50 | void keyPressed() {
51 | int t = tracker.getThreshold();
52 | if (key == CODED) {
53 | if (keyCode == UP) {
54 | t+=5;
55 | tracker.setThreshold(t);
56 | } else if (keyCode == DOWN) {
57 | t-=5;
58 | tracker.setThreshold(t);
59 | }
60 | }
61 | }
--------------------------------------------------------------------------------
/OpenKinect-Processing/examples/Kinect_v1/DepthThreshold/DepthThreshold.pde:
--------------------------------------------------------------------------------
1 | // Daniel Shiffman
2 | // Depth thresholding example
3 |
4 | // https://github.com/shiffman/OpenKinect-for-Processing
5 | // http://shiffman.net/p5/kinect/
6 |
7 | // Original example by Elie Zananiri
8 | // http://www.silentlycrashing.net
9 |
10 | import org.openkinect.freenect.*;
11 | import org.openkinect.processing.*;
12 |
13 | Kinect kinect;
14 |
15 | // Depth image
16 | PImage depthImg;
17 |
18 | // Which pixels do we care about?
19 | // These thresholds can also be found with a variaty of methods
20 | float minDepth = 996;
21 | float maxDepth = 2493;
22 |
23 | // What is the kinect's angle
24 | float angle;
25 |
26 | void setup() {
27 | size(1280, 480);
28 |
29 | kinect = new Kinect(this);
30 | kinect.initDepth();
31 | angle = kinect.getTilt();
32 |
33 | // Blank image
34 | depthImg = new PImage(kinect.width, kinect.height);
35 | }
36 |
37 | void draw() {
38 | // Draw the raw image
39 | image(kinect.getDepthImage(), 0, 0);
40 |
41 | // Calibration
42 | //minDepth = map(mouseX,0,width, 0, 4500);
43 | //maxDepth = map(mouseY,0,height, 0, 4500);
44 |
45 | // Threshold the depth image
46 | int[] rawDepth = kinect.getRawDepth();
47 | for (int i=0; i < rawDepth.length; i++) {
48 | if (rawDepth[i] >= minDepth && rawDepth[i] <= maxDepth) {
49 | depthImg.pixels[i] = color(255);
50 | } else {
51 | depthImg.pixels[i] = color(0);
52 | }
53 | }
54 |
55 | // Draw the thresholded image
56 | depthImg.updatePixels();
57 | image(depthImg, kinect.width, 0);
58 |
59 | //Comment for Calibration
60 | fill(0);
61 | text("TILT: " + angle, 10, 20);
62 | text("THRESHOLD: [" + minDepth + ", " + maxDepth + "]", 10, 36);
63 |
64 | //Calibration Text
65 | //fill(255);
66 | //textSize(32);
67 | //text(minDepth + " " + maxDepth, 10, 64);
68 | }
69 |
70 | // Adjust the angle and the depth threshold min and max
71 | void keyPressed() {
72 | if (key == CODED) {
73 | if (keyCode == UP) {
74 | angle++;
75 | } else if (keyCode == DOWN) {
76 | angle--;
77 | }
78 | angle = constrain(angle, 0, 30);
79 | kinect.setTilt(angle);
80 | } else if (key == 'a') {
81 | minDepth = constrain(minDepth+10, 0, maxDepth);
82 | } else if (key == 's') {
83 | minDepth = constrain(minDepth-10, 0, maxDepth);
84 | } else if (key == 'z') {
85 | maxDepth = constrain(maxDepth+10, minDepth, 2047);
86 | } else if (key =='x') {
87 | maxDepth = constrain(maxDepth-10, minDepth, 2047);
88 | }
89 | }
--------------------------------------------------------------------------------
/OpenKinect-Processing/examples/Kinect_v1/PointCloudOGL/PointCloudOGL.pde:
--------------------------------------------------------------------------------
1 | // Thomas Sanchez Lengeling
2 | // openGL Point Cloud Example.
3 |
4 | // https://github.com/shiffman/OpenKinect-for-Processing
5 | // http://shiffman.net/p5/kinect/
6 |
7 | import java.nio.*;
8 | import org.openkinect.freenect.*;
9 | import org.openkinect.processing.*;
10 |
11 | // Kinect Library object
12 | Kinect kinect;
13 |
14 | // Angle for rotation
15 | float a = 0;
16 |
17 | //openGL object and shader
18 | PGL pgl;
19 | PShader sh;
20 |
21 | //VBO buffer location in the GPU
22 | int vertexVboId;
23 |
24 | void setup() {
25 | // Rendering in P3D
26 | size(800, 600, P3D);
27 | kinect = new Kinect(this);
28 | kinect.initDepth();
29 |
30 | //load shaders
31 | sh = loadShader("frag.glsl", "vert.glsl");
32 |
33 | PGL pgl = beginPGL();
34 |
35 | IntBuffer intBuffer = IntBuffer.allocate(1);
36 | pgl.genBuffers(1, intBuffer);
37 |
38 | //memory location of the VBO
39 | vertexVboId = intBuffer.get(0);
40 |
41 | endPGL();
42 | }
43 |
44 | void draw() {
45 |
46 | background(0);
47 |
48 | image(kinect.getDepthImage(), 0, 0, 320, 240);
49 |
50 | // Set up origin at middle of display, scale, and translate
51 | pushMatrix();
52 | translate(width/2, height/2, 50);
53 | scale(150);
54 | rotateY(a);
55 |
56 |
57 | //data size times 3 for each XYZ coordinate
58 | int vertData = kinect.width * kinect.height;
59 |
60 | //begin openGL calls and bind the shader
61 | pgl = beginPGL();
62 | sh.bind();
63 |
64 | FloatBuffer depthPositions = kinect.getDephToWorldPositions();
65 |
66 |
67 | //obtain the vertex location in the shaders.
68 | //useful to know what shader to use when drawing the vertex positions
69 | vertexVboId = pgl.getAttribLocation(sh.glProgram, "vertex");
70 |
71 | pgl.enableVertexAttribArray(vertexVboId);
72 |
73 | //bind vertex positions to the VBO
74 | {
75 | pgl.bindBuffer(PGL.ARRAY_BUFFER, vertexVboId);
76 | // fill VBO with data
77 | pgl.bufferData(PGL.ARRAY_BUFFER, Float.BYTES * vertData *3, depthPositions, PGL.DYNAMIC_DRAW);
78 | // associate currently bound VBO with shader attribute
79 | pgl.vertexAttribPointer(vertexVboId, 3, PGL.FLOAT, false, Float.BYTES * 3, 0 );
80 | }
81 |
82 | // unbind VBOs
83 | pgl.bindBuffer(PGL.ARRAY_BUFFER, 0);
84 |
85 | //draw the point buffer as a set of POINTS
86 | pgl.drawArrays(PGL.POINTS, 0, vertData);
87 |
88 | //disable the vertex positions
89 | pgl.disableVertexAttribArray(vertexVboId);
90 |
91 | //finish drawing
92 | sh.unbind();
93 | endPGL();
94 |
95 | popMatrix();
96 |
97 | fill(255, 0, 0);
98 | text(frameRate, 50, 50);
99 |
100 | // Rotate
101 | // Uncomment for rotation
102 | // a += 0.015f;
103 | }
--------------------------------------------------------------------------------
/OpenKinect-Processing/examples/Kinect_v1/PointCloudOGL/data/frag.glsl:
--------------------------------------------------------------------------------
1 | #ifdef GL_ES
2 | precision mediump float;
3 | precision mediump int;
4 | #endif
5 |
6 | varying vec4 vertColor;
7 |
8 | void main() {
9 | //color image int BGRA Color format
10 | gl_FragColor = vec4(1, 1, 1, 1);
11 | }
12 |
--------------------------------------------------------------------------------
/OpenKinect-Processing/examples/Kinect_v1/PointCloudOGL/data/vert.glsl:
--------------------------------------------------------------------------------
1 | uniform mat4 transform;
2 |
3 | attribute vec4 vertex;
4 | attribute vec4 color;
5 |
6 | varying vec4 vertColor;
7 |
8 | void main() {
9 | gl_Position = transform * vertex;
10 | vertColor = color;
11 | }
12 |
--------------------------------------------------------------------------------
/OpenKinect-Processing/examples/Kinect_v1/RGBDepthTest/RGBDepthTest.pde:
--------------------------------------------------------------------------------
1 | // Daniel Shiffman
2 | // All features test
3 |
4 | // https://github.com/shiffman/OpenKinect-for-Processing
5 | // http://shiffman.net/p5/kinect/
6 |
7 | import org.openkinect.freenect.*;
8 | import org.openkinect.processing.*;
9 |
10 | Kinect kinect;
11 |
12 | float deg;
13 |
14 | boolean ir = false;
15 | boolean colorDepth = false;
16 | boolean mirror = false;
17 |
18 | void setup() {
19 | size(1280, 520);
20 | kinect = new Kinect(this);
21 | kinect.initDepth();
22 | kinect.initVideo();
23 | //kinect.enableIR(ir);
24 | kinect.enableColorDepth(colorDepth);
25 |
26 | deg = kinect.getTilt();
27 | // kinect.tilt(deg);
28 | }
29 |
30 |
31 | void draw() {
32 | background(0);
33 | image(kinect.getVideoImage(), 0, 0);
34 | image(kinect.getDepthImage(), 640, 0);
35 | fill(255);
36 | text(
37 | "Press 'i' to enable/disable between video image and IR image, " +
38 | "Press 'c' to enable/disable between color depth and gray scale depth, " +
39 | "Press 'm' to enable/diable mirror mode, "+
40 | "UP and DOWN to tilt camera " +
41 | "Framerate: " + int(frameRate), 10, 515);
42 | }
43 |
44 | void keyPressed() {
45 | if (key == 'i') {
46 | ir = !ir;
47 | kinect.enableIR(ir);
48 | } else if (key == 'c') {
49 | colorDepth = !colorDepth;
50 | kinect.enableColorDepth(colorDepth);
51 | }else if(key == 'm'){
52 | mirror = !mirror;
53 | kinect.enableMirror(mirror);
54 | } else if (key == CODED) {
55 | if (keyCode == UP) {
56 | deg++;
57 | } else if (keyCode == DOWN) {
58 | deg--;
59 | }
60 | deg = constrain(deg, 0, 30);
61 | kinect.setTilt(deg);
62 | }
63 | }
--------------------------------------------------------------------------------
/OpenKinect-Processing/examples/Kinect_v2/AveragePointTracking2/AveragePointTracking2.pde:
--------------------------------------------------------------------------------
1 | // Daniel Shiffman and Thomas Sanchez Lengeling
2 | // Tracking the average location beyond a given depth threshold
3 | // Thanks to Dan O'Sullivan
4 |
5 | // https://github.com/shiffman/OpenKinect-for-Processing
6 | // http://shiffman.net/p5/kinect/
7 |
8 | import org.openkinect.processing.*;
9 |
10 | // The kinect stuff is happening in another class
11 | KinectTracker tracker;
12 |
13 |
14 |
15 | void setup() {
16 | size(640, 520);
17 |
18 | tracker = new KinectTracker(this);
19 | }
20 |
21 | void draw() {
22 | background(255);
23 |
24 | // Run the tracking analysis
25 | tracker.track();
26 | // Show the image
27 | tracker.display();
28 |
29 | // Let's draw the raw location
30 | PVector v1 = tracker.getPos();
31 | fill(50, 100, 250, 200);
32 | noStroke();
33 | ellipse(v1.x, v1.y, 20, 20);
34 |
35 | // Let's draw the "lerped" location
36 | PVector v2 = tracker.getLerpedPos();
37 | fill(100, 250, 50, 200);
38 | noStroke();
39 | ellipse(v2.x, v2.y, 20, 20);
40 |
41 | // Display some info
42 | int t = tracker.getThreshold();
43 | fill(0);
44 | text("threshold: " + t + " " + "framerate: " + int(frameRate) + " " +
45 | "UP increase threshold, DOWN decrease threshold", 10, 500);
46 | }
47 |
48 | // Adjust the threshold with key presses
49 | void keyPressed() {
50 | int t = tracker.getThreshold();
51 | if (key == CODED) {
52 | if (keyCode == UP) {
53 | t +=5;
54 | tracker.setThreshold(t);
55 | } else if (keyCode == DOWN) {
56 | t -=5;
57 | tracker.setThreshold(t);
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/OpenKinect-Processing/examples/Kinect_v2/CameraPointCloud2/CameraParams.pde:
--------------------------------------------------------------------------------
1 | //camera information based on the Kinect v2 hardware
2 | static class CameraParams {
3 | static float cx = 254.878f;
4 | static float cy = 205.395f;
5 | static float fx = 365.456f;
6 | static float fy = 365.456f;
7 | static float k1 = 0.0905474;
8 | static float k2 = -0.26819;
9 | static float k3 = 0.0950862;
10 | static float p1 = 0.0;
11 | static float p2 = 0.0;
12 | }
--------------------------------------------------------------------------------
/OpenKinect-Processing/examples/Kinect_v2/CameraPointCloud2/CameraPointCloud2.pde:
--------------------------------------------------------------------------------
1 | // Daniel Shiffman
2 | // Thomas Sanchez Lengeling
3 | // Kinect Point Cloud example
4 |
5 | // https://github.com/shiffman/OpenKinect-for-Processing
6 | // http://shiffman.net/p5/kinect/
7 |
8 | import org.openkinect.processing.*;
9 |
10 | // Kinect Library object
11 | Kinect2 kinect2;
12 |
13 | // Angle for rotation
14 | float rotationRads = 3.1;
15 |
16 | void setup() {
17 |
18 | // Rendering in P3D
19 | size(800, 600, P3D);
20 |
21 | kinect2 = new Kinect2(this);
22 | kinect2.initDepth();
23 | kinect2.initDevice();
24 |
25 | smooth(16);
26 | }
27 |
28 |
29 | void draw() {
30 | background(0);
31 |
32 | // Translate and rotate
33 | pushMatrix();
34 | translate(width/2, height/2, 50);
35 | rotateY(rotationRads);
36 |
37 | // We're just going to calculate and draw every 2nd pixel
38 | int skip = 2;
39 |
40 | // Get the raw depth as array of integers
41 | int[] depth = kinect2.getRawDepth();
42 |
43 | stroke(255);
44 | beginShape(POINTS);
45 | for (int x = 0; x < kinect2.depthWidth; x += skip) {
46 | for (int y = 0; y < kinect2.depthHeight; y += skip) {
47 | int offset = x + y * kinect2.depthWidth;
48 |
49 | //calculte the x, y, z camera position based on the raw depth data
50 | PVector point = depthToPointCloudPos(x, y, depth[offset]);
51 |
52 | // Draw a point
53 | vertex(point.x, point.y, point.z);
54 | }
55 | }
56 | endShape();
57 |
58 | //pop the matrix scene, reset translation and rotation
59 | popMatrix();
60 |
61 |
62 | drawFrustum();
63 |
64 | // Rotate
65 | //rotationRads += 0.0015f;
66 | }
67 |
68 | //draw camera frustum
69 | void drawFrustum(){
70 |
71 | }
72 |
73 | //calculate the xyz camera position based on the depth data
74 | PVector depthToPointCloudPos(int x, int y, float depthValue) {
75 | PVector point = new PVector();
76 | point.z = (depthValue);// / (1.0f); // Convert from mm to meters
77 | point.x = (x - CameraParams.cx) * point.z / CameraParams.fx;
78 | point.y = (y - CameraParams.cy) * point.z / CameraParams.fy;
79 | return point;
80 | }
--------------------------------------------------------------------------------
/OpenKinect-Processing/examples/Kinect_v2/ColorPointCloud2/data/frag.glsl:
--------------------------------------------------------------------------------
1 | #ifdef GL_ES
2 | precision mediump float;
3 | precision mediump int;
4 | #endif
5 |
6 | varying vec4 vertColor;
7 |
8 | void main() {
9 | //color image int BGRA Color format
10 | gl_FragColor = vertColor;
11 | }
12 |
--------------------------------------------------------------------------------
/OpenKinect-Processing/examples/Kinect_v2/ColorPointCloud2/data/vert.glsl:
--------------------------------------------------------------------------------
1 | uniform mat4 transform;
2 |
3 | attribute vec4 vertex;
4 | attribute vec4 color;
5 |
6 | varying vec4 vertColor;
7 |
8 | void main() {
9 | gl_Position = transform * vertex;
10 | vertColor = color;
11 | }
12 |
--------------------------------------------------------------------------------
/OpenKinect-Processing/examples/Kinect_v2/DepthPointCloud2/CameraParams.pde:
--------------------------------------------------------------------------------
1 | //camera information based on the Kinect v2 hardware
2 | static class CameraParams {
3 | static float cx = 254.878f;
4 | static float cy = 205.395f;
5 | static float fx = 365.456f;
6 | static float fy = 365.456f;
7 | static float k1 = 0.0905474;
8 | static float k2 = -0.26819;
9 | static float k3 = 0.0950862;
10 | static float p1 = 0.0;
11 | static float p2 = 0.0;
12 | }
--------------------------------------------------------------------------------
/OpenKinect-Processing/examples/Kinect_v2/DepthPointCloud2/data/frag.glsl:
--------------------------------------------------------------------------------
1 | #ifdef GL_ES
2 | precision mediump float;
3 | precision mediump int;
4 | #endif
5 |
6 | varying vec4 vertColor;
7 |
8 | //input color
9 | uniform vec4 fragColor;
10 |
11 | void main() {
12 |
13 | //outputColor
14 | gl_FragColor = fragColor;
15 | }
--------------------------------------------------------------------------------
/OpenKinect-Processing/examples/Kinect_v2/DepthPointCloud2/data/vert.glsl:
--------------------------------------------------------------------------------
1 | uniform mat4 transform;
2 |
3 | attribute vec4 vertex;
4 | //attribute vec4 color;
5 |
6 | varying vec4 vertColor;
7 |
8 | void main() {
9 | gl_Position = transform * vertex;
10 | // vertColor = color;
11 | }
--------------------------------------------------------------------------------
/OpenKinect-Processing/examples/Kinect_v2/DepthThreshold2/DepthThreshold2.pde:
--------------------------------------------------------------------------------
1 | // Daniel Shiffman
2 | // Depth thresholding example
3 |
4 | // https://github.com/shiffman/OpenKinect-for-Processing
5 | // http://shiffman.net/p5/kinect/
6 |
7 | // Original example by Elie Zananiri
8 | // http://www.silentlycrashing.net
9 |
10 | import org.openkinect.processing.*;
11 |
12 | Kinect2 kinect2;
13 |
14 | // Depth image
15 | PImage depthImg;
16 |
17 | // Which pixels do we care about?
18 | int minDepth = 0;
19 | int maxDepth = 4500; //4.5m
20 |
21 | // What is the kinect's angle
22 | float angle;
23 |
24 | void setup() {
25 | size(1280, 480);
26 |
27 | kinect2 = new Kinect2(this);
28 | kinect2.initDepth();
29 | kinect2.initDevice();
30 |
31 | // Blank image
32 | depthImg = new PImage(kinect2.depthWidth, kinect2.depthHeight);
33 | }
34 |
35 | void draw() {
36 | // Draw the raw image
37 | image(kinect2.getDepthImage(), 0, 0);
38 |
39 | // Threshold the depth image
40 | int[] rawDepth = kinect2.getRawDepth();
41 |
42 |
43 | for (int i=0; i < rawDepth.length; i++) {
44 | if (rawDepth[i] >= minDepth && rawDepth[i] <= maxDepth) {
45 | float ratio = (maxDepth - minDepth)/255.0;
46 | depthImg.pixels[i] = color((rawDepth[i] - minDepth)/ratio);
47 | } else {
48 | depthImg.pixels[i] = color(0);
49 | }
50 | }
51 |
52 |
53 | // Draw the thresholded image
54 | depthImg.updatePixels();
55 | image(depthImg, kinect2.depthWidth, 0);
56 |
57 | fill(0);
58 | text("TILT: " + angle, 10, 20);
59 | text("THRESHOLD: [" + minDepth + ", " + maxDepth + "]", 10, 36);
60 | }
61 |
62 | // Adjust the angle and the depth threshold min and max
63 | void keyPressed() {
64 | if (key == 'a') {
65 | minDepth = constrain(minDepth+100, 0, maxDepth);
66 | } else if (key == 's') {
67 | minDepth = constrain(minDepth-100, 0, maxDepth);
68 | } else if (key == 'z') {
69 | maxDepth = constrain(maxDepth+100, minDepth, 1165952918);
70 | } else if (key =='x') {
71 | maxDepth = constrain(maxDepth-100, minDepth, 1165952918);
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/OpenKinect-Processing/examples/Kinect_v2/MultiKinect2/MultiKinect2.pde:
--------------------------------------------------------------------------------
1 | /*
2 | Thomas Sanchez Lengeling
3 | http://codigogenerativo.com/
4 |
5 | How to use multiple Kinects v2 in the same sketch.
6 | Should work up n number of Kinects v2 connected to the USB 3.0 port.
7 |
8 | https://github.com/shiffman/OpenKinect-for-Processing
9 | http://shiffman.net/p5/kinect/
10 | */
11 |
12 | import org.openkinect.processing.*;
13 |
14 | Kinect2 kinect2a;
15 | Kinect2 kinect2b;
16 |
17 | void setup() {
18 | size(1536, 848, P2D);
19 |
20 | kinect2a = new Kinect2(this);
21 | kinect2a.initDepth();
22 | kinect2a.initVideo();
23 | kinect2a.initIR();
24 |
25 | kinect2b = new Kinect2(this);
26 | kinect2b.initDepth();
27 | kinect2b.initVideo();
28 | kinect2b.initIR();
29 |
30 | //Start tracking each kinect
31 | kinect2a.initDevice(0); //index 0
32 | kinect2b.initDevice(1); //index 1
33 |
34 | background(0);
35 | }
36 |
37 | void draw() {
38 | background(0);
39 |
40 | image(kinect2a.getDepthImage(), 0, 0);
41 | image(kinect2a.getIrImage(), 512, 0);
42 | image(kinect2a.getVideoImage(), 512*2, 0, 512, 424);
43 |
44 | image(kinect2b.getDepthImage(), 0, 424);
45 | image(kinect2b.getIrImage(), 512, 424);
46 | image(kinect2b.getVideoImage(), 512*2, 424, 512, 424);
47 | }
--------------------------------------------------------------------------------
/OpenKinect-Processing/examples/Kinect_v2/RGBDepthTest2/RGBDepthTest2.pde:
--------------------------------------------------------------------------------
1 | // Daniel Shiffman
2 | // All features test
3 |
4 | // https://github.com/shiffman/OpenKinect-for-Processing
5 | // http://shiffman.net/p5/kinect/
6 |
7 | import org.openkinect.freenect.*;
8 | import org.openkinect.freenect2.*;
9 | import org.openkinect.processing.*; //<>//
10 |
11 | Kinect2 kinect2;
12 |
13 | void setup() {
14 | size(1024, 848, P2D);
15 |
16 | kinect2 = new Kinect2(this);
17 | kinect2.initVideo();
18 | kinect2.initDepth();
19 | kinect2.initIR();
20 | kinect2.initRegistered();
21 | // Start all data
22 | kinect2.initDevice();
23 | }
24 |
25 |
26 | void draw() {
27 | background(0);
28 | image(kinect2.getVideoImage(), 0, 0, kinect2.colorWidth*0.267, kinect2.colorHeight*0.267);
29 | image(kinect2.getDepthImage(), kinect2.depthWidth, 0);
30 | image(kinect2.getIrImage(), 0, kinect2.depthHeight);
31 |
32 | image(kinect2.getRegisteredImage(), kinect2.depthWidth, kinect2.depthHeight);
33 | fill(255);
34 | text("Framerate: " + (int)(frameRate), 10, 515);
35 | }
36 |
--------------------------------------------------------------------------------
/OpenKinect-Processing/examples/MultiKinectVersion/MultiKinectVersion.pde:
--------------------------------------------------------------------------------
1 |
2 | //Thomas Sanchez Lengeling
3 | //http://codigogenerativo.com/
4 |
5 | //Multiple Kinect versions on a single sketch.
6 | //https://github.com/shiffman/OpenKinect-for-Processing
7 | //http://shiffman.net/p5/kinect/
8 |
9 | import org.openkinect.processing.*;
10 |
11 | Kinect kinect;
12 | Kinect2 kinect2;
13 |
14 | float deg;
15 |
16 |
17 | void setup() {
18 | size(1536, 848);
19 |
20 | //v2
21 | kinect2 = new Kinect2(this);
22 | kinect2.initDepth();
23 | kinect2.initVideo();
24 | kinect2.initIR();
25 | kinect2.initDevice();
26 |
27 | //v1
28 | kinect = new Kinect(this);
29 | kinect.initDepth();
30 | kinect.initVideo();
31 | kinect.enableColorDepth(false);
32 | deg = kinect.getTilt();
33 | }
34 |
35 |
36 | void draw() {
37 | background(0);
38 |
39 | //v2
40 | PImage depth = kinect2.getDepthImage();
41 | image(depth, 0, 0);
42 |
43 | PImage ir = kinect2.getIrImage();
44 | image(ir, 512, 0);
45 |
46 | PImage rgb = kinect2.getVideoImage();
47 | image(rgb, 512*2, 0, 512, 424);
48 |
49 | //v1 getDepthImage
50 | image(kinect.getDepthImage(), 0, 424, 512, 424);
51 | image(kinect.getVideoImage(), 512*2, 424, 512, 424);
52 | }
53 |
54 |
55 | //with key UP or DOWM tilt the Kinect v1
56 | void keyPressed() {
57 | if (key == CODED) {
58 | if (keyCode == UP) {
59 | deg++;
60 | deg = constrain(deg, 0, 30);
61 | kinect.setTilt(deg);
62 | } else if (keyCode == DOWN) {
63 | deg--;
64 | deg = constrain(deg, 0, 30);
65 | kinect.setTilt(deg);
66 | }
67 | }
68 |
69 | }
--------------------------------------------------------------------------------
/OpenKinect-Processing/lib/jna.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/jna.jar
--------------------------------------------------------------------------------
/OpenKinect-Processing/lib/v1/linux-armv6hf/libfreenect.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v1/linux-armv6hf/libfreenect.so
--------------------------------------------------------------------------------
/OpenKinect-Processing/lib/v1/linux/libfreenect.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v1/linux/libfreenect.a
--------------------------------------------------------------------------------
/OpenKinect-Processing/lib/v1/linux/libfreenect.so:
--------------------------------------------------------------------------------
1 | libfreenect.so.0.5
--------------------------------------------------------------------------------
/OpenKinect-Processing/lib/v1/linux/libfreenect.so.0.5:
--------------------------------------------------------------------------------
1 | libfreenect.so.0.5.2
--------------------------------------------------------------------------------
/OpenKinect-Processing/lib/v1/linux/libfreenect.so.0.5.2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v1/linux/libfreenect.so.0.5.2
--------------------------------------------------------------------------------
/OpenKinect-Processing/lib/v1/mac/libfreenect.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v1/mac/libfreenect.dylib
--------------------------------------------------------------------------------
/OpenKinect-Processing/lib/v1/mac/libusb-1.0.0.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v1/mac/libusb-1.0.0.dylib
--------------------------------------------------------------------------------
/OpenKinect-Processing/lib/v1/msvc/freenect.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v1/msvc/freenect.dll
--------------------------------------------------------------------------------
/OpenKinect-Processing/lib/v1/msvc/libusb-1.0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v1/msvc/libusb-1.0.dll
--------------------------------------------------------------------------------
/OpenKinect-Processing/lib/v1/msvc/pthreadVC2.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v1/msvc/pthreadVC2.dll
--------------------------------------------------------------------------------
/OpenKinect-Processing/lib/v2/linux/libfreenect2.so:
--------------------------------------------------------------------------------
1 | libfreenect2.so.0.2
--------------------------------------------------------------------------------
/OpenKinect-Processing/lib/v2/linux/libfreenect2.so.0.2:
--------------------------------------------------------------------------------
1 | libfreenect2.so.0.2.0
--------------------------------------------------------------------------------
/OpenKinect-Processing/lib/v2/linux/libfreenect2.so.0.2.0:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v2/linux/libfreenect2.so.0.2.0
--------------------------------------------------------------------------------
/OpenKinect-Processing/lib/v2/linux/libturbojpeg.so.0:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v2/linux/libturbojpeg.so.0
--------------------------------------------------------------------------------
/OpenKinect-Processing/lib/v2/linux/libturbojpeg.so.0.1.0:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v2/linux/libturbojpeg.so.0.1.0
--------------------------------------------------------------------------------
/OpenKinect-Processing/lib/v2/mac/libJNILibfreenect2.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v2/mac/libJNILibfreenect2.dylib
--------------------------------------------------------------------------------
/OpenKinect-Processing/lib/v2/mac/libturbojpeg.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v2/mac/libturbojpeg.a
--------------------------------------------------------------------------------
/OpenKinect-Processing/lib/v2/mac/libturbojpeg.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v2/mac/libturbojpeg.dylib
--------------------------------------------------------------------------------
/OpenKinect-Processing/lib/v2/mac/libusb-1.0.0.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v2/mac/libusb-1.0.0.dylib
--------------------------------------------------------------------------------
/OpenKinect-Processing/lib/v2/msvc/OpenCL.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v2/msvc/OpenCL.lib
--------------------------------------------------------------------------------
/OpenKinect-Processing/lib/v2/msvc/libJNILibfreenect2.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v2/msvc/libJNILibfreenect2.dll
--------------------------------------------------------------------------------
/OpenKinect-Processing/lib/v2/msvc/libusb-1.0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v2/msvc/libusb-1.0.dll
--------------------------------------------------------------------------------
/OpenKinect-Processing/lib/v2/msvc/libusb-1.0.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v2/msvc/libusb-1.0.lib
--------------------------------------------------------------------------------
/OpenKinect-Processing/lib/v2/msvc/turbojpeg.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v2/msvc/turbojpeg.dll
--------------------------------------------------------------------------------
/OpenKinect-Processing/lib/v2/msvc/turbojpeg.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v2/msvc/turbojpeg.lib
--------------------------------------------------------------------------------
/OpenKinect-Processing/resources/README.md:
--------------------------------------------------------------------------------
1 | ## How to install ##library.name##
2 |
3 | ### Install with the Contribution Manager
4 |
5 | Add contributed libraries by selecting the menu item _Sketch_ → _Import Library..._ → _Add Library..._ This will open the Contribution Manager, where you can browse for ##library.name##, or any other library you want to install.
6 |
7 | Not all available libraries have been converted to show up in this menu. If a library isn't there, it will need to be installed manually by following the instructions below.
8 |
9 | ### Manual Install
10 |
11 | Contributed libraries may be downloaded separately and manually placed within the `libraries` folder of your Processing sketchbook. To find (and change) the Processing sketchbook location on your computer, open the Preferences window from the Processing application (PDE) and look for the "Sketchbook location" item at the top.
12 |
13 | By default the following locations are used for your sketchbook folder:
14 | * For Mac users, the sketchbook folder is located inside `~/Documents/Processing`
15 | * For Windows users, the sketchbook folder is located inside `My Documents/Processing`
16 |
17 | Download ##library.name## from ##library.url##
18 |
19 | Unzip and copy the contributed library's folder into the `libraries` folder in the Processing sketchbook. You will need to create this `libraries` folder if it does not exist.
20 |
21 | The folder structure for library ##library.name## should be as follows:
22 |
23 | ```
24 | Processing
25 | libraries
26 | ##library.name##
27 | examples
28 | library
29 | ##library.name##.jar
30 | reference
31 | src
32 | ```
33 |
34 | Some folders like `examples` or `src` might be missing. After library ##library.name## has been successfully installed, restart the Processing application.
35 |
36 | ### Troubleshooting
37 |
38 | If you're having trouble, have a look at the [Processing Wiki](https://github.com/processing/processing/wiki/How-to-Install-a-Contributed-Library) for more information, or contact the author [##author.name##](##author.url##).
39 |
--------------------------------------------------------------------------------
/OpenKinect-Processing/resources/code/.gitignore:
--------------------------------------------------------------------------------
1 | /jna.jar
2 | /libJNILibfreenect2.dylib
3 | /libfreenect.dylib
4 | /libturbojpeg.a
5 | /libturbojpeg.dylib
6 | /libusb-1.0.0.dylib
7 | /usb-1.0.0-superspeed.a
8 |
--------------------------------------------------------------------------------
/OpenKinect-Processing/resources/code/ExampleTaglet.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/resources/code/ExampleTaglet.class
--------------------------------------------------------------------------------
/OpenKinect-Processing/resources/code/ant-contrib-1.0b3.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/resources/code/ant-contrib-1.0b3.jar
--------------------------------------------------------------------------------
/OpenKinect-Processing/resources/code/doc.sh:
--------------------------------------------------------------------------------
1 | # a shell script to create a java documentation
2 | # for a processing library.
3 | #
4 | # make changes to the variables below so they
5 | # fit the structure of your library
6 |
7 | # the package name of your library
8 | package=template;
9 |
10 | # source folder location
11 | src=../src;
12 |
13 | # the destination folder of your documentation
14 | dest=../documentation;
15 |
16 |
17 | # compile the java documentation
18 | javadoc -d $dest -stylesheetfile ./stylesheet.css -sourcepath ${src} ${package}
19 |
--------------------------------------------------------------------------------
/OpenKinect-Processing/src/org/openkinect/freenect/Context.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of the OpenKinect Project. http://www.openkinect.org
3 | *
4 | * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file
5 | * for details.
6 | *
7 | * This code is licensed to you under the terms of the Apache License, version
8 | * 2.0, or, at your option, the terms of the GNU General Public License,
9 | * version 2.0. See the APACHE20 and GPL20 files for the text of the licenses,
10 | * or the following URLs:
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/gpl-2.0.txt
13 | *
14 | * If you redistribute this file in source form, modified or unmodified,
15 | * you may:
16 | * 1) Leave this header intact and distribute it under the same terms,
17 | * accompanying it with the APACHE20 and GPL20 files, or
18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL20 file, or
19 | * 3) Delete the GPL v2.0 clause and accompany it with the APACHE20 file
20 | * In all cases you must keep the copyright notice intact and include a copy
21 | * of the CONTRIB file.
22 | * Binary distributions must follow the binary distribution requirements of
23 | * either License.
24 | */
25 | package org.openkinect.freenect;
26 |
27 | public interface Context {
28 | int numDevices();
29 | void setLogHandler(LogHandler handler);
30 | void setLogLevel(LogLevel level);
31 | Device openDevice(int index);
32 | void shutdown();
33 | }
34 |
--------------------------------------------------------------------------------
/OpenKinect-Processing/src/org/openkinect/freenect/DepthFormat.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of the OpenKinect Project. http://www.openkinect.org
3 | *
4 | * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file
5 | * for details.
6 | *
7 | * This code is licensed to you under the terms of the Apache License, version
8 | * 2.0, or, at your option, the terms of the GNU General Public License,
9 | * version 2.0. See the APACHE20 and GPL20 files for the text of the licenses,
10 | * or the following URLs:
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/gpl-2.0.txt
13 | *
14 | * If you redistribute this file in source form, modified or unmodified,
15 | * you may:
16 | * 1) Leave this header intact and distribute it under the same terms,
17 | * accompanying it with the APACHE20 and GPL20 files, or
18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL20 file, or
19 | * 3) Delete the GPL v2.0 clause and accompany it with the APACHE20 file
20 | * In all cases you must keep the copyright notice intact and include a copy
21 | * of the CONTRIB file.
22 | * Binary distributions must follow the binary distribution requirements of
23 | * either License.
24 | */
25 | package org.openkinect.freenect;
26 |
27 | import java.util.HashMap;
28 | import java.util.Map;
29 |
30 | public enum DepthFormat {
31 | D11BIT(0),
32 | D10BIT(1),
33 | D11BIT_PACKED(2),
34 | D10BIT_PACKED(3),
35 | REGISTERED(4),
36 | MM(5);
37 |
38 | private final int value;
39 | private static final Map MAP = new HashMap(6);
40 | static {
41 | for(DepthFormat v : DepthFormat.values()) {
42 | MAP.put(v.intValue(), v);
43 | }
44 | }
45 |
46 | private DepthFormat(int value) {
47 | this.value = value;
48 | }
49 |
50 | public int intValue() {
51 | return value;
52 | }
53 |
54 | public static DepthFormat fromInt(int value) {
55 | return MAP.get(value);
56 | }
57 | }
--------------------------------------------------------------------------------
/OpenKinect-Processing/src/org/openkinect/freenect/DepthHandler.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of the OpenKinect Project. http://www.openkinect.org
3 | *
4 | * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file
5 | * for details.
6 | *
7 | * This code is licensed to you under the terms of the Apache License, version
8 | * 2.0, or, at your option, the terms of the GNU General Public License,
9 | * version 2.0. See the APACHE20 and GPL20 files for the text of the licenses,
10 | * or the following URLs:
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/gpl-2.0.txt
13 | *
14 | * If you redistribute this file in source form, modified or unmodified,
15 | * you may:
16 | * 1) Leave this header intact and distribute it under the same terms,
17 | * accompanying it with the APACHE20 and GPL20 files, or
18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL20 file, or
19 | * 3) Delete the GPL v2.0 clause and accompany it with the APACHE20 file
20 | * In all cases you must keep the copyright notice intact and include a copy
21 | * of the CONTRIB file.
22 | * Binary distributions must follow the binary distribution requirements of
23 | * either License.
24 | */
25 | package org.openkinect.freenect;
26 |
27 | import java.nio.ByteBuffer;
28 |
29 | public interface DepthHandler {
30 | void onFrameReceived(FrameMode mode, ByteBuffer frame, int timestamp);
31 | }
--------------------------------------------------------------------------------
/OpenKinect-Processing/src/org/openkinect/freenect/Device.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of the OpenKinect Project. http://www.openkinect.org
3 | *
4 | * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file
5 | * for details.
6 | *
7 | * This code is licensed to you under the terms of the Apache License, version
8 | * 2.0, or, at your option, the terms of the GNU General Public License,
9 | * version 2.0. See the APACHE20 and GPL20 files for the text of the licenses,
10 | * or the following URLs:
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/gpl-2.0.txt
13 | *
14 | * If you redistribute this file in source form, modified or unmodified,
15 | * you may:
16 | * 1) Leave this header intact and distribute it under the same terms,
17 | * accompanying it with the APACHE20 and GPL20 files, or
18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL20 file, or
19 | * 3) Delete the GPL v2.0 clause and accompany it with the APACHE20 file
20 | * In all cases you must keep the copyright notice intact and include a copy
21 | * of the CONTRIB file.
22 | * Binary distributions must follow the binary distribution requirements of
23 | * either License.
24 | */
25 | package org.openkinect.freenect;
26 |
27 | public interface Device {
28 | double[] getAccel();
29 | int setLed(LedStatus status);
30 | void refreshTiltState();
31 | double getTiltAngle();
32 | int setTiltAngle(double angle);
33 | TiltStatus getTiltStatus();
34 | void setDepthFormat(DepthFormat fmt);
35 | void setVideoFormat(VideoFormat fmt);
36 | void setDepthFormat(DepthFormat fmt, Resolution res);
37 | void setVideoFormat(VideoFormat fmt, Resolution res);
38 | FrameMode getDepthMode();
39 | FrameMode getVideoMode();
40 | int startDepth(DepthHandler handler);
41 | int startVideo(VideoHandler handler);
42 | int stopDepth();
43 | int stopVideo();
44 | void close();
45 | public abstract int getDeviceIndex();
46 | }
--------------------------------------------------------------------------------
/OpenKinect-Processing/src/org/openkinect/freenect/DeviceFlags.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of the OpenKinect Project. http://www.openkinect.org
3 | *
4 | * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file
5 | * for details.
6 | *
7 | * This code is licensed to you under the terms of the Apache License, version
8 | * 2.0, or, at your option, the terms of the GNU General Public License,
9 | * version 2.0. See the APACHE20 and GPL20 files for the text of the licenses,
10 | * or the following URLs:
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/gpl-2.0.txt
13 | *
14 | * If you redistribute this file in source form, modified or unmodified,
15 | * you may:
16 | * 1) Leave this header intact and distribute it under the same terms,
17 | * accompanying it with the APACHE20 and GPL20 files, or
18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL20 file, or
19 | * 3) Delete the GPL v2.0 clause and accompany it with the APACHE20 file
20 | * In all cases you must keep the copyright notice intact and include a copy
21 | * of the CONTRIB file.
22 | * Binary distributions must follow the binary distribution requirements of
23 | * either License.
24 | */
25 | package org.openkinect.freenect;
26 |
27 | public enum DeviceFlags {
28 | MOTOR(1),
29 | CAMERA(2),
30 | AUDIO(4);
31 |
32 | private final int value;
33 |
34 | private DeviceFlags(int value) {
35 | this.value = value;
36 | }
37 |
38 | public int intValue() {
39 | return value;
40 | }
41 | }
--------------------------------------------------------------------------------
/OpenKinect-Processing/src/org/openkinect/freenect/FrameMode.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of the OpenKinect Project. http://www.openkinect.org
3 | *
4 | * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file
5 | * for details.
6 | *
7 | * This code is licensed to you under the terms of the Apache License, version
8 | * 2.0, or, at your option, the terms of the GNU General Public License,
9 | * version 2.0. See the APACHE20 and GPL20 files for the text of the licenses,
10 | * or the following URLs:
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/gpl-2.0.txt
13 | *
14 | * If you redistribute this file in source form, modified or unmodified,
15 | * you may:
16 | * 1) Leave this header intact and distribute it under the same terms,
17 | * accompanying it with the APACHE20 and GPL20 files, or
18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL20 file, or
19 | * 3) Delete the GPL v2.0 clause and accompany it with the APACHE20 file
20 | * In all cases you must keep the copyright notice intact and include a copy
21 | * of the CONTRIB file.
22 | * Binary distributions must follow the binary distribution requirements of
23 | * either License.
24 | */
25 | package org.openkinect.freenect;
26 |
27 | import com.sun.jna.Structure;
28 | import java.util.List;
29 | import java.util.Arrays;
30 |
31 | public class FrameMode extends Structure {
32 | /* All fields are public because Structure requires it.
33 | However, fields should NOT be altered by external code. */
34 | public int reserved;
35 | public int resolution;
36 | public int format;
37 | public int bytes;
38 | public short width, height;
39 | public byte dataBitsPerPixel, paddingBitsPerPixel;
40 | public byte framerate, valid;
41 |
42 | public FrameMode() {
43 | valid = 0;
44 | }
45 |
46 | protected List getFieldOrder() {
47 | return Arrays.asList(new String[] {"reserved", "resolution", "format",
48 | "bytes", "width", "height", "dataBitsPerPixel",
49 | "paddingBitsPerPixel", "framerate", "valid"});
50 | }
51 |
52 | public Resolution getResolution() {
53 | return Resolution.fromInt(resolution);
54 | }
55 |
56 | public DepthFormat getDepthFormat() {
57 | return DepthFormat.fromInt(format);
58 | }
59 |
60 | public VideoFormat getVideoFormat() {
61 | return VideoFormat.fromInt(format);
62 | }
63 |
64 | public int getFrameSize() {
65 | return bytes;
66 | }
67 |
68 | public short getWidth() {
69 | return width;
70 | }
71 |
72 | public short getHeight() {
73 | return height;
74 | }
75 |
76 | public int getFrameRate() {
77 | return framerate;
78 | }
79 |
80 | public boolean isValid() {
81 | return (valid != 0);
82 | }
83 |
84 | public static class ByValue extends FrameMode implements Structure.ByValue { }
85 | }
86 |
--------------------------------------------------------------------------------
/OpenKinect-Processing/src/org/openkinect/freenect/LedStatus.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of the OpenKinect Project. http://www.openkinect.org
3 | *
4 | * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file
5 | * for details.
6 | *
7 | * This code is licensed to you under the terms of the Apache License, version
8 | * 2.0, or, at your option, the terms of the GNU General Public License,
9 | * version 2.0. See the APACHE20 and GPL20 files for the text of the licenses,
10 | * or the following URLs:
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/gpl-2.0.txt
13 | *
14 | * If you redistribute this file in source form, modified or unmodified,
15 | * you may:
16 | * 1) Leave this header intact and distribute it under the same terms,
17 | * accompanying it with the APACHE20 and GPL20 files, or
18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL20 file, or
19 | * 3) Delete the GPL v2.0 clause and accompany it with the APACHE20 file
20 | * In all cases you must keep the copyright notice intact and include a copy
21 | * of the CONTRIB file.
22 | * Binary distributions must follow the binary distribution requirements of
23 | * either License.
24 | */
25 | package org.openkinect.freenect;
26 |
27 | import java.util.HashMap;
28 | import java.util.Map;
29 |
30 | public enum LedStatus {
31 | OFF(0),
32 | GREEN(1),
33 | RED(2),
34 | YELLOW(3),
35 | BLINK_YELLOW(4),
36 | BLINK_GREEN(5),
37 | BLINK_RED_YELLOW(6);
38 |
39 | private final int value;
40 | private static final Map MAP = new HashMap(7);
41 | static {
42 | for(LedStatus v : LedStatus.values()) {
43 | MAP.put(v.intValue(), v);
44 | }
45 | }
46 |
47 | private LedStatus(int value) {
48 | this.value = value;
49 | }
50 |
51 | public int intValue() {
52 | return value;
53 | }
54 |
55 | public static LedStatus fromInt(int value) {
56 | return MAP.get(value);
57 | }
58 | }
--------------------------------------------------------------------------------
/OpenKinect-Processing/src/org/openkinect/freenect/LogHandler.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of the OpenKinect Project. http://www.openkinect.org
3 | *
4 | * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file
5 | * for details.
6 | *
7 | * This code is licensed to you under the terms of the Apache License, version
8 | * 2.0, or, at your option, the terms of the GNU General Public License,
9 | * version 2.0. See the APACHE20 and GPL20 files for the text of the licenses,
10 | * or the following URLs:
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/gpl-2.0.txt
13 | *
14 | * If you redistribute this file in source form, modified or unmodified,
15 | * you may:
16 | * 1) Leave this header intact and distribute it under the same terms,
17 | * accompanying it with the APACHE20 and GPL20 files, or
18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL20 file, or
19 | * 3) Delete the GPL v2.0 clause and accompany it with the APACHE20 file
20 | * In all cases you must keep the copyright notice intact and include a copy
21 | * of the CONTRIB file.
22 | * Binary distributions must follow the binary distribution requirements of
23 | * either License.
24 | */
25 | package org.openkinect.freenect;
26 |
27 | public interface LogHandler {
28 | void onMessage(Device dev, LogLevel level, String msg);
29 | }
--------------------------------------------------------------------------------
/OpenKinect-Processing/src/org/openkinect/freenect/LogLevel.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of the OpenKinect Project. http://www.openkinect.org
3 | *
4 | * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file
5 | * for details.
6 | *
7 | * This code is licensed to you under the terms of the Apache License, version
8 | * 2.0, or, at your option, the terms of the GNU General Public License,
9 | * version 2.0. See the APACHE20 and GPL20 files for the text of the licenses,
10 | * or the following URLs:
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/gpl-2.0.txt
13 | *
14 | * If you redistribute this file in source form, modified or unmodified,
15 | * you may:
16 | * 1) Leave this header intact and distribute it under the same terms,
17 | * accompanying it with the APACHE20 and GPL20 files, or
18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL20 file, or
19 | * 3) Delete the GPL v2.0 clause and accompany it with the APACHE20 file
20 | * In all cases you must keep the copyright notice intact and include a copy
21 | * of the CONTRIB file.
22 | * Binary distributions must follow the binary distribution requirements of
23 | * either License.
24 | */
25 | package org.openkinect.freenect;
26 |
27 | import java.util.HashMap;
28 | import java.util.Map;
29 |
30 | public enum LogLevel {
31 | FATAL(0),
32 | ERROR(1),
33 | WARNING(2),
34 | NOTICE(3),
35 | INFO(4),
36 | DEBUG(5),
37 | SPEW(6),
38 | FLOOD(7);
39 |
40 | private final int value;
41 | private static final Map MAP = new HashMap(8);
42 | static {
43 | for(LogLevel v : LogLevel.values()) {
44 | MAP.put(v.intValue(), v);
45 | }
46 | }
47 |
48 | private LogLevel(int value) {
49 | this.value = value;
50 | }
51 |
52 | public int intValue() {
53 | return value;
54 | }
55 |
56 | public static LogLevel fromInt(int value) {
57 | return MAP.get(value);
58 | }
59 | }
--------------------------------------------------------------------------------
/OpenKinect-Processing/src/org/openkinect/freenect/Resolution.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of the OpenKinect Project. http://www.openkinect.org
3 | *
4 | * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file
5 | * for details.
6 | *
7 | * This code is licensed to you under the terms of the Apache License, version
8 | * 2.0, or, at your option, the terms of the GNU General Public License,
9 | * version 2.0. See the APACHE20 and GPL20 files for the text of the licenses,
10 | * or the following URLs:
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/gpl-2.0.txt
13 | *
14 | * If you redistribute this file in source form, modified or unmodified,
15 | * you may:
16 | * 1) Leave this header intact and distribute it under the same terms,
17 | * accompanying it with the APACHE20 and GPL20 files, or
18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL20 file, or
19 | * 3) Delete the GPL v2.0 clause and accompany it with the APACHE20 file
20 | * In all cases you must keep the copyright notice intact and include a copy
21 | * of the CONTRIB file.
22 | * Binary distributions must follow the binary distribution requirements of
23 | * either License.
24 | */
25 | package org.openkinect.freenect;
26 |
27 | import java.util.HashMap;
28 | import java.util.Map;
29 |
30 | public enum Resolution {
31 | LOW(0),
32 | MEDIUM(1),
33 | HIGH(2);
34 |
35 | private final int value;
36 | private static final Map MAP = new HashMap(3);
37 | static {
38 | for(Resolution v : Resolution.values()) {
39 | MAP.put(v.intValue(), v);
40 | }
41 | }
42 |
43 | private Resolution(int value) {
44 | this.value = value;
45 | }
46 |
47 | public int intValue() {
48 | return value;
49 | }
50 |
51 | public static Resolution fromInt(int value) {
52 | return MAP.get(value);
53 | }
54 | }
--------------------------------------------------------------------------------
/OpenKinect-Processing/src/org/openkinect/freenect/TiltStatus.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of the OpenKinect Project. http://www.openkinect.org
3 | *
4 | * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file
5 | * for details.
6 | *
7 | * This code is licensed to you under the terms of the Apache License, version
8 | * 2.0, or, at your option, the terms of the GNU General Public License,
9 | * version 2.0. See the APACHE20 and GPL20 files for the text of the licenses,
10 | * or the following URLs:
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/gpl-2.0.txt
13 | *
14 | * If you redistribute this file in source form, modified or unmodified,
15 | * you may:
16 | * 1) Leave this header intact and distribute it under the same terms,
17 | * accompanying it with the APACHE20 and GPL20 files, or
18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL20 file, or
19 | * 3) Delete the GPL v2.0 clause and accompany it with the APACHE20 file
20 | * In all cases you must keep the copyright notice intact and include a copy
21 | * of the CONTRIB file.
22 | * Binary distributions must follow the binary distribution requirements of
23 | * either License.
24 | */
25 | package org.openkinect.freenect;
26 |
27 | import java.util.HashMap;
28 | import java.util.Map;
29 |
30 | public enum TiltStatus {
31 | STOPPED(0),
32 | LIMIT(1),
33 | MOVING(4);
34 |
35 | private final int value;
36 | private static final Map MAP = new HashMap(3);
37 | static {
38 | for(TiltStatus v : TiltStatus.values()) {
39 | MAP.put(v.intValue(), v);
40 | }
41 | }
42 |
43 | private TiltStatus(int value) {
44 | this.value = value;
45 | }
46 |
47 | public int intValue() {
48 | return value;
49 | }
50 |
51 | public static TiltStatus fromInt(int value) {
52 | return MAP.get(value);
53 | }
54 | }
--------------------------------------------------------------------------------
/OpenKinect-Processing/src/org/openkinect/freenect/VideoFormat.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of the OpenKinect Project. http://www.openkinect.org
3 | *
4 | * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file
5 | * for details.
6 | *
7 | * This code is licensed to you under the terms of the Apache License, version
8 | * 2.0, or, at your option, the terms of the GNU General Public License,
9 | * version 2.0. See the APACHE20 and GPL20 files for the text of the licenses,
10 | * or the following URLs:
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/gpl-2.0.txt
13 | *
14 | * If you redistribute this file in source form, modified or unmodified,
15 | * you may:
16 | * 1) Leave this header intact and distribute it under the same terms,
17 | * accompanying it with the APACHE20 and GPL20 files, or
18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL20 file, or
19 | * 3) Delete the GPL v2.0 clause and accompany it with the APACHE20 file
20 | * In all cases you must keep the copyright notice intact and include a copy
21 | * of the CONTRIB file.
22 | * Binary distributions must follow the binary distribution requirements of
23 | * either License.
24 | */
25 | package org.openkinect.freenect;
26 |
27 | import java.util.HashMap;
28 | import java.util.Map;
29 |
30 | public enum VideoFormat {
31 | RGB(0),
32 | BAYER(1),
33 | IR_8BIT(2),
34 | IR_10BIT(3),
35 | IR_10BIT_PACKED(4),
36 | YUV_RGB(5),
37 | YUV_RAW(6);
38 |
39 | private final int value;
40 | private static final Map MAP = new HashMap(7);
41 | static {
42 | for(VideoFormat v : VideoFormat.values()) {
43 | MAP.put(v.intValue(), v);
44 | }
45 | }
46 |
47 | private VideoFormat(int value) {
48 | this.value = value;
49 | }
50 |
51 | public int intValue() {
52 | return value;
53 | }
54 |
55 | public static VideoFormat fromInt(int value) {
56 | return MAP.get(value);
57 | }
58 | }
--------------------------------------------------------------------------------
/OpenKinect-Processing/src/org/openkinect/freenect/VideoHandler.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of the OpenKinect Project. http://www.openkinect.org
3 | *
4 | * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file
5 | * for details.
6 | *
7 | * This code is licensed to you under the terms of the Apache License, version
8 | * 2.0, or, at your option, the terms of the GNU General Public License,
9 | * version 2.0. See the APACHE20 and GPL20 files for the text of the licenses,
10 | * or the following URLs:
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/gpl-2.0.txt
13 | *
14 | * If you redistribute this file in source form, modified or unmodified,
15 | * you may:
16 | * 1) Leave this header intact and distribute it under the same terms,
17 | * accompanying it with the APACHE20 and GPL20 files, or
18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL20 file, or
19 | * 3) Delete the GPL v2.0 clause and accompany it with the APACHE20 file
20 | * In all cases you must keep the copyright notice intact and include a copy
21 | * of the CONTRIB file.
22 | * Binary distributions must follow the binary distribution requirements of
23 | * either License.
24 | */
25 | package org.openkinect.freenect;
26 |
27 | import java.nio.ByteBuffer;
28 |
29 | public interface VideoHandler {
30 | void onFrameReceived(FrameMode mode, ByteBuffer frame, int timestamp);
31 | }
--------------------------------------------------------------------------------
/OpenKinect-Processing/src/org/openkinect/processing/Kinect2.java:
--------------------------------------------------------------------------------
1 | package org.openkinect.processing;
2 |
3 | import org.openkinect.freenect2.Device;
4 |
5 | import processing.core.PApplet;
6 |
7 | /*
8 | openKinect2 library for Processing
9 | Copyright (c) 2014 Thomas Sanchez Lengeling
10 |
11 | * Redistribution and use in source and binary forms, with or
12 | * without modification, are permitted provided that the following
13 | * conditions are met:
14 | *
15 | * Redistributions of source code must retain the above copyright
16 | * notice, this list of conditions and the following disclaimer.
17 | * Redistributions in binary form must reproduce the above copyright
18 | * notice, this list of conditions and the following disclaimer in
19 | * the documentation and/or other materials provided with the
20 | * distribution.
21 | *
22 |
23 | openKinect2 library for Processing is free software: you can redistribute it and/or
24 | modify it under the terms of the GNU General Public License as published by
25 | the Free Software Foundation, either version 3 of the License, or
26 | (at your option) any later version.
27 |
28 | openKinect2 for Processing is distributed in the hope that it will be
29 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
30 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 | GNU General Public License for more details.
32 |
33 | You should have received a copy of the GNU General Public License
34 | along with openKinect2 library for Processing. If not, see
35 | .
36 | */
37 |
38 | public class Kinect2 extends Device{
39 |
40 | public static PApplet parent;
41 |
42 | public Kinect2(PApplet _p) {
43 | super(_p);
44 | parent = _p;
45 |
46 | parent.registerMethod("dispose", this);
47 | }
48 |
49 |
50 | public void dispose() {
51 | System.out.println("EXIT");
52 | stopDevice();
53 | }
54 |
55 |
56 | }
--------------------------------------------------------------------------------
/OpenKinect-Processing/src/org/openkinect/processing/LibraryPath.java:
--------------------------------------------------------------------------------
1 | /* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2 |
3 | /*
4 | Part of the Processing project - http://processing.org
5 |
6 | Copyright (c) 2011-12 Ben Fry and Casey Reas
7 |
8 | This library is free software; you can redistribute it and/or
9 | modify it under the terms of the GNU Lesser General Public
10 | License as published by the Free Software Foundation; either
11 | version 2.1 of the License, or (at your option) any later version.
12 |
13 | This library is distributed in the hope that it will be useful,
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | Lesser General Public License for more details.
17 |
18 | You should have received a copy of the GNU Lesser General
19 | Public License along with this library; if not, write to the
20 | Free Software Foundation, Inc., 59 Temple Place, Suite 330,
21 | Boston, MA 02111-1307 USA
22 | */
23 |
24 | package org.openkinect.processing;
25 |
26 | import java.io.File;
27 | import java.net.URISyntaxException;
28 | import java.net.URL;
29 | import java.security.CodeSource;
30 |
31 | import com.sun.jna.Platform;
32 |
33 | public class LibraryPath {
34 | // This method returns the folder inside which the gstreamer library folder
35 | // is located.
36 | public String get() {
37 | URL url = this.getClass().getResource("LibraryPath.class");
38 |
39 | if (url != null) {
40 | // Convert URL to string, taking care of spaces represented by the "%20"
41 | // string.
42 | String path = url.toString().replace("%20", " ");
43 | int n0 = path.indexOf('/');
44 |
45 | int n1 = -1;
46 |
47 | if (Platform.isLinux()) {
48 | return "";
49 | } else {
50 | n1 = path.indexOf("openkinect_processing.jar");
51 | if (Platform.isWindows()) {
52 | // In Windows, path string starts with "jar file/C:/..."
53 | // so the substring up to the first / is removed.
54 | n0++;
55 | }
56 | }
57 |
58 | if ((-1 < n0) && (-1 < n1)) {
59 | return path.substring(n0, n1);
60 | } else {
61 | return "";
62 | }
63 | }
64 | return "";
65 | }
66 |
67 | public String getDir(){
68 | CodeSource codeSource = LibraryPath.class.getProtectionDomain().getCodeSource();
69 | String jarDir = "";
70 | try {
71 | File jarFile = new File(codeSource.getLocation().toURI().getPath());
72 | jarDir = jarFile.getParentFile().getPath();
73 | } catch (URISyntaxException e) {
74 | // TODO Auto-generated catch block
75 | e.printStackTrace();
76 | }
77 | return jarDir;
78 | }
79 |
80 | }
--------------------------------------------------------------------------------
/OpenKinect-Processing/src/org/openkinect/processing/RGBImage.java:
--------------------------------------------------------------------------------
1 | package org.openkinect.processing;
2 |
3 | import java.nio.ByteBuffer;
4 | import processing.core.PImage;
5 |
6 | class RGBImage {
7 |
8 | static void data(ByteBuffer data, PImage img, boolean irMode, boolean mirrorMode) {
9 | if(mirrorMode){ //mirror enable
10 | if (irMode) {
11 | for(int y=0; y= minDepth && rawDepth[i] <= maxDepth) {
57 | depthImg.pixels[i] = color(255);
58 | } else {
59 | depthImg.pixels[i] = color(0);
60 | }
61 | }
62 |
63 |
64 | // Draw the thresholded image
65 | depthImg.updatePixels();
66 | image(depthImg, kinect2.depthWidth, 0);
67 |
68 | fill(0);
69 | text("TILT: " + angle, 10, 20);
70 | text("THRESHOLD: [" + minDepth + ", " + maxDepth + "]", 10, 36);
71 | }
72 |
73 | // Adjust the angle and the depth threshold min and max
74 | public void keyPressed() {
75 | if (key == 'a') {
76 | minDepth = constrain(minDepth+10000, 0, maxDepth);
77 | } else if (key == 's') {
78 | minDepth = constrain(minDepth-10000, 0, maxDepth);
79 | } else if (key == 'z') {
80 | maxDepth = constrain(maxDepth+10000, minDepth, 1165952918);
81 | } else if (key =='x') {
82 | maxDepth = constrain(maxDepth-10000, minDepth, 1165952918);
83 | }
84 | }
85 | }
--------------------------------------------------------------------------------
/OpenKinect-Processing/src/org/openkinect/tests/FrameTest.java:
--------------------------------------------------------------------------------
1 | package org.openkinect.tests;
2 |
3 | import org.openkinect.processing.Kinect2;
4 |
5 | import processing.core.*;
6 |
7 | public class FrameTest extends PApplet{
8 |
9 | Kinect2 openKinect2;
10 |
11 | public static void main(String[] args) {
12 | PApplet.main(new String[] { "org.openkinect.tests.FrameTest"});
13 | }
14 |
15 | public void settings() {
16 | size(512*3, 424);
17 | }
18 |
19 | public void setup(){
20 | openKinect2 = new Kinect2(this);
21 |
22 | openKinect2.initDepth();
23 | openKinect2.initVideo();
24 | openKinect2.initIR();
25 |
26 | openKinect2.initDevice();
27 |
28 | background(0);
29 | }
30 |
31 |
32 | public void draw(){
33 | background(0);
34 |
35 | PImage depth = openKinect2.getDepthImage();
36 | image(depth, 0, 0);
37 |
38 | PImage ir = openKinect2.getIrImage();
39 | image(ir, 512, 0);
40 |
41 | PImage color = openKinect2.getVideoImage();
42 | image(color, 512*2, 0, 512, 424);
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/OpenKinect-Processing/src/org/openkinect/tests/MultiKinectV1.java:
--------------------------------------------------------------------------------
1 | package org.openkinect.tests;
2 |
3 | import org.openkinect.processing.*;
4 |
5 | import processing.core.*;
6 |
7 | public class MultiKinectV1 extends PApplet{
8 |
9 | private Kinect kinect;
10 |
11 | public static void main(String[] args) {
12 | PApplet.main(new String[] { "org.openkinect.tests.MultiKinectV1"});
13 | }
14 |
15 | public void settings() {
16 | size(512*3, 424*2);
17 | }
18 |
19 |
20 | public void setup(){
21 | kinect = new Kinect(this);
22 | kinect.initVideo();
23 | kinect.initDepth();
24 | }
25 |
26 |
27 | public void draw(){
28 | background(0);
29 |
30 | PImage depth = kinect.getDepthImage();
31 | image(depth, 0, 0);
32 |
33 | PImage rgb = kinect.getVideoImage();
34 | image(rgb, 512*2, 0, 512, 424);
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/OpenKinect-Processing/src/org/openkinect/tests/PointCloudOGL2.java:
--------------------------------------------------------------------------------
1 | package org.openkinect.tests;
2 |
3 | import java.nio.FloatBuffer;
4 |
5 | import org.openkinect.processing.Kinect2;
6 |
7 | import processing.core.*;
8 | import processing.opengl.PGL;
9 | import processing.opengl.PShader;
10 |
11 | public class PointCloudOGL2 extends PApplet{
12 |
13 | Kinect2 kinect2;
14 |
15 | PGL pgl;
16 | PShader sh;
17 |
18 | int vertLoc;
19 |
20 | public static void main(String[] args) {
21 | PApplet.main(new String[] { "org.openkinect.tests.PointCloudOGL2"});
22 | }
23 |
24 | public void settings() {
25 | size(512*2, 424*2, P3D);
26 | }
27 |
28 | public void setup() {
29 | kinect2 = new Kinect2(this);
30 | // Start all data
31 | kinect2.initDepth();
32 | kinect2.initIR();
33 | kinect2.initDevice();
34 |
35 | //System.out.println("Working Directory = " + System.getProperty("user.dir"));
36 | String dir = System.getProperty("user.dir")+"/src/org/openkinect/tests/data/";
37 | sh = loadShader( dir+"frag.glsl", dir+"vert.glsl");
38 | }
39 |
40 |
41 | public void draw() {
42 | background(0);
43 | //image(kinect2.getVideoImage(), 0, 0, width, height);
44 | image(kinect2.getDepthImage(), 0, 0, 320, 240);
45 | image(kinect2.getIrImage(), 0, 320, 320, 240);
46 | fill(255);
47 |
48 | FloatBuffer depthPositions = kinect2.getDepthBufferPositions();
49 |
50 | pgl = beginPGL();
51 | sh.bind();
52 |
53 | vertLoc = pgl.getAttribLocation(sh.glProgram, "vertex");
54 |
55 | //color for each POINT of the point cloud
56 | sh.set("fragColor", 1.0f, 1.0f, 1.0f, 1.0f);
57 |
58 | pgl.enableVertexAttribArray(vertLoc);
59 |
60 | //data size
61 | int vertData = kinect2.depthWidth * kinect2.depthHeight;
62 |
63 | //pgl.vertexAttribPointer(vertLoc, 3, PGL.FLOAT, false, 3 * (Float.SIZE/8), pointCloudBuffer);
64 | // FIXME: Processing 3 switched to using an offset as the last parameter
65 | // "error: incompatible types: FloatBuffer cannot be converted to int"
66 | //pgl.vertexAttribPointer(vertLoc, 3, PGL.FLOAT, false, 0, depthPositions);
67 | pgl.drawArrays(PGL.POINTS, 0, vertData);
68 |
69 | pgl.disableVertexAttribArray(vertLoc);
70 |
71 | sh.unbind();
72 | endPGL();
73 |
74 |
75 | text("Framerate: " + (int)(frameRate), 10, 515);
76 | }
77 |
78 | }
--------------------------------------------------------------------------------
/OpenKinect-Processing/src/org/openkinect/tests/PointCloudTest.java:
--------------------------------------------------------------------------------
1 | package org.openkinect.tests;
2 |
3 | import org.openkinect.processing.Kinect2;
4 |
5 | import processing.core.*;
6 |
7 | public class PointCloudTest extends PApplet{
8 |
9 | Kinect2 kinect2;
10 |
11 | public static void main(String[] args) {
12 | PApplet.main(new String[] { "org.openkinect.tests.PointCloudTest"});
13 | }
14 |
15 | public void settings() {
16 | size(512*2, 424*2, P3D);
17 | }
18 |
19 | public void setup() {
20 | kinect2 = new Kinect2(this);
21 | // Start all data
22 | kinect2.initDepth();
23 | kinect2.initIR();
24 | kinect2.initDevice();
25 | }
26 |
27 |
28 | public void draw() {
29 | background(0);
30 | //image(kinect2.getVideoImage(), 0, 0, width, height);
31 | image(kinect2.getDepthImage(), 0, 0, 320, 240);
32 | image(kinect2.getIrImage(), 0, 320, 320, 240);
33 | fill(255);
34 |
35 | float [] positions = kinect2.getDepthToCameraPositions();
36 |
37 | pushMatrix();
38 | translate(width/2, height/2, 50);
39 | rotateY(3.1f);
40 | stroke(255);
41 | fill(255);
42 | beginShape(POINTS);
43 | for(int i = 0; i < 424; i++){
44 | for(int j = 0; j < 512; j++){
45 | int index = j + i*512;
46 | float x = positions[index*3 + 0];
47 | float y = positions[index*3 + 1];
48 | float z = positions[index*3 + 2];
49 | vertex(x, y, z);
50 | }
51 | }
52 | endShape();
53 | popMatrix();
54 |
55 | text("Framerate: " + (int)(frameRate), 10, 515);
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/OpenKinect-Processing/src/org/openkinect/tests/RGBDepthTest2.java:
--------------------------------------------------------------------------------
1 | package org.openkinect.tests;
2 |
3 | import org.openkinect.processing.Kinect2;
4 |
5 | import processing.core.*;
6 |
7 | public class RGBDepthTest2 extends PApplet{
8 |
9 | Kinect2 kinect2;
10 |
11 | public static void main(String[] args) {
12 | PApplet.main(new String[] { "org.openkinect.tests.RGBDepthTest2"});
13 | }
14 |
15 | public void settings() {
16 | size(512*2, 424*2, P2D);
17 | }
18 |
19 | public void setup() {
20 | kinect2 = new Kinect2(this);
21 | // Start all data
22 | kinect2.initVideo();
23 | kinect2.initDepth();
24 | kinect2.initIR();
25 | kinect2.initRegistered();
26 | kinect2.initDevice();
27 | }
28 |
29 |
30 | public void draw() {
31 | background(0);
32 | //image(kinect2.getVideoImage(), 0, 0, width, height);
33 | image(kinect2.getDepthImage(), 0, 0);
34 | image(kinect2.getVideoImage(), kinect2.depthWidth, 0, kinect2.colorWidth*0.25f, kinect2.colorHeight*0.25f);
35 | image(kinect2.getIrImage(), 0, kinect2.depthHeight);
36 | image(kinect2.getRegisteredImage(), kinect2.depthWidth, kinect2.depthHeight);
37 | fill(255);
38 | text("Framerate: " + (int)(frameRate), 10, 515);
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/OpenKinect-Processing/src/org/openkinect/tests/RegisteredTest.java:
--------------------------------------------------------------------------------
1 | package org.openkinect.tests;
2 |
3 | import org.openkinect.processing.Kinect2;
4 |
5 | import processing.core.*;
6 |
7 |
8 | public class RegisteredTest extends PApplet{
9 |
10 | Kinect2 openKinect2;
11 |
12 | public static void main(String[] args) {
13 | PApplet.main(new String[] { "org.openkinect.tests.RegisteredTest"});
14 | }
15 |
16 | public void settings() {
17 | size(512*3, 424*2);
18 | }
19 |
20 |
21 | public void setup(){
22 | openKinect2 = new Kinect2(this);
23 | openKinect2.initRegistered();
24 | openKinect2.initDevice();
25 | }
26 |
27 |
28 | public void draw(){
29 | background(0);
30 |
31 | PImage depth = openKinect2.getDepthImage();
32 | image(depth, 0, 0);
33 |
34 | PImage ir = openKinect2.getIrImage();
35 | image(ir, 512, 0);
36 |
37 | PImage rgb = openKinect2.getVideoImage();
38 | image(rgb, 512*2, 0, 512, 424);
39 |
40 | PImage unregistered = openKinect2.getUndistoredImage();
41 | image(unregistered, 0, 424, 512, 424);
42 |
43 | PImage registered = openKinect2.getRegisteredImage();
44 | image(registered, 512, 424, 512, 424);
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/OpenKinect-Processing/src/org/openkinect/tests/data/frag.glsl:
--------------------------------------------------------------------------------
1 | #ifdef GL_ES
2 | precision mediump float;
3 | precision mediump int;
4 | #endif
5 |
6 | varying vec4 vertColor;
7 |
8 | //input color
9 | uniform vec4 fragColor;
10 |
11 | void main() {
12 |
13 | //outputColor
14 | gl_FragColor = fragColor;
15 | }
--------------------------------------------------------------------------------
/OpenKinect-Processing/src/org/openkinect/tests/data/vert.glsl:
--------------------------------------------------------------------------------
1 | uniform mat4 transform;
2 |
3 | attribute vec4 vertex;
4 | attribute vec4 color;
5 |
6 | varying vec4 vertColor;
7 |
8 | void main() {
9 | gl_Position = transform * vertex;
10 | vertColor = color;
11 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Open Kinect for Processing
2 |
3 | 
4 |
5 | This repository is for for using the Microsoft Kinect sensor with [Processing](http://processing.org). It uses the open source drivers from the [libfreenect](https://github.com/OpenKinect/libfreenect) and [libfreenect2](https://github.com/OpenKinect/libfreenect2) projects.
6 |
7 | ### Documentation and tutorial
8 |
9 | For more, read this [online tutorial](http://shiffman.net/p5/kinect/) or check out the [javadocs](http://shiffman.net/p5/kinect/reference).
10 |
11 | ## Kinect v1 Requirements
12 | - Kinect v1 (supported versions??)
13 | - Kinect v1 power adapter
14 |
15 | #### Linux
16 |
17 | Requirements?
18 | ```sudo apt-get install libusb-1.0-0 libusb-1.0-0-dev```
19 |
20 | #### Windows.
21 |
22 | - Use [Zadig](http://zadig.akeo.ie/) to install the libusbK driver for each device you wish to use. This includes installing the libusbK for all the kinect v1 drivers listed on Zadig GUI.
23 | - If you got the error message 'Isochronous transfer error: 1', you should try downgrade the libusbK using [Older Zadig Version](http://zadig.akeo.ie/downloads/zadig_2.0.1.exe)
24 |
25 | ## Kinect v2 Requirements
26 |
27 | - USB 3.0 Host Controller (NEC Corporation USB 3.0, Intel Chipset)
28 | - Minimum Mac OS X 10.9
29 | - Windows 8 64 bit support
30 | - Kinect v2
31 |
32 | #### Kinect v2 additional software
33 | - For Windows 8, Follow the the [installation of the libusk driver.](https://github.com/OpenKinect/libfreenect2#libusbk-driver)
34 | - First install the Kinect v2 Windows SDK then change the USB 3.0 drivers properties to libusbK using Zadig.
35 | - No longer need to external install [Turbo Jpeg for Mac](http://sourceforge.net/projects/libjpeg-turbo/).
36 |
--------------------------------------------------------------------------------
/build_openKinect2/C++/libs/libTurboJpeg/lib/osx/libturbojpeg.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/C++/libs/libTurboJpeg/lib/osx/libturbojpeg.a
--------------------------------------------------------------------------------
/build_openKinect2/C++/libs/libTurboJpeg/lib/osx/libturbojpeg.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/C++/libs/libTurboJpeg/lib/osx/libturbojpeg.dylib
--------------------------------------------------------------------------------
/build_openKinect2/C++/libs/libusb/include/libusb/hotplug.h:
--------------------------------------------------------------------------------
1 | /* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */
2 | /*
3 | * Hotplug support for libusbx
4 | * Copyright © 2012-2013 Nathan Hjelm
5 | * Copyright © 2012-2013 Peter Stuge
6 | *
7 | * This library is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * This library is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with this library; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #if !defined(USBI_HOTPLUG_H)
23 | #define USBI_HOTPLUG_H
24 |
25 | #ifndef LIBUSBI_H
26 | #include "libusbi.h"
27 | #endif
28 |
29 | /** \ingroup hotplug
30 | * The hotplug callback structure. The user populates this structure with
31 | * libusb_hotplug_prepare_callback() and then calls libusb_hotplug_register_callback()
32 | * to receive notification of hotplug events.
33 | */
34 | struct libusb_hotplug_callback {
35 | /** Context this callback is associated with */
36 | struct libusb_context *ctx;
37 |
38 | /** Vendor ID to match or LIBUSB_HOTPLUG_MATCH_ANY */
39 | int vendor_id;
40 |
41 | /** Product ID to match or LIBUSB_HOTPLUG_MATCH_ANY */
42 | int product_id;
43 |
44 | /** Device class to match or LIBUSB_HOTPLUG_MATCH_ANY */
45 | int dev_class;
46 |
47 | /** Hotplug callback flags */
48 | libusb_hotplug_flag flags;
49 |
50 | /** Event(s) that will trigger this callback */
51 | libusb_hotplug_event events;
52 |
53 | /** Callback function to invoke for matching event/device */
54 | libusb_hotplug_callback_fn cb;
55 |
56 | /** Handle for this callback (used to match on deregister) */
57 | libusb_hotplug_callback_handle handle;
58 |
59 | /** User data that will be passed to the callback function */
60 | void *user_data;
61 |
62 | /** Callback is marked for deletion */
63 | int needs_free;
64 |
65 | /** List this callback is registered in (ctx->hotplug_cbs) */
66 | struct list_head list;
67 | };
68 |
69 | typedef struct libusb_hotplug_callback libusb_hotplug_callback;
70 |
71 | struct libusb_hotplug_message {
72 | libusb_hotplug_event event;
73 | struct libusb_device *device;
74 | };
75 |
76 | typedef struct libusb_hotplug_message libusb_hotplug_message;
77 |
78 | void usbi_hotplug_deregister_all(struct libusb_context *ctx);
79 | void usbi_hotplug_match(struct libusb_context *ctx, struct libusb_device *dev,
80 | libusb_hotplug_event event);
81 |
82 | #endif
83 |
--------------------------------------------------------------------------------
/build_openKinect2/C++/libs/libusb/include/libusb/os/poll_posix.h:
--------------------------------------------------------------------------------
1 | #ifndef LIBUSB_POLL_POSIX_H
2 | #define LIBUSB_POLL_POSIX_H
3 |
4 | #define usbi_write write
5 | #define usbi_read read
6 | #define usbi_close close
7 | #define usbi_poll poll
8 |
9 | int usbi_pipe(int pipefd[2]);
10 |
11 | #endif /* LIBUSB_POLL_POSIX_H */
12 |
--------------------------------------------------------------------------------
/build_openKinect2/C++/libs/libusb/include/libusb/os/threads_posix.h:
--------------------------------------------------------------------------------
1 | /*
2 | * libusbx synchronization using POSIX Threads
3 | *
4 | * Copyright © 2010 Peter Stuge
5 | *
6 | * This library is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * This library is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with this library; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef LIBUSB_THREADS_POSIX_H
22 | #define LIBUSB_THREADS_POSIX_H
23 |
24 | #include
25 |
26 | #define usbi_mutex_static_t pthread_mutex_t
27 | #define USBI_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
28 | #define usbi_mutex_static_lock pthread_mutex_lock
29 | #define usbi_mutex_static_unlock pthread_mutex_unlock
30 |
31 | #define usbi_mutex_t pthread_mutex_t
32 | #define usbi_mutex_init pthread_mutex_init
33 | #define usbi_mutex_lock pthread_mutex_lock
34 | #define usbi_mutex_unlock pthread_mutex_unlock
35 | #define usbi_mutex_trylock pthread_mutex_trylock
36 | #define usbi_mutex_destroy pthread_mutex_destroy
37 |
38 | #define usbi_cond_t pthread_cond_t
39 | #define usbi_cond_init pthread_cond_init
40 | #define usbi_cond_wait pthread_cond_wait
41 | #define usbi_cond_timedwait pthread_cond_timedwait
42 | #define usbi_cond_broadcast pthread_cond_broadcast
43 | #define usbi_cond_destroy pthread_cond_destroy
44 | #define usbi_cond_signal pthread_cond_signal
45 |
46 | extern int usbi_mutex_init_recursive(pthread_mutex_t *mutex, pthread_mutexattr_t *attr);
47 |
48 | int usbi_get_tid(void);
49 |
50 | #endif /* LIBUSB_THREADS_POSIX_H */
51 |
--------------------------------------------------------------------------------
/build_openKinect2/C++/libs/libusb/include/libusb/version.h:
--------------------------------------------------------------------------------
1 | /* This file is parsed by m4 and windres and RC.EXE so please keep it simple. */
2 | #include "version_nano.h"
3 | #ifndef LIBUSB_MAJOR
4 | #define LIBUSB_MAJOR 1
5 | #endif
6 | #ifndef LIBUSB_MINOR
7 | #define LIBUSB_MINOR 0
8 | #endif
9 | #ifndef LIBUSB_MICRO
10 | #define LIBUSB_MICRO 17
11 | #endif
12 | #ifndef LIBUSB_NANO
13 | #define LIBUSB_NANO 0
14 | #endif
15 | /* LIBUSB_RC is the release candidate suffix. Should normally be empty. */
16 | #ifndef LIBUSB_RC
17 | #define LIBUSB_RC ""
18 | #endif
19 |
--------------------------------------------------------------------------------
/build_openKinect2/C++/libs/libusb/include/libusb/version_nano.h:
--------------------------------------------------------------------------------
1 | #define LIBUSB_NANO 10830
2 |
--------------------------------------------------------------------------------
/build_openKinect2/C++/libs/libusb/lib/msvc/libusb-1.0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/C++/libs/libusb/lib/msvc/libusb-1.0.dll
--------------------------------------------------------------------------------
/build_openKinect2/C++/libs/libusb/lib/osx/usb-1.0.0-superspeed.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/C++/libs/libusb/lib/osx/usb-1.0.0-superspeed.a
--------------------------------------------------------------------------------
/build_openKinect2/C++/libs/protonect/include/libfreenect2/config.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the OpenKinect Project. http://www.openkinect.org
3 | *
4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file
5 | * for details.
6 | *
7 | * This code is licensed to you under the terms of the Apache License, version
8 | * 2.0, or, at your option, the terms of the GNU General Public License,
9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses,
10 | * or the following URLs:
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/gpl-2.0.txt
13 | *
14 | * If you redistribute this file in source form, modified or unmodified, you
15 | * may:
16 | * 1) Leave this header intact and distribute it under the same terms,
17 | * accompanying it with the APACHE20 and GPL20 files, or
18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or
19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file
20 | * In all cases you must keep the copyright notice intact and include a copy
21 | * of the CONTRIB file.
22 | *
23 | * Binary distributions must follow the binary distribution requirements of
24 | * either License.
25 | */
26 |
27 | #ifndef LIBFREENECT2_CONFIG_H
28 | #define LIBFREENECT2_CONFIG_H
29 |
30 | #ifdef _MSC_VER
31 | #define LIBFREENECT2_PACK( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop) )
32 | #else
33 | #define LIBFREENECT2_PACK( __Declaration__ ) __Declaration__ __attribute__((__packed__))
34 | #endif
35 |
36 | #ifdef _WIN32
37 | #define LIBFREENECT2_API __declspec(dllexport)
38 | #else
39 | #define LIBFREENECT2_API
40 | #endif
41 |
42 | #define LIBFREENECT2_WITH_OPENGL_SUPPORT
43 |
44 | #define LIBFREENECT2_WITH_OPENCL_SUPPORT
45 |
46 | /* #undef LIBFREENECT2_THREADING_STDLIB */
47 |
48 | #define LIBFREENECT2_THREADING_TINYTHREAD
49 |
50 | #endif // LIBFREENECT2_CONFIG_H
51 |
--------------------------------------------------------------------------------
/build_openKinect2/C++/libs/protonect/include/libfreenect2/config.h.in:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the OpenKinect Project. http://www.openkinect.org
3 | *
4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file
5 | * for details.
6 | *
7 | * This code is licensed to you under the terms of the Apache License, version
8 | * 2.0, or, at your option, the terms of the GNU General Public License,
9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses,
10 | * or the following URLs:
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/gpl-2.0.txt
13 | *
14 | * If you redistribute this file in source form, modified or unmodified, you
15 | * may:
16 | * 1) Leave this header intact and distribute it under the same terms,
17 | * accompanying it with the APACHE20 and GPL20 files, or
18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or
19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file
20 | * In all cases you must keep the copyright notice intact and include a copy
21 | * of the CONTRIB file.
22 | *
23 | * Binary distributions must follow the binary distribution requirements of
24 | * either License.
25 | */
26 |
27 | #ifndef LIBFREENECT2_CONFIG_H
28 | #define LIBFREENECT2_CONFIG_H
29 |
30 | #ifdef _MSC_VER
31 | #define LIBFREENECT2_PACK( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop) )
32 | #else
33 | #define LIBFREENECT2_PACK( __Declaration__ ) __Declaration__ __attribute__((__packed__))
34 | #endif
35 |
36 | #ifdef _WIN32
37 | #define LIBFREENECT2_API __declspec(dllexport)
38 | #else
39 | #define LIBFREENECT2_API
40 | #endif
41 |
42 | #cmakedefine LIBFREENECT2_WITH_OPENGL_SUPPORT
43 |
44 | #cmakedefine LIBFREENECT2_WITH_OPENCL_SUPPORT
45 |
46 | #cmakedefine LIBFREENECT2_THREADING_STDLIB
47 |
48 | #cmakedefine LIBFREENECT2_THREADING_TINYTHREAD
49 |
50 | #endif // LIBFREENECT2_CONFIG_H
51 |
--------------------------------------------------------------------------------
/build_openKinect2/C++/libs/protonect/include/libfreenect2/data_callback.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the OpenKinect Project. http://www.openkinect.org
3 | *
4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file
5 | * for details.
6 | *
7 | * This code is licensed to you under the terms of the Apache License, version
8 | * 2.0, or, at your option, the terms of the GNU General Public License,
9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses,
10 | * or the following URLs:
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/gpl-2.0.txt
13 | *
14 | * If you redistribute this file in source form, modified or unmodified, you
15 | * may:
16 | * 1) Leave this header intact and distribute it under the same terms,
17 | * accompanying it with the APACHE20 and GPL20 files, or
18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or
19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file
20 | * In all cases you must keep the copyright notice intact and include a copy
21 | * of the CONTRIB file.
22 | *
23 | * Binary distributions must follow the binary distribution requirements of
24 | * either License.
25 | */
26 |
27 |
28 | #ifndef DATA_CALLBACK_H_
29 | #define DATA_CALLBACK_H_
30 |
31 | #include
32 | #include
33 |
34 | namespace libfreenect2
35 | {
36 |
37 | class LIBFREENECT2_API DataCallback
38 | {
39 | public:
40 | virtual void onDataReceived(unsigned char *buffer, size_t n) = 0;
41 | };
42 |
43 | } // namespace libfreenect2
44 |
45 | #endif // DATA_CALLBACK_H_
46 |
--------------------------------------------------------------------------------
/build_openKinect2/C++/libs/protonect/include/libfreenect2/depth_packet_stream_parser.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the OpenKinect Project. http://www.openkinect.org
3 | *
4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file
5 | * for details.
6 | *
7 | * This code is licensed to you under the terms of the Apache License, version
8 | * 2.0, or, at your option, the terms of the GNU General Public License,
9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses,
10 | * or the following URLs:
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/gpl-2.0.txt
13 | *
14 | * If you redistribute this file in source form, modified or unmodified, you
15 | * may:
16 | * 1) Leave this header intact and distribute it under the same terms,
17 | * accompanying it with the APACHE20 and GPL20 files, or
18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or
19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file
20 | * In all cases you must keep the copyright notice intact and include a copy
21 | * of the CONTRIB file.
22 | *
23 | * Binary distributions must follow the binary distribution requirements of
24 | * either License.
25 | */
26 |
27 | #ifndef DEPTH_PACKET_STREAM_PARSER_H_
28 | #define DEPTH_PACKET_STREAM_PARSER_H_
29 |
30 | #include
31 | #include
32 |
33 | #include
34 |
35 | #include
36 | #include
37 |
38 | #include
39 |
40 | namespace libfreenect2
41 | {
42 |
43 | LIBFREENECT2_PACK(struct LIBFREENECT2_API DepthSubPacketFooter
44 | {
45 | uint32_t magic0;
46 | uint32_t magic1;
47 | uint32_t timestamp;
48 | uint32_t sequence;
49 | uint32_t subsequence;
50 | uint32_t length;
51 | uint32_t fields[32];
52 | });
53 |
54 | class LIBFREENECT2_API DepthPacketStreamParser : public DataCallback
55 | {
56 | public:
57 | DepthPacketStreamParser();
58 | virtual ~DepthPacketStreamParser();
59 |
60 | void setPacketProcessor(libfreenect2::BaseDepthPacketProcessor *processor);
61 |
62 | virtual void onDataReceived(unsigned char* buffer, size_t length);
63 | private:
64 | libfreenect2::BaseDepthPacketProcessor *processor_;
65 |
66 | libfreenect2::DoubleBuffer buffer_;
67 | libfreenect2::Buffer work_buffer_;
68 |
69 | uint32_t current_sequence_;
70 | uint32_t current_subsequence_;
71 | };
72 |
73 | } /* namespace libfreenect2 */
74 | #endif /* DEPTH_PACKET_STREAM_PARSER_H_ */
75 |
--------------------------------------------------------------------------------
/build_openKinect2/C++/libs/protonect/include/libfreenect2/double_buffer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the OpenKinect Project. http://www.openkinect.org
3 | *
4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file
5 | * for details.
6 | *
7 | * This code is licensed to you under the terms of the Apache License, version
8 | * 2.0, or, at your option, the terms of the GNU General Public License,
9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses,
10 | * or the following URLs:
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/gpl-2.0.txt
13 | *
14 | * If you redistribute this file in source form, modified or unmodified, you
15 | * may:
16 | * 1) Leave this header intact and distribute it under the same terms,
17 | * accompanying it with the APACHE20 and GPL20 files, or
18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or
19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file
20 | * In all cases you must keep the copyright notice intact and include a copy
21 | * of the CONTRIB file.
22 | *
23 | * Binary distributions must follow the binary distribution requirements of
24 | * either License.
25 | */
26 |
27 | #ifndef DOUBLE_BUFFER_H_
28 | #define DOUBLE_BUFFER_H_
29 |
30 | #include
31 | #include
32 |
33 | namespace libfreenect2
34 | {
35 |
36 | struct LIBFREENECT2_API Buffer
37 | {
38 | public:
39 | size_t capacity;
40 | size_t length;
41 | unsigned char* data;
42 | };
43 |
44 | class LIBFREENECT2_API DoubleBuffer
45 | {
46 | public:
47 | DoubleBuffer();
48 | virtual ~DoubleBuffer();
49 |
50 | void allocate(size_t buffer_size);
51 |
52 | void swap();
53 |
54 | Buffer& front();
55 |
56 | Buffer& back();
57 | private:
58 | Buffer buffer_[2];
59 | unsigned char front_buffer_index_;
60 |
61 | unsigned char* buffer_data_;
62 | };
63 |
64 | } /* namespace libfreenect2 */
65 | #endif /* DOUBLE_BUFFER_H_ */
66 |
--------------------------------------------------------------------------------
/build_openKinect2/C++/libs/protonect/include/libfreenect2/frame_listener.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the OpenKinect Project. http://www.openkinect.org
3 | *
4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file
5 | * for details.
6 | *
7 | * This code is licensed to you under the terms of the Apache License, version
8 | * 2.0, or, at your option, the terms of the GNU General Public License,
9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses,
10 | * or the following URLs:
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/gpl-2.0.txt
13 | *
14 | * If you redistribute this file in source form, modified or unmodified, you
15 | * may:
16 | * 1) Leave this header intact and distribute it under the same terms,
17 | * accompanying it with the APACHE20 and GPL20 files, or
18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or
19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file
20 | * In all cases you must keep the copyright notice intact and include a copy
21 | * of the CONTRIB file.
22 | *
23 | * Binary distributions must follow the binary distribution requirements of
24 | * either License.
25 | */
26 |
27 | #ifndef FRAME_LISTENER_HPP_
28 | #define FRAME_LISTENER_HPP_
29 |
30 | #include
31 | #include
32 | #include
33 |
34 | namespace libfreenect2
35 | {
36 |
37 | struct LIBFREENECT2_API Frame
38 | {
39 | enum Type
40 | {
41 | Color = 1,
42 | Ir = 2,
43 | Depth = 4
44 | };
45 |
46 | uint32_t timestamp;
47 | uint32_t sequence;
48 | size_t width, height, bytes_per_pixel;
49 | unsigned char* data;
50 |
51 | Frame(size_t width, size_t height, size_t bytes_per_pixel) :
52 | width(width),
53 | height(height),
54 | bytes_per_pixel(bytes_per_pixel)
55 | {
56 | data = new unsigned char[width * height * bytes_per_pixel];
57 | }
58 |
59 | ~Frame()
60 | {
61 | delete[] data;
62 | }
63 | };
64 |
65 | class LIBFREENECT2_API FrameListener
66 | {
67 | public:
68 | virtual ~FrameListener();
69 |
70 | virtual bool onNewFrame(Frame::Type type, Frame *frame) = 0;
71 | };
72 |
73 | } /* namespace libfreenect2 */
74 | #endif /* FRAME_LISTENER_HPP_ */
75 |
--------------------------------------------------------------------------------
/build_openKinect2/C++/libs/protonect/include/libfreenect2/frame_listener_impl.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the OpenKinect Project. http://www.openkinect.org
3 | *
4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file
5 | * for details.
6 | *
7 | * This code is licensed to you under the terms of the Apache License, version
8 | * 2.0, or, at your option, the terms of the GNU General Public License,
9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses,
10 | * or the following URLs:
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/gpl-2.0.txt
13 | *
14 | * If you redistribute this file in source form, modified or unmodified, you
15 | * may:
16 | * 1) Leave this header intact and distribute it under the same terms,
17 | * accompanying it with the APACHE20 and GPL20 files, or
18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or
19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file
20 | * In all cases you must keep the copyright notice intact and include a copy
21 | * of the CONTRIB file.
22 | *
23 | * Binary distributions must follow the binary distribution requirements of
24 | * either License.
25 | */
26 |
27 | #ifndef FRAME_LISTENER_IMPL_H_
28 | #define FRAME_LISTENER_IMPL_H_
29 |
30 | #include