doc_quad/geom/mod.rs
1// src/geom/mod.rs
2pub mod simplify;
3pub mod validate;
4pub mod transform;
5
6use glam::Vec2;
7
8/// 代表检测到的文档四边形。
9///
10/// 顶点顺序固定为 [左上, 右上, 右下, 左下](图像坐标系,y 向下)。
11#[derive(Debug, Clone)]
12pub struct Quadrilateral {
13 /// 顶点数组,顺序:[左上, 右上, 右下, 左下]
14 pub points: [Vec2; 4],
15 /// 四边形围成的面积(像素²)
16 pub area: f32,
17 /// 置信度评分(0.0 ~ 1.0)
18 pub score: f32,
19}