| 25 | }; |
| 26 | |
| 27 | struct Image { |
| 28 | Image() : image_id(-1), file_name("") {} |
| 29 | Image(image_t img_id, camera_t cam_id, std::string file_name) |
| 30 | : image_id(img_id), file_name(file_name), camera_id(cam_id) {} |
| 31 | |
| 32 | // Basic information |
| 33 | // image_id, file_name need to be specified at construction time |
| 34 | const image_t image_id; |
| 35 | const std::string file_name; |
| 36 | |
| 37 | // The id of the camera |
| 38 | camera_t camera_id; |
| 39 | |
| 40 | // whether the image is within the largest connected component |
| 41 | bool is_registered = false; |
| 42 | int cluster_id = -1; |
| 43 | |
| 44 | // The pose of the image, defined as the transformation from world to camera. |
| 45 | Rigid3d cam_from_world; |
| 46 | |
| 47 | // Gravity information |
| 48 | GravityInfo gravity_info; |
| 49 | |
| 50 | // Distorted feature points in pixels. |
| 51 | std::vector<Eigen::Vector2d> features; |
| 52 | // Normalized feature rays, can be obtained by calling UndistortImages. |
| 53 | std::vector<Eigen::Vector3d> features_undist; |
| 54 | |
| 55 | // Methods |
| 56 | inline Eigen::Vector3d Center() const; |
| 57 | }; |
| 58 | |
| 59 | Eigen::Vector3d Image::Center() const { |
| 60 | return cam_from_world.rotation.inverse() * -cam_from_world.translation; |
no outgoing calls
no test coverage detected