ReUseX  0.0.5
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
frame_visibility.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2025 Povl Filip Sonne-Frederiksen
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#pragma once
6
7#include <Eigen/Core>
8
9#include <atomic>
10#include <stdexcept>
11#include <vector>
12
13namespace reusex {
14class ProjectDB;
15}
16
17namespace reusex::core {
18
22 int frame_id = 0;
23 double u = 0.0;
24 double v = 0.0;
25 double depth =
26 0.0;
31 double centrality = 0.0;
32};
33
41 double max_depth = 0.0;
45 double margin_px = 0.0;
46};
47
81std::vector<FrameVisibility> visible_frames(const ProjectDB &db,
82 const Eigen::Vector3d &world_point,
83 const VisibilityQuery &query = {});
84
93std::vector<std::vector<FrameVisibility>>
95 const std::vector<Eigen::Vector3d> &world_points,
96 const VisibilityQuery &query = {});
97
116
123 Eigen::Vector3d anchor = Eigen::Vector3d::Zero();
124 std::vector<Eigen::Vector3d> samples;
125};
126
128class OperationCancelled : public std::runtime_error {
129 public:
130 using std::runtime_error::runtime_error;
131};
132
153std::vector<std::vector<FrameVisibility>>
155 const std::vector<VisibilityProbe> &probes,
156 const OcclusionQuery &query = {},
157 const std::atomic<bool> *cancel = nullptr);
158
159} // namespace reusex::core
Thrown by visible_frames_occluded() when its cancel flag is raised.
Wire form of one stored report PDF version — the ReportPdfVersion schema in ruxd's API contract (docs...
std::vector< FrameVisibility > visible_frames(const ProjectDB &db, const Eigen::Vector3d &world_point, const VisibilityQuery &query={})
Rank the posed sensor frames by how centrally a world point projects.
std::vector< std::vector< FrameVisibility > > visible_frames_batch(const ProjectDB &db, const std::vector< Eigen::Vector3d > &world_points, const VisibilityQuery &query={})
visible_frames() for many points at once.
std::vector< std::vector< FrameVisibility > > visible_frames_occluded(const ProjectDB &db, const std::vector< VisibilityProbe > &probes, const OcclusionQuery &query={}, const std::atomic< bool > *cancel=nullptr)
Occlusion-aware visible_frames_batch(): frames that actually see each probe, not merely frames whose ...
One frame in which a queried world point is visible, with the geometry of its projection.
double u
Projected pixel column (0 = left edge).
double v
Projected pixel row (0 = top edge).
double centrality
Normalised distance of the projection from the principal point: 0 at the principal point (most centra...
int frame_id
node_id of the sensor frame.
double depth
Point's depth in the camera optical frame, metres (> 0).
Tunables for visible_frames_occluded().
double depth_tolerance
A probe point counts as seen when its camera-frame depth is within this many metres of the frame's me...
bool keep_frames_without_depth
A frame with no depth image cannot be occlusion-tested.
VisibilityQuery visibility
The frustum test applied to each probe's anchor first.
int depth_search_radius
Also compare against depth pixels up to this many pixels away (in the depth image) and take the close...
What visible_frames_occluded() tests for one object: an anchor that decides the frustum test and the ...
std::vector< Eigen::Vector3d > samples
Tunables for visible_frames().
double max_depth
Reject frames where the point is farther than this many metres from the camera.
double margin_px
Shrink the accepted image region by this many pixels on every edge, so a point grazing the border is ...