ReUseX
0.0.5
3D Point Cloud Processing for Building Reuse
Toggle main menu visibility
Loading...
Searching...
No Matches
arkitscenes.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 "reusex/io/panoramas.hpp"
8
9
#include <array>
10
#include <cstddef>
11
#include <filesystem>
12
#include <optional>
13
#include <string>
14
#include <vector>
15
16
namespace
reusex
{
17
class
ProjectDB
;
18
}
19
20
namespace
reusex::io
{
21
23
struct
ArkitPincam
{
24
double
width
= 0,
height
= 0;
25
double
fx
= 0,
fy
= 0,
cx
= 0,
cy
= 0;
26
};
27
31
ArkitPincam
parse_pincam
(
const
std::string &line);
32
43
std::array<double, 16>
arkit_traj_to_optical_world
(
double
rx,
double
ry,
44
double
rz,
double
tx,
45
double
ty,
double
tz);
46
49
struct
ArkitPoseSample
{
50
double
ts
= 0;
51
std::array<double, 16>
pose
{};
52
};
53
57
using
ArkitTrajectory
= std::vector<ArkitPoseSample>;
58
63
constexpr
double
kArkitMaxPoseGap
= 0.5;
// seconds
64
70
ArkitTrajectory
load_arkit_trajectory
(
const
std::filesystem::path &traj_path);
71
92
std::optional<std::array<double, 16>>
93
interpolate_pose
(
const
ArkitTrajectory
&traj,
double
ts,
94
double
max_gap =
kArkitMaxPoseGap
);
95
100
bool
parse_frame_timestamp
(
const
std::filesystem::path &file,
double
&ts);
101
138
std::size_t
import_arkitscenes
(
ProjectDB
&db,
139
const
std::filesystem::path &scene_dir,
140
const
ImportPanoramasOptions
&pano_opts = {});
141
142
}
// namespace reusex::io
reusex::ProjectDB
Definition
ProjectDB.hpp:45
reusex::io
Definition
arkitscenes.hpp:20
reusex::io::kArkitMaxPoseGap
constexpr double kArkitMaxPoseGap
Largest bracketing interval interpolate_pose will interpolate across.
Definition
arkitscenes.hpp:63
reusex::io::parse_pincam
ArkitPincam parse_pincam(const std::string &line)
Parse a single ARKitScenes .pincam line: width height fx fy cx cy (six whitespace-separated doubles).
reusex::io::parse_frame_timestamp
bool parse_frame_timestamp(const std::filesystem::path &file, double &ts)
Extract the timestamp encoded in an ARKitScenes stream filename such as 41069021_452....
reusex::io::load_arkit_trajectory
ArkitTrajectory load_arkit_trajectory(const std::filesystem::path &traj_path)
Parse the trajectory file into timestamp-sorted camera->world poses.
reusex::io::arkit_traj_to_optical_world
std::array< double, 16 > arkit_traj_to_optical_world(double rx, double ry, double rz, double tx, double ty, double tz)
Convert one ARKitScenes trajectory pose to an optical-to-world 4x4 matrix (row-major,...
reusex::io::ArkitTrajectory
std::vector< ArkitPoseSample > ArkitTrajectory
Trajectory as a timestamp-ascending sequence of camera->world samples.
Definition
arkitscenes.hpp:57
reusex::io::import_arkitscenes
std::size_t import_arkitscenes(ProjectDB &db, const std::filesystem::path &scene_dir, const ImportPanoramasOptions &pano_opts={})
Import an ARKitScenes scene (lowres iPad-LiDAR streams) into a ReUseX project.
reusex::io::interpolate_pose
std::optional< std::array< double, 16 > > interpolate_pose(const ArkitTrajectory &traj, double ts, double max_gap=kArkitMaxPoseGap)
Interpolate the camera->world pose at ts from the bracketing trajectory samples: SLERP on the rotatio...
reusex
Definition
component_record.hpp:12
reusex::io::ArkitPincam
Parsed contents of an ARKitScenes .pincam intrinsics line.
Definition
arkitscenes.hpp:23
reusex::io::ArkitPincam::fy
double fy
Definition
arkitscenes.hpp:25
reusex::io::ArkitPincam::cy
double cy
Definition
arkitscenes.hpp:25
reusex::io::ArkitPincam::width
double width
Definition
arkitscenes.hpp:24
reusex::io::ArkitPincam::fx
double fx
Definition
arkitscenes.hpp:25
reusex::io::ArkitPincam::height
double height
Definition
arkitscenes.hpp:24
reusex::io::ArkitPincam::cx
double cx
Definition
arkitscenes.hpp:25
reusex::io::ArkitPoseSample
One trajectory sample: a device-relative timestamp and the optical-to-world (camera->world) pose at t...
Definition
arkitscenes.hpp:49
reusex::io::ArkitPoseSample::ts
double ts
Definition
arkitscenes.hpp:50
reusex::io::ArkitPoseSample::pose
std::array< double, 16 > pose
Definition
arkitscenes.hpp:51
reusex::io::ImportPanoramasOptions
Controls auto-discovery and import of companion 360° panoramas.
Definition
panoramas.hpp:18
libs
reusex
include
io
arkitscenes.hpp
Generated by
1.18.0