ReUseX  0.0.5
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
segment_panorama.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// SAM3-on-360: segment an equirectangular panorama by tiling it into
6// perspective (pinhole) views the segmenter consumes at its native
7// resolution, running the UNMODIFIED SAM3 model on each tile, and stitching
8// the per-tile CV_32S label maps back into one equirect label image.
9//
10// This reuses geometry::overlapping_views / stitch_labels_to_equirect for the
11// spherical geometry and the tensor_rt SAM3 forward() path for inference; it
12// does not reimplement either.
13
14#pragma once
15
16#include "reusex/vision/IModel.hpp"
17
18#include <opencv2/core.hpp>
19
20#include <string>
21#include <vector>
22
23namespace reusex::vision {
24
27 int n_yaw = 8;
28 double fov_deg = 90.0;
29 int tile = 1008;
30 float confidence = 0.5f;
32 std::vector<std::string> prompts;
33};
34
43cv::Mat segment_panorama(IModel &model, const cv::Mat &equirect_bgr,
44 const SegmentPanoramaOptions &opts);
45
46} // namespace reusex::vision
cv::Mat segment_panorama(IModel &model, const cv::Mat &equirect_bgr, const SegmentPanoramaOptions &opts)
Segment a 360 equirectangular panorama with a SAM3 model.
Options controlling how a panorama is tiled and segmented.
std::vector< std::string > prompts
Text prompts (one class each). Empty => use the SAM3 default prompt list.
double fov_deg
per-tile horizontal FOV (overlap hides seams)
float confidence
detection confidence threshold
int n_yaw
number of equator tiles around the sphere
int tile
tile size in px (matches SAM3 native input)