DrawResult代碼分析和記錄

1

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

input: point_cloud
output inlier_points , plane_center
簡單說明: 該函數(shù)主要是通過ransac方法從point_cloud中估計出來平面,然后將距離在一定閾值之內(nèi)的點選出來作為inlier_points,最后返回這些inlier_point的中心點(平均求得的點)

2

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

input:inlier_point
output: plane
這兩個函數(shù)都是通過inlier_points來估計平面點 DetectPlane結(jié)果會更好

3

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

input:point_cloud
output: inlier_point ,plane_center
該函數(shù)在有imu的情況下使用,很直接的通過z值來劃分區(qū)域得到不同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的主要函數(shù),

  • 如果有imu直接使用findGround找到水平面和中心點
  • 如果沒有imu,篩選調(diào)用findPlane函數(shù)找到平面和中心點
    調(diào)用drawGround將篩選出來的點繪制出來
    如果之前已經(jīng)有存在的box,調(diào)用drawBox函數(shù)將已有AR物體繪制出來
    如果有新的AR物體請求,調(diào)用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)

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關(guān)閱讀更多精彩內(nèi)容

  • 有人說,愛一個人就要大膽的說出來,藏在心里只會讓自己覺得沉重??梢灿械娜苏f,愛一個人就是時刻關(guān)注著她,她開心,...
    小眼睛的我閱讀 766評論 0 0
  • 新的一年 強烈的感覺到什么事都不能置身事外了 我媽每天都在說我在家算25歲了 然后我每次都要劍拔弩張的強調(diào) cuo...
    你在哪里天氣晴閱讀 201評論 0 0

友情鏈接更多精彩內(nèi)容