Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pinard Clement
drone-depth-validation-set
Commits
ac58f29d
Commit
ac58f29d
authored
Oct 25, 2020
by
Clément Pinard
Browse files
Add max depth for stereo
parent
9c57fdc8
Changes
4
Hide whitespace changes
Inline
Side-by-side
cli_utils.py
View file @
ac58f29d
...
...
@@ -62,6 +62,8 @@ def set_argparser():
pm_parser
.
add_argument
(
'--more_sift_features'
,
action
=
"store_true"
)
pm_parser
.
add_argument
(
'--save_space'
,
action
=
"store_true"
)
pm_parser
.
add_argument
(
'--add_new_videos'
,
action
=
"store_true"
)
pm_parser
.
add_argument
(
'--stereo_min_depth'
,
type
=
float
,
default
=
0.1
)
pm_parser
.
add_argument
(
'--stereo_max_depth'
,
type
=
float
,
default
=
100
)
om_parser
=
parser
.
add_argument_group
(
"Occlusion Mesh"
)
om_parser
.
add_argument
(
'--normals_method'
,
default
=
"radius"
,
choices
=
[
"radius"
,
"neighbours"
])
...
...
main_pipeline.py
View file @
ac58f29d
...
...
@@ -131,10 +131,10 @@ def main():
colmap
.
align_model
(
output
=
env
[
"georef_recon"
],
input
=
thorough_model
,
ref_images
=
env
[
"georef_frames_list"
])
if
not
(
env
[
"georef_
frames_list
"
]
/
"images.bin"
).
isfile
():
if
not
(
env
[
"georef_
recon
"
]
/
"images.bin"
).
isfile
():
# GPS alignment failed, possibly because not enough GPS referenced images
# Copy the original model without alignment
(
env
[
"
thorough_
recon"
]
/
"0"
)
.
merge_tree
(
env
[
"georef_recon"
])
thorough_
model
.
merge_tree
(
env
[
"georef_recon"
])
env
[
"georef_recon"
].
merge_tree
(
env
[
"georef_full_recon"
])
if
args
.
inspect_dataset
:
colmap
.
export_model
(
output
=
env
[
"georef_recon"
]
/
"georef_sparse.ply"
,
...
...
@@ -166,7 +166,7 @@ def main():
print_step
(
i
,
"Full reconstruction point cloud densificitation"
)
env
[
"georef_full_recon"
].
makedirs_p
()
colmap
.
undistort
(
input
=
env
[
"georef_full_recon"
])
colmap
.
dense_stereo
()
colmap
.
dense_stereo
(
min_depth
=
env
[
"stereo_min_depth"
],
max_depth
=
env
[
"stereo_max_depth"
]
)
colmap
.
stereo_fusion
(
output
=
env
[
"georefrecon_ply"
])
def
get_matrix
(
path
):
...
...
main_pipeline_no_lidar.py
View file @
ac58f29d
...
...
@@ -87,10 +87,11 @@ def main():
colmap
.
align_model
(
output
=
env
[
"georef_recon"
],
input
=
env
[
"thorough_recon"
]
/
"0"
,
ref_images
=
env
[
"georef_frames_list"
])
if
not
(
env
[
"georef_
frames_list
"
]
/
"images.bin"
).
isfile
():
if
not
(
env
[
"georef_
recon
"
]
/
"images.bin"
).
isfile
():
# GPS alignment failed, possibly because not enough GPS referenced images
# Copy the original model without alignment
(
env
[
"thorough_recon"
]
/
"0"
).
merge_tree
(
env
[
"georef_recon"
])
print
(
"Warning, model alignment failed, the model will be normalized, and thus the depth maps too"
)
thorough_model
.
merge_tree
(
env
[
"georef_recon"
])
env
[
"georef_recon"
].
merge_tree
(
env
[
"georef_full_recon"
])
if
args
.
inspect_dataset
:
colmap
.
export_model
(
output
=
env
[
"georef_recon"
]
/
"georef_sparse.ply"
,
...
...
@@ -121,7 +122,7 @@ def main():
print_step
(
i
,
"Full reconstruction point cloud densificitation"
)
env
[
"georef_full_recon"
].
makedirs_p
()
colmap
.
undistort
(
input
=
env
[
"georef_full_recon"
])
colmap
.
dense_stereo
()
colmap
.
dense_stereo
(
min_depth
=
env
[
"stereo_min_depth"
],
max_depth
=
env
[
"stereo_max_depth"
]
)
colmap
.
stereo_fusion
(
output
=
env
[
"georefrecon_ply"
])
i
+=
1
...
...
wrappers/colmap.py
View file @
ac58f29d
...
...
@@ -98,10 +98,14 @@ class Colmap(Wrapper):
"--output_type"
,
"COLMAP"
,
"--max_image_size"
,
str
(
max_image_size
)]
self
.
__call__
(
options
)
def
dense_stereo
(
self
):
def
dense_stereo
(
self
,
max_depth
=
None
,
min_depth
=
None
):
options
=
[
"patch_match_stereo"
,
"--workspace_path"
,
self
.
dense_workspace
,
"--workspace_format"
,
"COLMAP"
,
"--PatchMatchStereo.geom_consistency"
,
"1"
]
if
min_depth
is
not
None
:
options
+=
[
"--PatchMatchStereo.depth_min"
,
str
(
min_depth
)]
if
max_depth
is
not
None
:
options
+=
[
"--PatchMatchStereo.depth_max"
,
str
(
max_depth
)]
self
.
__call__
(
options
)
def
stereo_fusion
(
self
,
output
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment