Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Voxel hashing GUI #3363

Merged
merged 154 commits into from
May 6, 2021
Merged
Show file tree
Hide file tree
Changes from 149 commits
Commits
Show all changes
154 commits
Select commit Hold shift + click to select a range
e381e60
RGBD odometry compiles, debugging
theNded Mar 29, 2021
9e44c3f
minor fixes
theNded Mar 29, 2021
6cc3c50
hybrid model works
theNded Mar 29, 2021
e197b08
enhance example TOdometryRGBD
theNded Mar 29, 2021
eef1dea
better naming
theNded Mar 30, 2021
d6d74ca
adjust include tree
theNded Mar 30, 2021
2328e4f
switch to natural source target for point to plane
theNded Mar 30, 2021
fd166d2
switch to natural source target for hybrid
theNded Mar 30, 2021
f36e089
introduce direct intensity odometry
theNded Mar 30, 2021
0096538
wrap duplicate reduction/solve code and fix memory leak
theNded Mar 30, 2021
7d396ab
squeeze depth preprocessing in one pass
theNded Mar 30, 2021
88dec20
add dispatch pattern for unprojection and depth processing
theNded Mar 30, 2021
7b9325a
fix tests
theNded Mar 30, 2021
6b1d8fe
add benchmark
theNded Mar 30, 2021
6482cc2
expose depth_max to multiscale odometry interface
theNded Mar 30, 2021
19109ed
add truncated pyrdown for depth
theNded Mar 30, 2021
d8c6300
address comments
theNded Apr 5, 2021
2ead3cd
address major comments
theNded Apr 6, 2021
919f421
split implementations
theNded Apr 7, 2021
177449e
Merge branch 'master' of https://github.com/intel-isl/Open3D into wei…
theNded Apr 8, 2021
1133821
Merge branch 'wei/odometry' of https://github.com/intel-isl/Open3D
theNded Apr 8, 2021
0d0c4b5
fix doxygen
theNded Apr 8, 2021
3f4c071
Merge branch 'wei/odometry' of https://github.com/intel-isl/Open3D in…
theNded Apr 8, 2021
e733b28
raycasting with target map selection mask
theNded Apr 8, 2021
4ebcdc0
fix minor bugs and upgrade vh skeleton
theNded Apr 9, 2021
767b4e6
minor
theNded Apr 9, 2021
1a60d21
minor update
theNded Apr 9, 2021
88befd8
test t point cloud in gui
theNded Apr 9, 2021
e3725a6
add frame interface
theNded Apr 10, 2021
56f468a
simplify frame constructors
theNded Apr 10, 2021
49bdb9d
self-included refactored system
theNded Apr 10, 2021
c3254ed
initial integration of the scene
theNded Apr 10, 2021
afd80f2
draft
theNded Apr 10, 2021
eebd1a2
minor
theNded Apr 11, 2021
3832877
visualize frustum
theNded Apr 12, 2021
be42d67
multi-thread surface extraction with unsafe pcd extraction
theNded Apr 12, 2021
44ebaad
minor
theNded Apr 12, 2021
4644b43
fall to tgeometry (not working yet)
theNded Apr 12, 2021
514fb10
buffer pcd and update geometry
theNded Apr 12, 2021
cd91cca
temporarily disable normal
theNded Apr 12, 2021
176f4f7
rough realsense demo (fix tsdf scale factor)
theNded Apr 13, 2021
c6a4ab5
update raycasting interface for depth_scale
theNded Apr 15, 2021
19d6613
add optional nullopt for surface extraction
theNded Apr 15, 2021
613a493
colored depth map and temprarily remove multithread for surface recon…
theNded Apr 15, 2021
21bc430
apply turbo depth colormap
theNded Apr 15, 2021
faab910
merge master
theNded Apr 15, 2021
5a8e80e
add enable color selector
theNded Apr 15, 2021
de761eb
add button interaction and better initialization
theNded Apr 15, 2021
0d1f76c
expose point cloud size estimation for surface extraction
theNded Apr 16, 2021
e848f78
add preset point cloud buffer estimate and format transformation
theNded Apr 16, 2021
c8924d4
merge master
theNded Apr 16, 2021
af7829a
add clear to hashmap
theNded Apr 16, 2021
e15bb49
support buffered hashmap in integration
theNded Apr 16, 2021
5502881
Merge branch 'wei/voxelhashing-gui' of https://github.com/intel-isl/O…
theNded Apr 17, 2021
2ba2013
fix pybind and examples for updated tsdf_voxelgrid
theNded Apr 17, 2021
22cab43
fix tests
theNded Apr 17, 2021
4e791f7
init minmax map generation, debugging
theNded Apr 18, 2021
21e7516
minmax map works, next upgrade raycasting
theNded Apr 18, 2021
fe69f58
clone pose and enable rangemap visualization
theNded Apr 18, 2021
178b4ff
add hashmap cache and profile
theNded Apr 18, 2021
1f84505
fix minor bug in caching
theNded Apr 18, 2021
3f84478
move initialization into raycaster
theNded Apr 18, 2021
105cb6a
change to extrinsic-first interface in raycasting
theNded Apr 18, 2021
18521d2
optimized pose inversion and transform indexer
theNded Apr 19, 2021
4d93eaa
reenable voxelhashing
theNded Apr 19, 2021
295d7d7
Cleaned up VoxelHashingGUI code and minor updates to UI
prewettg Apr 19, 2021
6abe9c3
reorganize shape dtype device check for transformations
theNded Apr 20, 2021
b90ddd0
simplfy raycasting interface
theNded Apr 20, 2021
65cdd44
fix ci
theNded Apr 20, 2021
1d476dc
fix pytest for tsdfvoxelgrid
theNded Apr 20, 2021
79538e1
Improved UI
prewettg Apr 20, 2021
dfd7152
speed up raycast by reorganizing control flow
theNded Apr 20, 2021
0652cc6
Style fixes for VoxelHashingGUI
prewettg Apr 20, 2021
547afc3
Fix a few layout problems
prewettg Apr 20, 2021
299c296
Merge branch 'master' of https://github.com/intel-isl/Open3D
theNded Apr 21, 2021
27719df
squeeze commits
theNded Apr 21, 2021
60d3776
add pybind
theNded Apr 21, 2021
fa4a332
reimplement pyrdown depth to avoid licence issue
theNded Apr 21, 2021
aead47a
fix unit test
theNded Apr 21, 2021
07401d1
Merge branch 'wei/timage-update' into wei/tsdf-optim
theNded Apr 21, 2021
e03fe85
merge timage update
theNded Apr 21, 2021
9dfb1e3
upgrade odometry with timage interface
theNded Apr 21, 2021
026e43b
sum reduction in __shared__ working for point to plane
theNded Apr 21, 2021
77da012
fix rgbd odom tests
theNded Apr 21, 2021
7b834b2
implement and reorganize sum-reduction in rgbd odometry
theNded Apr 21, 2021
22cd648
merge all the changes and add fps
theNded Apr 22, 2021
95289cf
fix raycast vis
theNded Apr 22, 2021
5c48979
minor
theNded Apr 22, 2021
76dc6ec
fix raycasting
theNded Apr 22, 2021
e0cedf6
fix raycasting
theNded Apr 22, 2021
e79af01
fix gui segfault
theNded Apr 22, 2021
fb3777c
add huber loss
theNded Apr 23, 2021
4f968da
milestone: works for burghers and most scenes
theNded Apr 23, 2021
a08f2b0
minor
theNded Apr 25, 2021
d2aa3d7
fix raycasting
theNded Apr 25, 2021
a430dda
address review comments
theNded Apr 25, 2021
732ec1c
merge master
theNded Apr 25, 2021
c181ed5
Merge branch 'master' of https://github.com/intel-isl/Open3D into wei…
theNded Apr 25, 2021
6db7fb8
hide pyrdown_depth
theNded Apr 25, 2021
b3007ea
Merge branch 'wei/timage-update' into wei/tsdf-optim
theNded Apr 25, 2021
db59b94
adapt pyrdown depth inside rgbd odometry
theNded Apr 25, 2021
e413bf3
Merge branch 'wei/tsdf-optim' into wei/odom-optim
theNded Apr 25, 2021
654e72f
upgrade bilateral filtering and create vtx map
theNded Apr 25, 2021
74bb3a2
Merge branch 'wei/odom-optim' into wei/voxelhashing-gui
theNded Apr 25, 2021
4e95a71
upgrade gui caller
theNded Apr 25, 2021
f6284fa
apply style
theNded Apr 26, 2021
e72fcbb
Merge branch 'wei/tsdf-optim' into wei/odom-optim
theNded Apr 26, 2021
f4a0ef6
Merge branch 'wei/odom-optim' into wei/voxelhashing-gui
theNded Apr 26, 2021
32d7181
Add tooltips to example
prewettg Apr 26, 2021
f5a046a
Merge branch 'wei/voxelhashing-gui' of https://github.com/intel-isl/O…
theNded Apr 26, 2021
e2a1221
replace residual as float and expose inlier count
theNded Apr 27, 2021
5622366
wrap up odometry result with a class
theNded Apr 27, 2021
0162933
minor
theNded Apr 27, 2021
d0f90c2
add convergence criteria and early exit
theNded Apr 27, 2021
aa916b2
update naive failure detection
theNded Apr 27, 2021
4a0320f
minor
theNded Apr 27, 2021
df90d8f
Yixing comments
ssheorey Apr 28, 2021
c45fdc0
Non-visual unit tests
ssheorey Apr 28, 2021
2dc5c6b
merge conflicts
theNded Apr 28, 2021
6e908ba
fix conflicts
theNded Apr 28, 2021
c8f7d13
fix conflicts
theNded Apr 28, 2021
4ce704b
wrap odometry loss params
theNded Apr 28, 2021
dad80e9
huber with problems
theNded Apr 28, 2021
2559a72
minor
theNded Apr 28, 2021
a64c275
update huber
theNded Apr 29, 2021
d65f833
merge rgbd odometry (works for cli/gui)
theNded Apr 29, 2021
a76fafa
minor
theNded Apr 29, 2021
ea3eb4b
fix bilateral in point2plane
theNded Apr 29, 2021
91fb2cb
fix hybrid issue
theNded Apr 29, 2021
02f4938
address review comments and change const params
theNded Apr 29, 2021
863c89d
rename functions
theNded Apr 29, 2021
8e21bb6
fix bug in intensity
theNded Apr 29, 2021
1de427e
Merge branch 'wei/odom-optim' into wei/voxelhashing-gui
theNded Apr 29, 2021
dc09f0f
fix style
theNded Apr 29, 2021
3181729
revert renaming in registration
theNded Apr 29, 2021
dee6da8
revert renaming in registration
theNded Apr 29, 2021
c17a699
add singular case handling
theNded Apr 30, 2021
561b3b5
Merge branch 'wei/odom-optim' into wei/voxelhashing-gui
theNded Apr 30, 2021
3c29cf1
merge ExampleWindow and ReconstructWindow
theNded Apr 30, 2021
f2c0c6c
move pcd and voxelgrid initialization to toggle callback
theNded Apr 30, 2021
21c6ba7
add more interactive properties, update_surface not working
theNded Apr 30, 2021
ff69f60
add write on exit
theNded Apr 30, 2021
e15df05
add more cmd line inputs
theNded Apr 30, 2021
c63480d
update odometry criteria interface
theNded Apr 30, 2021
3c40188
Merge branch 'wei/odom-optim' into wei/voxelhashing-gui
theNded Apr 30, 2021
2c71277
update model to fix ci
theNded Apr 30, 2021
dd43ea4
Indicate that source colors are sRGB
errissa May 3, 2021
6acc1b1
fix cmake issue
theNded May 3, 2021
b62fab6
Merge branch 'master' of https://github.com/intel-isl/Open3D into wei…
theNded May 3, 2021
fa45d48
merge odom-optim
theNded May 5, 2021
a4d12f2
address comments
theNded May 5, 2021
b3f0f52
clean up tmp file
theNded May 5, 2021
9e1b785
fix segfault on start
theNded May 5, 2021
849b84d
merge master
theNded May 6, 2021
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
44 changes: 27 additions & 17 deletions cpp/benchmarks/t/pipelines/odometry/RGBDOdometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ static core::Tensor CreateIntrisicTensor() {
{0, 0, 1}});
}

