Commit c3752212 authored by Julia Garriga Ferrer's avatar Julia Garriga Ferrer Committed by Julia Garriga Ferrer
Browse files

[core][imageregistration][shift_detection] Fix bug when h is 0

parent 23e8332f
......@@ -231,6 +231,8 @@ def shift_detection(data, steps, shift_approach="linear"):
v = normalize(shift)
v_ = 2 * shift / len(data)
h = numpy.sqrt(v_[0]**2 + v_[1]**2)
if not h:
return numpy.outer([0, 0], numpy.arange(len(data)))
epsilon = 2 * h
h = improve_linear_shift(data, v, h, epsilon, steps, shift_approach=shift_approach)
return numpy.outer(h * v, numpy.arange(len(data)))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment