You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
772 B
C

2 months ago
// filter.h - 点云 XY 过滤(原点无效点 + 多边形过滤)
#ifndef FILTER_H
#define FILTER_H
#include <vector>
#include <utility>
// 判定原点(0,0)附近的无效雷达噪点(x和y同时接近0)
bool is_origin_point(double x_mm, double y_mm);
// 射线法判断点是否在多边形内(支持凹/凸多边形)
// px,py: 点坐标, poly: 顶点数组(与点坐标相同单位), n: 顶点数
bool point_in_polygon(double px, double py,
const std::vector<std::pair<double, double>>& poly, int n);
// 综合过滤: 通过(FILTER_ENABLE && cfg.filter.poly_n)判定该 XY 点是否保留
2 months ago
// 返回 true=保留, false=丢弃(原点噪点或超出多边形)
bool xy_filter_allowed(double x_mm, double y_mm);
#endif // FILTER_H