DrawResult代码分析和记录

1

Vector3f DrawResult::findPlane(const vector<Vector3f> &point_cloud, vector<Vector3f> &inlier_points)

input: point_cloud
output inlier_points , plane_center
简单说明: 该函数主要是通过ransac方法从point_cloud中估计出来平面,然后将距离在一定阈值之内的点选出来作为inlier_points,最后返回这些inlier_point的中心点(平均求得的点)

2

Vector4f findPlane(const vector<Vector3f> &point_cloud);
Vector4f DetectPlane(const vector<Vector3f> &points_cloud);

input:inlier_point
output: plane
这两个函数都是通过inlier_points来估计平面点 DetectPlane结果会更好

3

Vector3f findGround(const vector<Vector3f> &point_cloud, vector<Vector3f> &inlier_points);

input:point_cloud
output: inlier_point ,plane_center
该函数在有imu的情况下使用,很直接的通过z值来划分区域得到不同z值所对应的水平面

4

void drawAR(cv::Mat &result, const vector<Vector3f> &point_cloud, Vector3f P_latest, Matrix3f R_latest, bool vins_update, bool has_imu = true);

input: image(result),point_cloud(3D),translation(P_latest),rotation(R_latest)
这个是绘制AR的主要函数,

  • 如果有imu直接使用findGround找到水平面和中心点
  • 如果没有imu,筛选调用findPlane函数找到平面和中心点
    调用drawGround将筛选出来的点绘制出来
    如果之前已经有存在的box,调用drawBox函数将已有AR物体绘制出来
    如果有新的AR物体请求,调用drawBox绘制,然后保存新的AR物体到GroundPoint里面

5

bool checkBorder(const cv::Point2f &pt)

input: image_point
output:is in image?

6

void DrawResult::drawBox(cv::Mat &result, Vector3f corner_0, Vector3f corner_x, Vector3f corner_y, Vector3f corner_z, float size, Vector3f P_latest, Matrix3f R_latest, bool inAR)

input : image(result) 一些AR物体的三维点,translation(P_latest) rotation(R_latest)

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 有人说,爱一个人就要大胆的说出来,藏在心里只会让自己觉得沉重。可也有的人说,爱一个人就是时刻关注着她,她开心,...
    小眼睛的我阅读 735评论 0 0
  • 新的一年 强烈的感觉到什么事都不能置身事外了 我妈每天都在说我在家算25岁了 然后我每次都要剑拔弩张的强调 cuo...
    你在哪里天气晴阅读 182评论 0 0