MCPcopy Create free account
hub / github.com/PeterFWS/Structure-PLP-SLAM / frame

Method frame

src/PLPSLAM/data/frame.cc:49–87  ·  view source on GitHub ↗

(default) Monocular

Source from the content-addressed store, hash-verified

47
48 // (default) Monocular
49 frame::frame(const cv::Mat &img_gray, const double timestamp,
50 feature::orb_extractor *extractor, bow_vocabulary *bow_vocab,
51 camera::base *camera, const float depth_thr,
52 const cv::Mat &mask)
53 : id_(next_id_++), bow_vocab_(bow_vocab), extractor_(extractor), extractor_right_(nullptr),
54 timestamp_(timestamp), camera_(camera), depth_thr_(depth_thr)
55 {
56 // Get ORB scale
57 update_orb_info();
58
59 // Extract ORB feature
60 extract_orb(img_gray, mask);
61 num_keypts_ = keypts_.size();
62 if (keypts_.empty())
63 {
64 spdlog::warn("frame {}: cannot extract any keypoints", id_);
65 }
66
67 // Undistort keypoints
68 camera_->undistort_keypoints(keypts_, undist_keypts_);
69
70 // Ignore stereo parameters
71 stereo_x_right_ = std::vector<float>(num_keypts_, -1);
72 depths_ = std::vector<float>(num_keypts_, -1);
73
74 // FW: Ignore stereo parameters of line feature
75 _stereo_x_right_cooresponding_to_keylines = std::vector<std::pair<float, float>>(num_keypts_, std::make_pair(-1, -1));
76 _depths_cooresponding_to_keylines = std::vector<std::pair<float, float>>(num_keypts_, std::make_pair(-1, -1));
77
78 // Convert to bearing vector
79 camera->convert_keypoints_to_bearings(undist_keypts_, bearings_);
80
81 // Initialize association with 3D points
82 landmarks_ = std::vector<landmark *>(num_keypts_, nullptr);
83 outlier_flags_ = std::vector<bool>(num_keypts_, false);
84
85 // Assign all the keypoints into grid
86 assign_keypoints_to_grid(camera_, undist_keypts_, keypt_indices_in_cells_);
87 }
88
89 // FW: Monocular + planar segmentation
90 frame::frame(const cv::Mat &img_gray, const double timestamp, const cv::Mat &img_seg_mask,

Callers

nothing calls this directly

Calls 9

warnFunction · 0.85
assign_keypoints_to_gridFunction · 0.85
matchMethod · 0.80
dotMethod · 0.80
sizeMethod · 0.45
emptyMethod · 0.45
undistort_keypointsMethod · 0.45
computeMethod · 0.45

Tested by

no test coverage detected