|
| | Line () |
| | 线类的默认构造函数
|
| |
| | Line (int pt1_x, int pt1_y, int pt2_x, int pt2_y) |
| | 线类的带参构造函数
|
| |
| | Line (const std::initializer_list< int > &initial_list) |
| | 线类的初始化列表构造函数
|
| |
| | Line (const Point2i &pt1, const Point2i &pt2) |
| | 线类的带参构造函数
|
| |
| | Line (const cv::Vec4i &line) |
| | 线类的带参构造函数
|
| |
| | Line (const std::vector< int > &list) |
| | 线类的带参构造函数
|
| |
| | Line (const Line &line) |
| | 线类的拷贝构造函数
|
| |
| | ~Line () |
| | 线类的析构函数
|
| |
| | operator cv::Vec4i () const |
| | 将线类转换为 OpenCV 的 cv::Vec4i 类型
|
| |
| | operator std::vector< int > () const |
| | 将线类转换为 std::vector<int> 类型
|
| |
| int & | operator[] (size_t index) |
| | 线类重载方括号运算符
|
| |
| const int & | operator[] (size_t index) const |
| | 线类重载方括号运算符
|
| |
| LineType | Type () const |
| | 获取线类型
|
| |
| double | Length (bool is_rough=false) const |
| | 获取线的长度
|
| |
| GEEquation | GECoefficients () const |
| | 计算线的一般方程系数
|
| |
| SIEquation | SICoefficients () const |
| | 计算线的斜截式系数
|
| |
| template<typename T > |
| double | DistanceTo (const Point< T > &pt) const |
| | 计算点到直线的距离
|
| |
| double | DistanceTo (const Line &line, LineDistanceType type) const |
| | 计算线到线的距离
|
| |
| Line & | Translate (int dx, int dy) |
| | 线的坐标平移操作
|
| |
| Line & | Scale (double factor, bool round=true) |
| | 线的坐标缩放操作
|
| |
| template<typename T > |
| Line & | Rotate (double angle, const Point< T > ¢er={0, 0}) |
| | 线的坐标旋转操作
|
| |
| Line & | TidyLine () |
| | 整理线的端点顺序
|
| |
| Point2d | Intersect (const Line &line) const |
| | 计算两线的交点
|
| |
| Point2d | Intersect (const GEEquation &ge) const |
| | 通过另一条线的一般方程计算两线的交点
|
| |
| Point2d | Intersect (const SIEquation &si) const |
| | 通过另一条线的斜截式方程计算两线的交点
|
| |
| Point2d | Midpoint () const |
| | 获取线段中点坐标
|
| |
| double | X (Statistic type) const |
| | 获取线的 X 坐标
|
| |
| double | Y (Statistic type) const |
| | 获取线的 Y 坐标
|
| |
| Line & | LimitX (const Interval &interval) |
| | 限制线的 x 坐标在指定区间范围内
|
| |
| Line & | LimitY (const Interval &interval) |
| | 限制线的 y 坐标在指定区间范围内
|
| |
| bool | InInterval (const Interval &x_interval, const Interval &y_interval) const |
| | 判断线是否在区间内
|
| |
| bool | IsIntersect (const Line &line, IntersectType type=INTERSECT_XY, bool is_include_boundaries=false) const |
| | 判断两线是否相交
|
| |
| bool | IsPoint () const |
| | 判断线是否是一个点
|
| |
| Line | SimpleConnect (const Line &line) const |
| | 简单合并线
|
| |
| bool | IsAligned (const Line &line, Position align_direction, int threshold=5) const |
| | 判断两根线是否对齐
|
| |
| bool | IsNear (const Line &line, double threshold=5.0, Statistic type=MAXIMUM) const |
| | 判断两线是否接近
|
| |
线类
该类表示二维空间中的一条两点构成的线段,提供了线段的一般方程和斜截式的表示方法,并包含了直线的各种操作和计算方法。
- 作者
- dreamy-xay
- 日期
- 2023-12-04
在文件 line.hpp 第 31 行定义.