| 40 | namespace colmap { |
| 41 | |
| 42 | struct ImageReaderOptions { |
| 43 | // Root path to folder which contains the images. |
| 44 | std::filesystem::path image_path; |
| 45 | |
| 46 | // Optional root path to folder which contains image masks. For a given image, |
| 47 | // the corresponding mask must have the same sub-path below this root as the |
| 48 | // image has below image_path. The filename must be equal, aside from the |
| 49 | // added extension .png. For example, for an image image_path/abc/012.jpg, the |
| 50 | // mask would be mask_path/abc/012.jpg.png. No features will be extracted in |
| 51 | // regions where the mask image is black (pixel intensity value 0 in |
| 52 | // grayscale). |
| 53 | std::filesystem::path mask_path; |
| 54 | |
| 55 | // Optional path to an image file specifying a mask for all images. No |
| 56 | // features will be extracted in regions where the mask is black (pixel |
| 57 | // intensity value 0 in grayscale). |
| 58 | std::filesystem::path camera_mask_path; |
| 59 | |
| 60 | // Optional list of images to read. The list must contain the relative path |
| 61 | // of the images with respect to the image_path. |
| 62 | std::vector<std::string> image_names; |
| 63 | // Name of the camera model. |
| 64 | std::string camera_model = "SIMPLE_RADIAL"; |
| 65 | |
| 66 | // Manual specification of camera parameters. If empty, camera parameters |
| 67 | // will be extracted from EXIF, i.e. principal point and focal length. |
| 68 | std::string camera_params; |
| 69 | |
| 70 | // Whether to use the same camera for all images. |
| 71 | bool single_camera = false; |
| 72 | |
| 73 | // Whether to use the same camera for all images in the same sub-folder. |
| 74 | bool single_camera_per_folder = false; |
| 75 | // Whether to use a different camera for each image. |
| 76 | bool single_camera_per_image = false; |
| 77 | // Whether to explicitly use an existing camera for all images. Note that in |
| 78 | // this case the specified camera model and parameters are ignored. |
| 79 | int existing_camera_id = kInvalidCameraId; |
| 80 | |
| 81 | // If camera parameters are not specified manually and the image does not |
| 82 | // have focal length EXIF information, the focal length is set to the |
| 83 | // value `default_focal_length_factor * max(width, height)`. |
| 84 | double default_focal_length_factor = 1.2; |
| 85 | |
| 86 | // Whether to read images as grayscale or RGB. |
| 87 | bool as_rgb = false; |
| 88 | |
| 89 | bool Check() const; |
| 90 | }; |
| 91 | |
| 92 | // Recursively iterate over the images in a directory. Skips an image if it |
| 93 | // already exists in the database. Extracts the camera intrinsics from EXIF and |
no outgoing calls
no test coverage detected