ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
line.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <Eigen/Core>
11 
12 #include "util/alignment.h"
13 #include "util/bitmap.h"
14 
15 namespace colmap {
16 
17 struct LineSegment {
18  Eigen::Vector2d start;
19  Eigen::Vector2d end;
20 };
21 
23  HORIZONTAL = 1,
24  VERTICAL = -1,
25  UNDEFINED = 0,
26 };
27 
28 // Detect line segments in the given bitmap image.
29 std::vector<LineSegment> DetectLineSegments(const Bitmap& bitmap,
30  const double min_length = 3);
31 
32 // Classify line segments into horizontal/vertical.
33 std::vector<LineSegmentOrientation> ClassifyLineSegmentOrientations(
34  const std::vector<LineSegment>& segments,
35  const double tolerance = 0.25);
36 
37 } // namespace colmap
38 
39 // EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION_CUSTOM(colmap::LineSegment)
std::vector< LineSegment > DetectLineSegments(const Bitmap &bitmap, const double min_length)
Definition: line.cc:42
std::vector< LineSegmentOrientation > ClassifyLineSegmentOrientations(const std::vector< LineSegment > &segments, const double tolerance)
Definition: line.cc:79
LineSegmentOrientation
Definition: line.h:22
Eigen::Vector2d end
Definition: line.h:19
Eigen::Vector2d start
Definition: line.h:18