(default) Monocular
| 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, |
nothing calls this directly
no test coverage detected