Skip to content
Snippets Groups Projects
Commit 9d22d5a7 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Pass params to move points

parent 850431fd
No related branches found
No related tags found
1 merge request!122Implements #183 depth ray correspondences
...@@ -96,7 +96,7 @@ bool ILW::process(ftl::rgbd::FrameSet &fs, cudaStream_t stream) { ...@@ -96,7 +96,7 @@ bool ILW::process(ftl::rgbd::FrameSet &fs, cudaStream_t stream) {
_phase0(fs, stream); _phase0(fs, stream);
params_.range = 0.05f; params_.range = 0.1f;
for (int i=0; i<iterations_; ++i) { for (int i=0; i<iterations_; ++i) {
int win; int win;
...@@ -243,6 +243,7 @@ bool ILW::_phase2(ftl::rgbd::FrameSet &fs, float rate, cudaStream_t stream) { ...@@ -243,6 +243,7 @@ bool ILW::_phase2(ftl::rgbd::FrameSet &fs, float rate, cudaStream_t stream) {
f.getTexture<float4>(Channel::EnergyVector), f.getTexture<float4>(Channel::EnergyVector),
fs.sources[i]->parameters(), fs.sources[i]->parameters(),
pose, pose,
params_,
rate, rate,
motion_window_, motion_window_,
stream stream
......
...@@ -194,7 +194,8 @@ __global__ void move_points_kernel( ...@@ -194,7 +194,8 @@ __global__ void move_points_kernel(
ftl::cuda::TextureObject<float> d, ftl::cuda::TextureObject<float> d,
ftl::cuda::TextureObject<float4> ev, ftl::cuda::TextureObject<float4> ev,
ftl::rgbd::Camera camera, ftl::rgbd::Camera camera,
float4x4 pose, float4x4 pose,
ftl::cuda::ILWParams params,
float rate) { float rate) {
const unsigned int x = blockIdx.x*blockDim.x + threadIdx.x; const unsigned int x = blockIdx.x*blockDim.x + threadIdx.x;
...@@ -218,7 +219,7 @@ __global__ void move_points_kernel( ...@@ -218,7 +219,7 @@ __global__ void move_points_kernel(
//if (pn.x == MINF) continue; //if (pn.x == MINF) continue;
if (vecn.x == 0.0f) continue; if (vecn.x == 0.0f) continue;
const float s = ftl::cuda::weighting(fabs(vec0.x - vecn.x), 0.04f); const float s = ftl::cuda::weighting(fabs(vec0.x - vecn.x), params.range);
contrib += vecn.w * s; contrib += vecn.w * s;
delta += vecn.w * s * vecn.z; delta += vecn.w * s * vecn.z;
} }
...@@ -238,7 +239,8 @@ void ftl::cuda::move_points( ...@@ -238,7 +239,8 @@ void ftl::cuda::move_points(
ftl::cuda::TextureObject<float> &d, ftl::cuda::TextureObject<float> &d,
ftl::cuda::TextureObject<float4> &v, ftl::cuda::TextureObject<float4> &v,
const ftl::rgbd::Camera &camera, const ftl::rgbd::Camera &camera,
const float4x4 &pose, const float4x4 &pose,
const ftl::cuda::ILWParams &params,
float rate, float rate,
int radius, int radius,
cudaStream_t stream) { cudaStream_t stream) {
...@@ -247,11 +249,11 @@ void ftl::cuda::move_points( ...@@ -247,11 +249,11 @@ void ftl::cuda::move_points(
const dim3 blockSize(T_PER_BLOCK, T_PER_BLOCK); const dim3 blockSize(T_PER_BLOCK, T_PER_BLOCK);
switch (radius) { switch (radius) {
case 9 : move_points_kernel<9><<<gridSize, blockSize, 0, stream>>>(d,v,camera, pose,rate); break; case 9 : move_points_kernel<9><<<gridSize, blockSize, 0, stream>>>(d,v,camera, pose, params, rate); break;
case 5 : move_points_kernel<5><<<gridSize, blockSize, 0, stream>>>(d,v,camera, pose,rate); break; case 5 : move_points_kernel<5><<<gridSize, blockSize, 0, stream>>>(d,v,camera, pose, params, rate); break;
case 3 : move_points_kernel<3><<<gridSize, blockSize, 0, stream>>>(d,v,camera, pose,rate); break; case 3 : move_points_kernel<3><<<gridSize, blockSize, 0, stream>>>(d,v,camera, pose, params, rate); break;
case 1 : move_points_kernel<1><<<gridSize, blockSize, 0, stream>>>(d,v,camera, pose,rate); break; case 1 : move_points_kernel<1><<<gridSize, blockSize, 0, stream>>>(d,v,camera, pose, params, rate); break;
case 0 : move_points_kernel<0><<<gridSize, blockSize, 0, stream>>>(d,v,camera, pose,rate); break; case 0 : move_points_kernel<0><<<gridSize, blockSize, 0, stream>>>(d,v,camera, pose, params, rate); break;
} }
cudaSafeCall( cudaGetLastError() ); cudaSafeCall( cudaGetLastError() );
......
...@@ -43,6 +43,7 @@ void move_points( ...@@ -43,6 +43,7 @@ void move_points(
ftl::cuda::TextureObject<float4> &v, ftl::cuda::TextureObject<float4> &v,
const ftl::rgbd::Camera &camera, const ftl::rgbd::Camera &camera,
const float4x4 &pose, const float4x4 &pose,
const ILWParams &params,
float rate, float rate,
int radius, int radius,
cudaStream_t stream cudaStream_t stream
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment