10 #include "pipelines/image.h"
15 namespace reconstruction {
20 static const std::unordered_map<std::string, std::string>
23 "The input path containing cameras.bin/txt, images.bin/txt "
24 "and points3D.bin/txt."},
26 "The output path containing target cameras.bin/txt, "
27 "images.bin/txt and points3D.bin/txt."},
28 {
"min_focal_length_ratio",
29 "Minimum ratio of focal length over minimum sensor "
31 {
"max_focal_length_ratio",
32 "Maximum ratio of focal length over maximum sensor "
35 "Maximum magnitude of each extra parameter."},
36 {
"min_num_observations",
"The maximum number of observations."},
38 "Path to text file containing one image_id to delete per "
41 "Path to text file containing one image name to delete per "
44 "A text file path containing "
45 "stereo image pair names from. The text file is expected to "
46 "have one image pair per line, e.g.:\n"
47 "image_name1.jpg image_name2.jpg\n"
48 "image_name3.jpg image_name4.jpg\n"
49 "image_name5.jpg image_name6.jpg"},
51 "The amount of blank pixels in the undistorted image in the "
54 "Minimum scale change of camera used to satisfy the blank "
57 "Maximum scale change of camera used to satisfy the blank "
60 "Maximum image size in terms of width or height of the "
61 "undistorted camera."},
63 "Output file format: supported values are {'COLMAP', 'PMVS', "
66 "A text file path containing image file path."},
68 "Supported copy policy are {copy, soft-link, hard-link}."},
69 {
"num_patch_match_src_images",
70 "The number of patch match source images."},
72 "The value in the range [0, 1] that define the ROI (region "
73 "of interest) minimum x in original image."},
75 "The value in the range [0, 1] that define the ROI (region of "
76 "interest) minimum y in original image."},
78 "The value in the range [0, 1] that define the ROI (region "
79 "of interest) maximum x in original image."},
81 "The value in the range [0, 1] that define the ROI (region of "
82 "interest) maximum y in original image."}};
85 m.def(
"delete_image", &DeleteImage,
86 py::call_guard<py::gil_scoped_release>(),
87 "Function for the deletion of images",
"input_path"_a,
88 "output_path"_a,
"image_ids_path"_a =
"",
"image_names_path"_a =
"");
92 m.def(
"filter_image", &FilterImage,
93 py::call_guard<py::gil_scoped_release>(),
94 "Function for the filtering of images",
"input_path"_a,
95 "output_path"_a,
"min_focal_length_ratio"_a = 0.1,
96 "max_focal_length_ratio"_a = 10.0,
"max_extra_param"_a = 100.0,
97 "min_num_observations"_a = 10);
101 m.def(
"rectify_image", &RectifyImage,
102 py::call_guard<py::gil_scoped_release>(),
103 "Function for the rectification of images",
"image_path"_a,
104 "input_path"_a,
"output_path"_a,
"stereo_pairs_list"_a,
105 "blank_pixels"_a = 0.0,
"min_scale"_a = 0.2,
"max_scale"_a = 2.0,
106 "max_image_size"_a = -1);
110 m.def(
"register_image", &RegisterImage,
111 py::call_guard<py::gil_scoped_release>(),
112 "Function for the registeration of images",
"database_path"_a,
113 "input_path"_a,
"output_path"_a,
118 m.def(
"undistort_image", &UndistortImage,
119 py::call_guard<py::gil_scoped_release>(),
120 "Function for the undistortion of images",
"image_path"_a,
121 "input_path"_a,
"output_path"_a,
"image_list_path"_a =
"",
122 "output_type"_a =
"COLMAP",
"copy_policy"_a =
"copy",
123 "num_patch_match_src_images"_a = 20,
"blank_pixels"_a = 0.0,
124 "min_scale"_a = 0.2,
"max_scale"_a = 2.0,
"max_image_size"_a = -1,
125 "roi_min_x"_a = 0.0,
"roi_min_y"_a = 0.0,
"roi_max_x"_a = 1.0,
126 "roi_max_y"_a = 1.0);
130 m.def(
"undistort_image_standalone", &UndistortImageStandalone,
131 py::call_guard<py::gil_scoped_release>(),
132 "Function for the standalone undistortion of images",
"image_path"_a,
133 "input_path"_a,
"output_path"_a,
"blank_pixels"_a = 0.0,
134 "min_scale"_a = 0.2,
"max_scale"_a = 2.0,
"max_image_size"_a = -1,
135 "roi_min_x"_a = 0.0,
"roi_min_y"_a = 0.0,
"roi_max_x"_a = 1.0,
136 "roi_max_y"_a = 1.0);
142 py::module m_submodule = m.def_submodule(
"image",
"Reconstruction Images.");
std::shared_ptr< core::Tensor > image
void FunctionDocInject(py::module &pybind_module, const std::string &function_name, const std::unordered_map< std::string, std::string > &map_parameter_body_docs)
void pybind_image_methods(py::module &m)
static const std::unordered_map< std::string, std::string > map_shared_argument_docstrings
void pybind_image(py::module &m)
Generic file read and write utility for python interface.
colmap::IncrementalMapperOptions IncrementalMapperOptions