static void ComputePosePointToPlane(benchmark::State& state,
const core::Device& device) {
static void ComputeOdometryResultPointToPlane(benchmark::State& state,
const core::Device& device) {
if (!t::geometry::Image::HAVE_IPPICV &&
device.GetType() == core::Device::DeviceType::CPU) {
return;
Expand Down Expand Up @@ -85,26 +85,25 @@ static void ComputePosePointToPlane(benchmark::State& state,
core::Tensor::Eye(4, core::Dtype::Float64, core::Device("CPU:0"));

for (int i = 0; i < 20; ++i) {
core::Tensor delta_src_to_dst =
t::pipelines::odometry::ComputePosePointToPlane(
src_vertex_map.AsTensor(), dst_vertex_map.AsTensor(),
src_normal_map.AsTensor(), intrinsic_t, trans,
depth_diff);
trans = delta_src_to_dst.Matmul(trans).Contiguous();
auto result = t::pipelines::odometry::ComputeOdometryResultPointToPlane(
src_vertex_map.AsTensor(), dst_vertex_map.AsTensor(),
src_normal_map.AsTensor(), intrinsic_t, trans, depth_diff,
depth_diff * 0.5);
trans = result.transformation_.Matmul(trans).Contiguous();
}

for (auto _ : state) {
core::Tensor trans = core::Tensor::Eye(4, core::Dtype::Float64,
core::Device("CPU:0"));

for (int i = 0; i < 20; ++i) {
core::Tensor delta_src_to_dst =
t::pipelines::odometry::ComputePosePointToPlane(
auto result =
t::pipelines::odometry::ComputeOdometryResultPointToPlane(
src_vertex_map.AsTensor(),
dst_vertex_map.AsTensor(),
src_normal_map.AsTensor(), intrinsic_t, trans,
depth_diff);
trans = delta_src_to_dst.Matmul(trans).Contiguous();
depth_diff, depth_diff * 0.5);
trans = result.transformation_.Matmul(trans).Contiguous();
}
}
}
Expand Down Expand Up @@ -140,25 +139,36 @@ static void RGBDOdometryMultiScale(

core::Tensor intrinsic_t = CreateIntrisicTensor();

// Very strict criteria to ensure running most the iterations
t::pipelines::odometry::OdometryLossParams loss(depth_diff);
std::vector<t::pipelines::odometry::OdometryConvergenceCriteria> criteria{
t::pipelines::odometry::OdometryConvergenceCriteria(10, 1e-12,
1e-12),
t::pipelines::odometry::OdometryConvergenceCriteria(5, 1e-12,
1e-12),
t::pipelines::odometry::OdometryConvergenceCriteria(3, 1e-12,
1e-12)};

// Warp up
RGBDOdometryMultiScale(
source, target, intrinsic_t,
core::Tensor::Eye(4, core::Dtype::Float64, core::Device("CPU:0")),
depth_scale, depth_max, depth_diff, {10, 5, 3}, method);
depth_scale, depth_max, criteria, method, loss);

for (auto _ : state) {
RGBDOdometryMultiScale(source, target, intrinsic_t,
core::Tensor::Eye(4, core::Dtype::Float64,
core::Device("CPU:0")),
depth_scale, depth_max, depth_diff, {10, 5, 3},
method);
depth_scale, depth_max, criteria, method, loss);
}
}

BENCHMARK_CAPTURE(ComputePosePointToPlane, CPU, core::Device("CPU:0"))
BENCHMARK_CAPTURE(ComputeOdometryResultPointToPlane, CPU, core::Device("CPU:0"))
->Unit(benchmark::kMillisecond);
#ifdef BUILD_CUDA_MODULE
BENCHMARK_CAPTURE(ComputePosePointToPlane, CUDA, core::Device("CUDA:0"))
BENCHMARK_CAPTURE(ComputeOdometryResultPointToPlane,
CUDA,
core::Device("CUDA:0"))
->Unit(benchmark::kMillisecond);
#endif

Expand Down
1 change: 1 addition & 0 deletions cpp/open3d/core/hashmap/CUDA/StdGPUHashmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ void StdGPUHashmap<Key, Hash>::Allocate(int64_t capacity) {

impl_ = stdgpu::unordered_map<Key, addr_t, Hash>::createDeviceObject(
this->capacity_);
OPEN3D_CUDA_CHECK(cudaDeviceSynchronize());
}

template <typename Key, typename Hash>
Expand Down
20 changes: 7 additions & 13 deletions cpp/open3d/t/geometry/Image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,13 +484,13 @@ Image Image::ClipTransform(float scale,
}
if (!(std::isnan(clip_fill) || std::isinf(clip_fill) || clip_fill == 0)) {
utility::LogWarning(
"The clip_fill value {} is not recommended Inf, NaN or, 0",
"The clip_fill value {} is not recommended. Please use Inf, "
"NaN or, 0",
clip_fill);
}

Image dst_im;
dst_im.data_ = core::Tensor::Empty({GetRows(), GetCols(), 1},
core::Dtype::Float32, data_.GetDevice());
Image dst_im(GetRows(), GetCols(), 1, core::Dtype::Float32,
data_.GetDevice());
kernel::image::ClipTransform(data_, dst_im.data_, scale, min_value,
max_value, clip_fill);
return dst_im;
Expand All @@ -509,9 +509,7 @@ Image Image::CreateVertexMap(const core::Tensor &intrinsics,
GetDtype().ToString());
}

