-
-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI --affine parameter has no effect #243
Comments
Opened a PR that proposes a very simple (one line) fix: #244 |
wow great catch and awesome issue with really much detail! That means using I thought that the cli only have those arguments in the Anyway, even then if the user passes in
|
This is the perfect explanation for #125, since its not affine stitching but homographic stitching with vertical wave correction |
closed with da14e49 |
It seems that the
--affine
CLI parameter is not working as expected.Expected behavior
According to the CLI help text for the
--affine
parameter:Overwrites multiple parameters to optimize the stitching for scans and images captured by specialized devices.
The tutorial specifically outlines the parameters that should be overridden:
Actual behavior
The CLI script does not explicitly override those parameters when
--affine
is used, and it explicitly sets them to non-affine defaults.For example, the
--matcher_type
CLI parameter setsdefault=FeatureMatcher.DEFAULT_MATCHER,
which ishomography
.stitching/stitching/cli/stitch.py
Line 87 in a471af1
Steps to reproduce
The following Docker commands (with any set of images) will create verbose output with
00_stitcher.txt
files that show the actual parameters that are used.With
--affine
:Command:
sudo docker run --rm -v ./:/data openstitching/stitch --affine --verbose ./*.jpg
Result:
AffineStitcher(**{'medium_megapix': 0.6, 'detector': 'orb', 'nfeatures': 500, 'matcher_type': 'homography', 'range_width': -1, 'try_use_gpu': False, 'match_conf': None, 'confidence_threshold': 1, 'matches_graph_dot_file': None, 'estimator': 'homography', 'adjuster': 'ray', 'refinement_mask': 'xxxxx', 'wave_correct_kind': 'horiz', 'warper_type': 'spherical', 'low_megapix': 0.1, 'crop': True, 'compensator': 'gain_blocks', 'nr_feeds': 1, 'block_size': 32, 'finder': 'dp_color', 'final_megapix': -1, 'blender_type': 'multiband', 'blend_strength': 5, 'timelapse': 'no'})
Without
--affine
:Command:
sudo docker run --rm -v ./:/data openstitching/stitch --verbose ./*.jpg
Result
00_stitcher.txt
:Stitcher(**{'medium_megapix': 0.6, 'detector': 'orb', 'nfeatures': 500, 'matcher_type': 'homography', 'range_width': -1, 'try_use_gpu': False, 'match_conf': None, 'confidence_threshold': 1, 'matches_graph_dot_file': None, 'estimator': 'homography', 'adjuster': 'ray', 'refinement_mask': 'xxxxx', 'wave_correct_kind': 'horiz', 'warper_type': 'spherical', 'low_megapix': 0.1, 'crop': True, 'compensator': 'gain_blocks', 'nr_feeds': 1, 'block_size': 32, 'finder': 'dp_color', 'final_megapix': -1, 'blender_type': 'multiband', 'blend_strength': 5, 'timelapse': 'no'})
Cause
This is happening because the
--affine
parameter only affects which class is used (AffineStitcher()
instead ofStitcher()
), but it does not explicitly override the parameters that are passed intoinitialize_stitcher()
.stitching/stitching/cli/stitch.py
Line 318 in a471af1
Solution
Perhaps before line 318 of
cli/stitch.py
all of the parameters that should be overridden for affine-mode can be reset to the appropriate values.This would mean that if
--affine
is used, then the other parameters would have no effect (--estimator
,--wave_correct_kind
,--matcher_type
,--adjuster
,--warper_type
,--compensator
).The other option is to still allow individual options to be overridden AFTER the
--affine
overrides are applied, but I feel like someone wants to do that they shouldn't use--affine
.Workaround
For now, if you need the effects of
--affine
, those parameters can be explicitly set on the command line like so:--wave_correct_kind no --matcher_type affine --adjuster affine --warper_type affine --compensator no --estimator affine
The text was updated successfully, but these errors were encountered: