SVO學習日記 2 2021 1 16

2021-10-16 04:58:15 字數 1709 閱讀 4027

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

namespace svo

//析構函式,主要作用是刪除幀上的特徵點

frame::

~frame()

);}//初始化幀

void frame::

initframe

(const cv::mat& img));

//建立影象金字塔

frame_utils::

createimgpyramid

(img,

max(config::

npyrlevels()

,config::

kltmaxlevel()

+1),img_pyr_);}

//設定關鍵幀

void frame::

setkeyframe()

//向影象上新增特徵點ftr

void frame::

addfeature

(feature* ftr)

//刪除沒有3d點的特徵

void frame::

setkeypoints()

);}//挑選並檢查這些點

void frame::

checkkeypoints

(feature* ftr)

//右上角的點

if(ftr -

> px[0]

>= cu && ftr -

> px[1]

< cv)

//左上角的點

if(ftr -

> px[0]

< cu && ftr -

> px[1]

< cv)

//左下角的點

if(ftr -

> px[0]

< cu && ftr -

> px[1]

>= cv)

}//刪除一些指定的特徵點

void frame::

removekeypoint

(feature* ftr)})

;if(found)

setkeypoints()

;}//判斷是否可見,存在於相機裡

bool frame::

isvisible

(const vector3d& xyz_w)

const

namespace frame_utils

}//獲得場景深度,傳入,幀,深度均值,深度最小值

bool

getscenedepth

(const frame& frame,

double

& depth_mean,

double

& depth_min)}if

(depth_vec.

empty()

)//獲得深度的均值

depth_mean = vk::

getmedian

(depth_vec)

;return

true;}

}}

SVO學習日記 8 2021 2 1

ifndef svo pose optimizer h define svo pose optimizer h include namespace svo endif include include include include include include include namespace ...

SVO學習日記 13 2021 2 22

include include include include include include include include include include include include include include include include include include includ...

SVO學習日記 14 2021 2 23

做了兩件事 1.通過影象對齊,計算乙個粗糙的位姿 2.建立乙個當前幀的區域性地圖,根據地圖對比位姿進一步優化 二.影象對齊 1.目的 迭代計算幀間位姿 解釋 用於影象對齊的地圖點是上一幀能看到的地圖點,我們知道影象幀間變換比較小,有理由相信上一幀所看到的場景大部分相同 過程 1 找到前一幀看到的地圖...