Permalink
Browse files

fixes for Windows compilation

  • Loading branch information...
Gerhard
Gerhard committed Feb 24, 2013
1 parent 38d0728 commit dc6eeb84f24d448f15b84678d3e19ba70938c57a
Showing with 25 additions and 13 deletions.
  1. +4 −2 CMakeLists.txt
  2. +6 −6 cutil_math.h
  3. +7 −0 helpers.h
  4. +3 −3 kfusion.cu
  5. +2 −2 kfusion.h
  6. +3 −0 test.cpp
View
@@ -27,7 +27,7 @@ set(kfusion_cuda_srcs
cutil_math.h
)
cuda_add_library(kfusion SHARED
cuda_add_library(kfusion STATIC
${kfusion_cuda_srcs}
perfstats.h
OPTIONS
@@ -36,7 +36,7 @@ cuda_add_library(kfusion SHARED
if (GLUT_FOUND AND FREENECT_FOUND)
include_directories(${FREENECT_INCLUDE_PATHS})
include_directories(${FREENECT_INCLUDE_PATHS} ${GLUT_INCLUDE_DIR})
add_executable(kfusion_kinect
kinect.cpp
@@ -48,6 +48,8 @@ endif()
if(GLUT_FOUND)
include_directories(${GLUT_INCLUDE_DIR})
add_executable(kfusion_test
test.cpp
)
View
@@ -970,15 +970,15 @@ inline __host__ __device__ uint min(uint4 a)
inline __host__ __device__ float min(float2 a)
{
return min(a.x,a.y);
return fminf(a.x,a.y);
}
inline __host__ __device__ float min(float3 a)
{
return min(a.x,min(a.y, a.z));
return fminf(a.x,fminf(a.y, a.z));
}
inline __host__ __device__ float min(float4 a)
{
return min(min(a.x, a.y),min(a.z, a.w));
return fminf(fminf(a.x, a.y),fminf(a.z, a.w));
}
@@ -1040,15 +1040,15 @@ inline __host__ __device__ uint max(uint4 a)
inline __host__ __device__ float max(float2 a)
{
return max(a.x,a.y);
return fmaxf(a.x,a.y);
}
inline __host__ __device__ float max(float3 a)
{
return max(a.x,max(a.y, a.z));
return fmaxf(a.x,fmaxf(a.y, a.z));
}
inline __host__ __device__ float max(float4 a)
{
return max(max(a.x, a.y),max(a.z, a.w));
return fmaxf(fmaxf(a.x, a.y),fmaxf(a.z, a.w));
}
////////////////////////////////////////////////////////////////////////////////
View
@@ -5,6 +5,13 @@
#include <TooN/se3.h>
#ifdef WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef min
#undef max
#endif
#include <cuda_gl_interop.h> // includes cuda_gl_interop.h
template<typename P>
View
@@ -9,7 +9,7 @@
#include <TooN/se3.h>
#include <TooN/GR_SVD.h>
static const float INVALID = -2; // this is used to mark invalid entries in normal or vertex maps
#define INVALID -2 // this is used to mark invalid entries in normal or vertex maps
using namespace std;
@@ -498,7 +498,7 @@ TooN::Vector<6> solve( const TooN::Vector<27, T, A> & vals ){
void KFusion::Raycast(){
// raycast integration volume into the depth, vertex, normal buffers
raycastPose = pose;
raycast<<<divup(configuration.inputSize, configuration.raycastBlock), configuration.raycastBlock>>>(vertex, normal, integration, raycastPose * getInverseCameraMatrix(configuration.camera), configuration.nearPlane, configuration.farPlane, configuration.stepSize(), 0.75 * configuration.mu);
raycast<<<divup(configuration.inputSize, configuration.raycastBlock), configuration.raycastBlock>>>(vertex, normal, integration, raycastPose * getInverseCameraMatrix(configuration.camera), configuration.nearPlane, configuration.farPlane, configuration.stepSize(), 0.75f * configuration.mu);
}
bool KFusion::Track() {
@@ -517,7 +517,7 @@ bool KFusion::Track() {
// prepare the 3D information from the input depth maps
for(int i = 0; i < configuration.iterations.size(); ++i){
depth2vertex<<<grids[i], configuration.imageBlock>>>( inputVertex[i], inputDepth[i], getInverseCameraMatrix(configuration.camera / (1 << i))); // inverse camera matrix depends on level
depth2vertex<<<grids[i], configuration.imageBlock>>>( inputVertex[i], inputDepth[i], getInverseCameraMatrix(configuration.camera / float(1 << i))); // inverse camera matrix depends on level
vertex2normal<<<grids[i], configuration.imageBlock>>>( inputNormal[i], inputVertex[i] );
}
View
@@ -8,9 +8,9 @@
// need c headers for __int128 and uint16_t
#include <limits.h>
#include <stdint.h>
#endif
#include <stdint.h>
#include <iostream>
#include <vector>
@@ -71,7 +71,7 @@ struct KFusionConfig {
iterations.push_back( 5 );
iterations.push_back( 5 );
iterations.push_back( 5 );
track_threshold = 0.15;
track_threshold = 0.15f;
imageBlock = dim3(32,16);
raycastBlock = dim3(32,8);
View
@@ -7,6 +7,9 @@
#ifdef __APPLE__
#include <GLUT/glut.h>
#elif defined(WIN32)
#define GLUT_NO_LIB_PRAGMA
#include <glut.h>
#else
#include <GL/glut.h>
#endif

0 comments on commit dc6eeb8

Please sign in to comment.