Skip to content

ImageReader

Michal W. Tarnowski edited this page Oct 6, 2021 · 1 revision

Recursively iterate over the images in a directory. Skips an image if it already exists in the database. Extracts the camera intrinsics from EXIF and writes the camera information to the database.

ImageReader.mask_path

Optional root path to folder which contains image masks. For a given image, the corresponding mask must have the same sub-path below this root as the image has below image_path. The filename must be equal, aside from the added extension .png. For example, for an image image_path/abc/012.jpg, the mask would be mask_path/abc/012.jpg.png. No features will be extracted in regions where the mask image is black (pixel intensity value 0 in grayscale).

ImageReader.camera_model

default: SIMPLE_RADIAL
possible: SIMPLE_PINHOLE, PINHOLE, SIMPLE_RADIAL, RADIAL, OPENCV, OPENCV_FISHEYE, FULL_OPENCV, FOV, SIMPLE_RADIAL_FISHEYE, RADIAL_FISHEYE, THIN_PRISM_FISHEYE
Name of the camera model. See: Camera Models

ImageReader.single_camera

default: 0 (disabled)
Whether to use the same camera for all images.

ImageReader.single_camera_per_folder

default: 0 (disabled)
Whether to use the same camera for all images in the same sub-folder.

ImageReader.single_camera_per_image

default: 0 (disabled)
Whether to use a different camera for each image.

ImageReader.existing_camera_id

default: -1
Whether to explicitly use an existing camera for all images. Note that in this case the specified camera model and parameters are ignored.

ImageReader.camera_params

Manual specification of camera parameters. If empty, camera parameters will be extracted from EXIF, i.e. principal point and focal length.

ImageReader.default_focal_length_factor

default: 1.2
If camera parameters are not specified manually and the image does not have focal length EXIF information, the focal length is set to the value default_focal_length_factor * max(width, height).

ImageReader.camera_mask_path

Optional path to an image file specifying a mask for all images. No features will be extracted in regions where the mask is black (pixel intensity value 0 in grayscale).