ReUseX
0.0.5
3D Point Cloud Processing for Building Reuse
Toggle main menu visibility
Loading...
Searching...
No Matches
instance_crop.hpp
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2026 Povl Filip Sonne-Frederiksen
2
//
3
// SPDX-License-Identifier: GPL-3.0-or-later
4
5
#pragma once
6
7
// Pinhole projection of a set of world-space points into a sensor frame, and
8
// selection of the best view + 2D bounding box for cropping an instance out of
9
// its color image (#373).
10
//
11
// The projection math mirrors what vision/project.cpp does with rtabmap
12
// (world -> base via pose^-1, base -> camera via localTransform^-1, then a
13
// pinhole divide), but is reimplemented here with plain Eigen so it is small,
14
// dependency-light and directly unit-testable — no rtabmap CameraModel, no
15
// z-buffer. We only need where the points land, not a full depth render.
16
17
#include "reusex/core/SensorIntrinsics.hpp"
18
19
#include <Eigen/Core>
20
21
#include <array>
22
#include <cstddef>
23
#include <optional>
24
#include <vector>
25
26
namespace
reusex::vision
{
27
30
struct
ProjectedBox
{
31
int
x_min
= 0,
y_min
= 0,
x_max
= 0,
y_max
= 0;
32
int
in_bounds
= 0;
33
};
34
44
std::optional<ProjectedBox>
45
project_points_to_box
(
const
std::vector<Eigen::Vector3f> &world_points,
46
const
std::array<double, 16> &pose,
47
const
core::SensorIntrinsics
&intrinsics,
int
image_width,
48
int
image_height);
49
50
}
// namespace reusex::vision
reusex::vision
Definition
annotate.hpp:12
reusex::vision::project_points_to_box
std::optional< ProjectedBox > project_points_to_box(const std::vector< Eigen::Vector3f > &world_points, const std::array< double, 16 > &pose, const core::SensorIntrinsics &intrinsics, int image_width, int image_height)
Project world_points into the camera described by pose (row-major 4x4 base-to-world) and intrinsics,...
reusex::core::SensorIntrinsics
Lightweight camera intrinsics replacing rtabmap::CameraModel in downstream code.
Definition
SensorIntrinsics.hpp:14
reusex::vision::ProjectedBox
A projected 2D bounding box of an instance in one frame, with the count of points that landed inside ...
Definition
instance_crop.hpp:30
reusex::vision::ProjectedBox::y_max
int y_max
Definition
instance_crop.hpp:31
reusex::vision::ProjectedBox::x_max
int x_max
Definition
instance_crop.hpp:31
reusex::vision::ProjectedBox::x_min
int x_min
Definition
instance_crop.hpp:31
reusex::vision::ProjectedBox::y_min
int y_min
Definition
instance_crop.hpp:31
reusex::vision::ProjectedBox::in_bounds
int in_bounds
Number of points projected inside the image.
Definition
instance_crop.hpp:32
libs
reusex
include
vision
instance_crop.hpp
Generated by
1.18.0