Skip to content

Commit

Permalink
Merge pull request #52 from 20treeAI/feat/sift_over_exogenous
Browse files Browse the repository at this point in the history
feat: add sift_else_exogenous
  • Loading branch information
roelofvandijkO authored Jun 16, 2024
2 parents a004ce1 + 3571a91 commit 88ecbdb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion s2p/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@

cfg['rpc_alt_range_scale_factor'] = 1

# method to compute the disparity range: "sift", "exogenous", "wider_sift_exogenous", "fixed_pixel_range", "fixed_altitude_range"
# method to compute the disparity range: "sift", "exogenous", "wider_sift_exogenous", "fixed_pixel_range", "fixed_altitude_range", "sift_else_exogenous"
cfg['disp_range_method'] = "wider_sift_exogenous"
cfg['disp_range_exogenous_low_margin'] = -10
cfg['disp_range_exogenous_high_margin'] = +100
Expand Down
9 changes: 6 additions & 3 deletions s2p/rectification.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ def disparity_range(rpc1, rpc2, x, y, w, h, H1, H2, matches, cfg, A=None):
disp: 2-uple containing the horizontal disparity range
"""
# compute exogenous disparity range if needed
if cfg['disp_range_method'] in ['exogenous', 'wider_sift_exogenous']:
exogenous_disp = rpc_utils.exogenous_disp_range_estimation(rpc1, rpc2,
if 'exogenous' in cfg['disp_range_method']:
exogenous_disp = rpc_utils.exogenous_or_sift_disp_range_estimation(rpc1, rpc2,
x, y, w, h,
H1, H2, cfg, A,
cfg['disp_range_exogenous_high_margin'],
Expand All @@ -192,7 +192,7 @@ def disparity_range(rpc1, rpc2, x, y, w, h, H1, H2, matches, cfg, A=None):
print("exogenous disparity range:", exogenous_disp)

# compute SIFT disparity range if needed
if cfg['disp_range_method'] in ['sift', 'wider_sift_exogenous']:
if 'sift' in cfg['disp_range_method']:
if matches is not None and len(matches) >= 2:
sift_disp = disparity_range_from_matches(matches, H1, H2, w, h, cfg['disp_range_extra_margin'])
else:
Expand Down Expand Up @@ -220,6 +220,9 @@ def disparity_range(rpc1, rpc2, x, y, w, h, H1, H2, matches, cfg, A=None):
else:
disp = sift_disp or exogenous_disp

elif cfg['disp_range_method'] == 'sift_else_exogenous':
disp = sift_disp if sift_disp is not None else exogenous_disp

elif cfg['disp_range_method'] == 'fixed_altitude_range':
disp = alt_disp

Expand Down
2 changes: 1 addition & 1 deletion s2p/rpc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ def alt_to_disp(rpc1, rpc2, x, y, alt, H1, H2, A=None):
return disp


def exogenous_disp_range_estimation(rpc1, rpc2, x, y, w, h, H1, H2, cfg, A=None,
def exogenous_or_sift_disp_range_estimation(rpc1, rpc2, x, y, w, h, H1, H2, cfg, A=None,
margin_top=0, margin_bottom=0):
"""
Args:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def finalize_options(self):
}

setup(name="s2p",
version="1.6.7",
version="1.6.8",
description="Satellite Stereo Pipeline.",
long_description=readme(),
long_description_content_type='text/markdown',
Expand Down

0 comments on commit 88ecbdb

Please sign in to comment.