Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# make FORCE_BUILD_CLR=1
#
#############################################################################
export ALLOW_WARNINGS = 1

include ThirdParty/PSCommon/BuildSystem/CommonDefs.mak

Expand Down
94 changes: 0 additions & 94 deletions README

This file was deleted.

170 changes: 170 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
# OpenNI

**Structure Core customers:** OpenNI does not currently support Structure Core. To start developing with Structure Core download *Structure SDK (Cross-Platform)* on the [Developer Portal](https://developer.structure.io/sdk).


OpenNI2 homepage: http://structure.io/openni

## Develop branch ##

The latest ongoing development is currently being done in the develop branch. Refer to README and ReleasesNotes in the develop branch for up to date build instructions.

## Contributing ##

Pull requests that do not apply cleanly on top of the [`develop` branch head](http://github.com/occipital/OpenNI2/tree/develop) will be rejected.

Other than that, sensible and meaningful contributions are very welcome!

## Building Prerequisites

### Windows

- Microsoft Visual Studio 2010

- Download and install from: http://msdn.microsoft.com/en-us/vstudio/bb984878.aspx

- Microsoft Kinect SDK v1.6

- Download and install from: http://go.microsoft.com/fwlink/?LinkID=262831

- Python 2.6+/3.x

- Download and install from: http://www.python.org/download/

- PyWin32

- Download and install from: http://sourceforge.net/projects/pywin32/files/pywin32/

Please make sure you download the version that matches your exact python version.

- JDK 6.0

- Download and install from: http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u32-downloads-1594644.html

You must also define an environment variable called `JAVA_HOME` that points to the JDK installation directory. For example:

set JAVA_HOME=c:\Program Files (x86)\Java\jdk1.6.0_32

- WIX 3.5

- Download and install from: http://wix.codeplex.com/releases/view/60102

- Doxygen

- Download and install from: http://www.stack.nl/~dimitri/doxygen/download.html#latestsrc

- GraphViz

- Download and install from: http://www.graphviz.org/Download_windows.php

### Linux

- GCC 4.x

- Download and install from: http://gcc.gnu.org/releases.html

- Or use `apt`:

sudo apt-get install g++

- Python 2.6+/3.x

- Download and install from: http://www.python.org/download/

- Or use `apt`:

sudo apt-get install python

- LibUSB 1.0.x

- Download and install from: http://sourceforge.net/projects/libusb/files/libusb-1.0/

- Or use `apt`:

sudo apt-get install libusb-1.0-0-dev

- LibUDEV

sudo apt-get install libudev-dev

- JDK 6.0

- Download and install from: http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u32-downloads-1594644.html

- Or use `apt`:

- On Ubuntu 10.x:

sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk

- On Ubuntu 12.x:

sudo apt-get install openjdk-6-jdk

- FreeGLUT3

- Download and install from: http://freeglut.sourceforge.net/index.php#download

- Or use `apt`:

sudo apt-get install freeglut3-dev

- Doxygen

- Download and install from: http://www.stack.nl/~dimitri/doxygen/download.html#latestsrc

- Or use `apt`:

sudo apt-get install doxygen

- GraphViz

- Download and install from: http://www.graphviz.org/Download_linux_ubuntu.php

- Or use `apt`:

sudo apt-get install graphviz

### Android

- Download and install the Android NDK version **r8d**. Newer versions will **NOT** work.

- For Mac OS X: http://dl.google.com/android/ndk/android-ndk-r8d-darwin-x86.tar.bz2
- For Windows: http://dl.google.com/android/ndk/android-ndk-r8d-windows.zip
- For Linux: http://dl.google.com/android/ndk/android-ndk-r8d-linux-x86.tar.bz2

Building Android packages requires the NDK_ROOT environment variable to be defined, and its value must be pointing to the NDK installation dir: `NDK_ROOT=/path/to/android-ndk-r8d`

## Building

### Building on Windows:

Open the solution `OpenNI.sln`

### Building on Linux:

Run:

make

### Cross-Compiling for ARM on Linux

The following environment variables should be defined:

- `ARM_CXX=path-to-cross-compilation-g++`
- `ARM_STAGING=path-to-cross-compilation-staging-dir`

Then, run:

PLATFORM=Arm make

### Creating OpenNI2 packages

- Go into the directory `Packaging`
- Run:

ReleaseVersion.py [x86|x64|arm|android]

- The installer will be placed in the `Final` directory
12 changes: 9 additions & 3 deletions Source/Core/OniStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,15 @@ OniStatus VideoStream::convertDepthToWorldCoordinates(float depthX, float depthY
float normalizedX = depthX / m_worldConvertCache.resolutionX - .5f;
float normalizedY = .5f - depthY / m_worldConvertCache.resolutionY;

*pWorldX = normalizedX * depthZ * m_worldConvertCache.xzFactor;
*pWorldY = normalizedY * depthZ * m_worldConvertCache.yzFactor;
*pWorldZ = depthZ;
OniVideoMode videoMode;
int size = sizeof(videoMode);
getProperty(ONI_STREAM_PROPERTY_VIDEO_MODE, &videoMode, &size);

float const convertToMillimeters = (videoMode.pixelFormat == ONI_PIXEL_FORMAT_DEPTH_100_UM) ? 10.f : 1.f;
*pWorldX = (normalizedX * depthZ * m_worldConvertCache.xzFactor) / convertToMillimeters;
*pWorldY = (normalizedY * depthZ * m_worldConvertCache.yzFactor) / convertToMillimeters;
*pWorldZ = depthZ / convertToMillimeters;

return ONI_STATUS_OK;
}

Expand Down
4 changes: 0 additions & 4 deletions Source/Drivers/Kinect/Kinect.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,11 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)Bin\$(Platform)-$(Configuration)\OpenNI2\Drivers\</OutDir>
<IntDir>$(SolutionDir)Bin\Intermediate\$(Platform)-$(Configuration)\$(ProjectName)\</IntDir>
<IncludePath>$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include</IncludePath>
<LibraryPath>$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)\lib;</LibraryPath>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(SolutionDir)Bin\$(Platform)-$(Configuration)\OpenNI2\Drivers\</OutDir>
<IntDir>$(SolutionDir)Bin\Intermediate\$(Platform)-$(Configuration)\$(ProjectName)\</IntDir>
<IncludePath>$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;</IncludePath>
<LibraryPath>$(VCInstallDir)lib\amd64;$(VCInstallDir)atlmfc\lib\amd64;$(WindowsSdkDir)lib\x64;</LibraryPath>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand Down
2 changes: 1 addition & 1 deletion Source/Tools/NiViewer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ else
endif

