Skip to content
Snippets Groups Projects
ilw_cuda.hpp 1.26 KiB
Newer Older
Nicolas Pope's avatar
Nicolas Pope committed
#ifndef _FTL_ILW_CUDA_HPP_
#define _FTL_ILW_CUDA_HPP_

#include <ftl/cuda_common.hpp>
#include <ftl/rgbd/camera.hpp>
#include <ftl/cuda_matrix_util.hpp>

namespace ftl {
namespace cuda {

Nicolas Pope's avatar
Nicolas Pope committed
struct ILWParams {
    float spatial_smooth;
    float colour_smooth;
    float cost_ratio;
    float threshold;
Nicolas Pope's avatar
Nicolas Pope committed
	float range;
Nicolas Pope's avatar
Nicolas Pope committed
    uint flags;
};

static const uint kILWFlag_IgnoreBad = 0x0001;
static const uint kILWFlag_RestrictZ = 0x0002;
static const uint kILWFlag_SkipBadColour = 0x0004;
static const uint kILWFlag_ColourConfidenceOnly = 0x0008;
Nicolas Pope's avatar
Nicolas Pope committed
void correspondence_energy_vector(
    ftl::cuda::TextureObject<float> &d1,
    ftl::cuda::TextureObject<float> &d2,
Nicolas Pope's avatar
Nicolas Pope committed
    ftl::cuda::TextureObject<uchar4> &c1,
    ftl::cuda::TextureObject<uchar4> &c2,
    ftl::cuda::TextureObject<float4> &vout,
    ftl::cuda::TextureObject<float> &eout,
Nicolas Pope's avatar
Nicolas Pope committed
    float4x4 &pose1,
Nicolas Pope's avatar
Nicolas Pope committed
    float4x4 &pose1_inv,
Nicolas Pope's avatar
Nicolas Pope committed
    float4x4 &pose2,
Nicolas Pope's avatar
Nicolas Pope committed
    const ftl::rgbd::Camera &cam1,
Nicolas Pope's avatar
Nicolas Pope committed
    const ftl::rgbd::Camera &cam2,
Nicolas Pope's avatar
Nicolas Pope committed
    const ILWParams &params, int win,
    cudaStream_t stream
);

void move_points(
    ftl::cuda::TextureObject<float> &d,
Nicolas Pope's avatar
Nicolas Pope committed
    ftl::cuda::TextureObject<float4> &v,
    const ftl::rgbd::Camera &camera,
    const float4x4 &pose,
Nicolas Pope's avatar
Nicolas Pope committed
    float rate,
    int radius,
Nicolas Pope's avatar
Nicolas Pope committed
    cudaStream_t stream
);

}
}

#endif  // _FTL_ILW_CUDA_HPP_