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 <array>
8
#include <cstddef>
9
#include <filesystem>
10
#include <optional>
11
#include <string>
12
#include <vector>
13
14
namespace
reusex
{
15
class
ProjectDB
;
16
}
17
18
namespace
reusex::io
{
19
21
struct
ArkitPincam
{
22
double
width
= 0,
height
= 0;
23
double
fx
= 0,
fy
= 0,
cx
= 0,
cy
= 0;
24
};
25
29
ArkitPincam
parse_pincam
(
const
std::string &line);
30
41
std::array<double, 16>
arkit_traj_to_optical_world
(
double
rx,
double
ry,
42
double
rz,
double
tx,
43
double
ty,
double
tz);
44
47
struct
ArkitPoseSample
{
48
double
ts
= 0;
49
std::array<double, 16>
pose
{};
50
};
51
55
using
ArkitTrajectory
= std::vector<ArkitPoseSample>;
56
61
constexpr
double
kArkitMaxPoseGap
= 0.5;
// seconds
62
68
ArkitTrajectory
load_arkit_trajectory
(
const
std::filesystem::path &traj_path);
69
90
std::optional<std::array<double, 16>>
91
interpolate_pose
(
const
ArkitTrajectory
&traj,
double
ts,
92
double
max_gap =
kArkitMaxPoseGap
);
93
98
bool
parse_frame_timestamp
(
const
std::filesystem::path &file,
double
&ts);
99
131
std::size_t
import_arkitscenes
(
ProjectDB
&db,
132
const
std::filesystem::path &scene_dir);
133
134
}
// namespace reusex::io
reusex::ProjectDB
Definition
ProjectDB.hpp:43
reusex::io
Definition
arkitscenes.hpp:18
reusex::io::kArkitMaxPoseGap
constexpr double kArkitMaxPoseGap
Largest bracketing interval interpolate_pose will interpolate across.
Definition
arkitscenes.hpp:61
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::import_arkitscenes
std::size_t import_arkitscenes(ProjectDB &db, const std::filesystem::path &scene_dir)
Import an ARKitScenes scene (lowres iPad-LiDAR streams) into a ReUseX project.
reusex::io::ArkitTrajectory
std::vector< ArkitPoseSample > ArkitTrajectory
Trajectory as a timestamp-ascending sequence of camera->world samples.
Definition
arkitscenes.hpp:55
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:21
reusex::io::ArkitPincam::fy
double fy
Definition
arkitscenes.hpp:23
reusex::io::ArkitPincam::cy
double cy
Definition
arkitscenes.hpp:23
reusex::io::ArkitPincam::width
double width
Definition
arkitscenes.hpp:22
reusex::io::ArkitPincam::fx
double fx
Definition
arkitscenes.hpp:23
reusex::io::ArkitPincam::height
double height
Definition
arkitscenes.hpp:22
reusex::io::ArkitPincam::cx
double cx
Definition
arkitscenes.hpp:23
reusex::io::ArkitPoseSample
One trajectory sample: a device-relative timestamp and the optical-to-world (camera->world) pose at t...
Definition
arkitscenes.hpp:47
reusex::io::ArkitPoseSample::ts
double ts
Definition
arkitscenes.hpp:48
reusex::io::ArkitPoseSample::pose
std::array< double, 16 > pose
Definition
arkitscenes.hpp:49
libs
reusex
include
io
arkitscenes.hpp
Generated by
1.17.0