LIB_DIRS += ../../../ThirdParty/PSCommon/XnLib/Bin/$(PLATFORM)-$(CFG)
USED_LIBS += OpenNI2 XnLib
USED_LIBS += OpenNI2 XnLib pthread

EXE_NAME = NiViewer

Expand Down
6 changes: 0 additions & 6 deletions ThirdParty/GL/glh/glh_convenience.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@
// with opengl...



// debugging hack...
#include <iostream>

using namespace std;

#ifdef MACOS
#include <OpenGL/gl.h>
#else
Expand Down
3 changes: 3 additions & 0 deletions ThirdParty/PSCommon/XnLib/Source/Win32/XnWin32Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
//---------------------------------------------------------------------------
// Includes
//---------------------------------------------------------------------------

#define _WINSOCK_DEPRECATED_NO_WARNINGS 1

#include <XnOS.h>
#include <winsock2.h>
#include <xnLog.h>
Expand Down
8 changes: 6 additions & 2 deletions ThirdParty/PSCommon/XnLib/Source/Win32/XnWin32OS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,12 @@ XN_C_API XnStatus xnOSGetInfo(xnOSInfo* pOSInfo)
// Get OS Info
OSVERSIONINFOEX osVersionInfo;
osVersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
if (0 == GetVersionEx((LPOSVERSIONINFO)&osVersionInfo))
{

#pragma warning(push)
#pragma warning(disable:4996)
if (0 == GetVersionEx((LPOSVERSIONINFO)&osVersionInfo))
#pragma warning(pop)
{
DWORD nErr = GetLastError();
xnLogWarning(XN_MASK_OS, "Failed getting OS version information. Error code: %d", nErr);
return XN_STATUS_ERROR;
Expand Down
7 changes: 0 additions & 7 deletions ThirdParty/PSCommon/XnLib/ThirdParty/GL/glh/glh_convenience.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@
// Convenience methods for using glh_linear objects
// with opengl...



// debugging hack...
#include <iostream>

using namespace std;

#ifdef MACOS
#include <OpenGL/gl.h>
#else
Expand Down