Image dst_im;
dst_im.data_ = core::Tensor::Empty({GetRows(), GetCols(), 3}, GetDtype(),
GetDevice());
Image dst_im(GetRows(), GetCols(), 3, GetDtype(), GetDevice());
kernel::image::CreateVertexMap(data_, dst_im.data_, intrinsics,
invalid_fill);
return dst_im;
Expand All @@ -529,9 +527,7 @@ Image Image::CreateNormalMap(float invalid_fill) {
GetDtype().ToString());
}

Image dst_im;
dst_im.data_ = core::Tensor::Empty({GetRows(), GetCols(), 3}, GetDtype(),
GetDevice());
Image dst_im(GetRows(), GetCols(), 3, GetDtype(), GetDevice());
kernel::image::CreateNormalMap(data_, dst_im.data_, invalid_fill);
return dst_im;
}
Expand All @@ -555,9 +551,7 @@ Image Image::ColorizeDepth(float scale, float min_value, float max_value) {
scale, min_value, max_value);
}

Image dst_im;
dst_im.data_ = core::Tensor::Empty({GetRows(), GetCols(), 3},
core::Dtype::UInt8, data_.GetDevice());
Image dst_im(GetRows(), GetCols(), 3, core::Dtype::UInt8, GetDevice());
kernel::image::ColorizeDepth(data_, dst_im.data_, scale, min_value,
max_value);
return dst_im;
Expand Down
37 changes: 21 additions & 16 deletions cpp/open3d/t/geometry/Image.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,36 +239,41 @@ class Image : public Geometry {
/// resize (ratio = 0.5) operation.
Image PyrDown() const;

/// Preprocess a image of (H, W, 1), typically used for a depth image.
/// Each pixel will be transformed by
/// Preprocess a image of shape (rows, cols, channels=1), typically used for
/// a depth image. UInt16 and Float32 Dtypes supported. Each pixel will be
/// transformed by
/// x = x / scale
/// x = x < min_value ? clip_fill : x
/// x = x > max_value ? clip_fill : x
/// Use INF, NAN or 0.0 (default) for \p clip_fill
Image ClipTransform(float scale,
float min_value,
float max_value,
float clip_fill = 0.0f);

/// Create a vertex map (H, W, 3) in Float32 from an image of (H, W, 1) in
/// Float32 using unprojection. The input depth is expected to be the output
/// of ClipTransform.
/// Create a vertex map (rows, cols, channels=3) in Float32 from an image of
/// shape (rows, cols, channels=1) in Float32 using unprojection. The input
/// depth is expected to be the output of ClipTransform.
/// \param intrinsics Pinhole camera model of (3, 3) in Float64.
/// \param invalid_fill Value to fill in for invalid depths. Must be
/// consistent with \p clip_fill in ClipTransform
/// consistent with \p clip_fill in ClipTransform.
Image CreateVertexMap(const core::Tensor &intrinsics, float invalid_fill);

/// Create a normal map (H, W, 3) in Float32 from an image of (H, W, 3)
/// in Float32 using cross product of V(u, v+1)-V(u, v) and V(u+1, v)-V(u,
/// v). The input vertex map is expected to be the output of
/// CreateVertexMap.
/// \param invalid_mask Condition to check if a point is invalid in
/// vertexmap, and to fill-in if no valid neighbor is found. Must be
/// consistent with CreateVertexMap.
/// Create a normal map (rows, cols, channels=3) in Float32 from an image of
/// (rows, cols, channels=3) in Float32 using cross product of V(r,
/// c+1)-V(r, c) and V(r+1, c)-V(r, c). The input vertex map is expected to
/// be the output of CreateVertexMap. You may need to start with a filtered
/// depth image (e.g. with FilterBilateral) to obtain good results.
/// \param invalid_fill Value to fill in for invalid points, and to fill-in
/// if no valid neighbor is found. Must be consistent with \p invalid_fill
/// in CreateVertexMap.
Image CreateNormalMap(float invalid_fill);

/// Colorize an input depth image with the Turbo colormap, rescaled within
/// (min_range, max_range)
Image ColorizeDepth(float scale, float min_range, float max_range);
/// Colorize an input depth image (with Dtype UInt16 or Float32). The image
/// values are divided by scale, then clamped within [min_value, max_value]
/// and finally converted to a 3 channel UInt8 RGB image using the Turbo
/// colormap as a lookup table.
Image ColorizeDepth(float scale, float min_value, float max_value);

/// Compute min 2D coordinates for the data (always {0, 0}).
core::Tensor GetMinBound() const {
Expand Down
2 changes: 1 addition & 1 deletion cpp/open3d/t/geometry/kernel/GeometryMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ __device__ inline float atomicMaxf(float *addr, float value) {
}
#endif

OPEN3D_HOST_DEVICE inline int sign(int x) {
OPEN3D_HOST_DEVICE inline int Sign(int x) {
return (x > 0) ? 1 : ((x < 0) ? -1 : 0);
}

Expand Down
16 changes: 14 additions & 2 deletions cpp/open3d/t/geometry/kernel/ImageImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ namespace geometry {
namespace kernel {
namespace image {

#ifndef __CUDACC__
using std::isinf;
using std::isnan;
#endif

#ifdef __CUDACC__
void ClipTransformCUDA
#else
Expand Down Expand Up @@ -173,15 +178,23 @@ void CreateVertexMapCPU
core::kernel::CUDALauncher launcher;
#else
core::kernel::CPULauncher launcher;
using std::isinf;
using std::isnan;
#endif
launcher.LaunchGeneralKernel(n, [=] OPEN3D_DEVICE(int64_t workload_idx) {
auto is_invalid = [invalid_fill] OPEN3D_DEVICE(float v) {
if (isinf(invalid_fill)) return isinf(v);
if (isnan(invalid_fill)) return isnan(v);
return v == invalid_fill;
};

int64_t y = workload_idx / cols;
int64_t x = workload_idx % cols;

float d = *src_indexer.GetDataPtrFromCoord<float>(x, y);

float* vertex = dst_indexer.GetDataPtrFromCoord<float>(x, y);
if (d != invalid_fill) {
if (!is_invalid(d)) {
ti.Unproject(static_cast<float>(x), static_cast<float>(y), d,
vertex + 0, vertex + 1, vertex + 2);
} else {
Expand All @@ -191,7 +204,6 @@ void CreateVertexMapCPU
}
});
}

#ifdef __CUDACC__
void CreateNormalMapCUDA
#else
Expand Down
6 changes: 3 additions & 3 deletions cpp/open3d/t/geometry/kernel/TSDFVoxel.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ inline OPEN3D_DEVICE voxel_t* DeviceGetVoxelAt(
int yn = (yo + resolution) % resolution;
int zn = (zo + resolution) % resolution;

int64_t dxb = sign(xo - xn);
int64_t dyb = sign(yo - yn);
int64_t dzb = sign(zo - zn);
int64_t dxb = Sign(xo - xn);
int64_t dyb = Sign(yo - yn);
int64_t dzb = Sign(zo - zn);

int64_t nb_idx = (dxb + 1) + (dyb + 1) * 3 + (dzb + 1) * 9;

Expand Down
6 changes: 3 additions & 3 deletions cpp/open3d/t/geometry/kernel/TSDFVoxelGridImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1250,9 +1250,9 @@ void RayCastCPU
int y_vn = (y_v + block_resolution) % block_resolution;
int z_vn = (z_v + block_resolution) % block_resolution;

int dx_b = sign(x_v - x_vn);
int dy_b = sign(y_v - y_vn);
int dz_b = sign(z_v - z_vn);
int dx_b = Sign(x_v - x_vn);
int dy_b = Sign(y_v - y_vn);
int dz_b = Sign(z_v - z_vn);

if (dx_b == 0 && dy_b == 0 && dz_b == 0) {
return voxel_block_buffer_indexer
Expand Down
Loading