Skip to content

Commit c2082bd

Browse files
committed
Fix pixel rounding in revised partial mask condition
1 parent 1d03fba commit c2082bd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/torchhull/_C/src/visual_hull_cuda.cu

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,8 @@ classify_children_partial(const torch::PackedTensorAccessor64<int64_t, 1, torch:
355355
bb_max.x = fmaxf(bb_max.x, v_pixel.x);
356356
bb_max.y = fmaxf(bb_max.y, v_pixel.y);
357357

358-
if (!in_image(v_pixel.y, v_pixel.x, H, W, 1))
358+
auto v_pixel_rounded = glm::i64vec2{ roundf(v_pixel.x), roundf(v_pixel.y) };
359+
if (!in_image(v_pixel_rounded.y, v_pixel_rounded.x, H, W, 1))
359360
{
360361
fully_inside = false;
361362
}

0 commit comments

Comments
 (0)