ReUseX  0.0.5
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
reconcile_instances.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2025 Povl Filip Sonne-Frederiksen
2// SPDX-License-Identifier: GPL-3.0-or-later
3
4#pragma once
5
6#include "reusex/types/point_types.hpp"
7
8#include <cstdint>
9#include <functional>
10#include <map>
11#include <string>
12#include <vector>
13
14namespace reusex::geometry {
15
21 uint32_t instance_id = 0;
23 int point_count = 0;
24 std::string guid;
25 bool carried_over = false;
26 uint32_t matched_old_id = 0;
27};
28
31 uint32_t instance_id = 0;
33 std::string guid;
34 double best_overlap = 0.0;
35};
36
40 std::vector<ReconciledInstance> instances;
41 std::vector<OrphanedInstance> orphaned_old;
42 size_t matched_count = 0;
43 size_t fresh_count = 0;
44};
45
48 uint32_t instance_id = 0;
50 std::string guid;
51};
52
57 double min_overlap = 0.5;
59 unsigned int seed = 42;
60};
61
85 const CloudL &new_labels,
86 const std::vector<PriorInstance> &prior,
87 const std::map<uint32_t, uint32_t> &new_semantic,
88 const std::map<uint32_t, size_t> &new_sizes,
89 const std::function<std::string()> &make_guid,
90 const ReconcileOptions &opts = {});
91
92} // namespace reusex::geometry
ReconcileResult reconcile_instance_identities(const CloudL *old_labels, const CloudL &new_labels, const std::vector< PriorInstance > &prior, const std::map< uint32_t, uint32_t > &new_semantic, const std::map< uint32_t, size_t > &new_sizes, const std::function< std::string()> &make_guid, const ReconcileOptions &opts={})
Carry stable GUIDs across an instance-cloud regeneration.
pcl::PointCloud< LabelT > CloudL
A previous instance whose GUID could not be matched to any new instance.
double best_overlap
Best mutual overlap seen (for diagnostics).
Prior instance state (typically loaded from ProjectDB::instances()).
Options controlling instance identity reconciliation.
unsigned int seed
Fixed seed forwarded to GUID generation callers (not used internally).
double min_overlap
Minimum mutual point-set overlap (fraction of the smaller instance) for a new instance to inherit an ...
Result of reconciling a freshly-segmented instance set against a previous one.
std::vector< ReconciledInstance > instances
std::vector< OrphanedInstance > orphaned_old
Old GUIDs with no match.
A single reconciled instance: its (new) label value, the semantic class it belongs to,...
uint32_t matched_old_id
Old instance_id matched (0 = none).