getting extras from estimate_motion has a bug
Hello,
estimate_motion() has an option extra_outputs which currently (in my version 103.0) doesn't work, at least with the iterative template method. The specific problem comes from two things: in estimate motion lines 104-107
if extra_outputs:
extra = {}
else:
extra = None
and then in iterative_template lines 133 to 139:
if extra:
extra["non_rigid_windows"] = non_rigid_windows
extra["motion_histograms"] = motion_histograms
extra["target_histogram"] = target_histogram
extra["shift_covs_block"] = shift_covs_block
extra["temporal_hist_bin_edges"] = temporal_hist_bin_edges
extra["spatial_hist_bin_edges"] = spatial_hist_bin_edges
both options for extra in the former code block return false, so the latter code block is inaccessible
I have bypassed this for now by doing:
if extra_outputs:
extra = 1
else:
extra = None
But perhaps this breaks other things...
Thanks!
Jeff Boucher
(In fact, my solution didn't work for an obvious reason (extra can't be an integer) but I think the issue is otherwise well-specified)
Hi
Thanks for reporting.
OUps. This should be if extra is not None:
can you try a PR ?
See #4280