Commit 87d3eb84 authored by Julia Garriga Ferrer's avatar Julia Garriga Ferrer
Browse files

[core][image registration] Don't apply shift using Data function

parent d95e6f93
......@@ -312,14 +312,13 @@ def random_search(data, optimal_shift, iterations, sigma=None, shift_approach='l
utils.advancement_display(0, iterations)
for i in range(iterations):
result = numpy.zeros(data[0].shape)
result = []
normal = numpy.random.multivariate_normal((0, 0), sigma * numpy.eye(2), len(data)).T
n_shift = optimal_shift + normal
for iFrame in range(len(data)):
shifty = n_shift[0][iFrame]
shiftx = n_shift[1][iFrame]
result += data.apply_funcs([(apply_shift, [[shifty, shiftx], shift_approach])],
indices=iFrame, return_data=True)[0]
result += [apply_shift(data[iFrame], [shifty, shiftx], shift_approach)]
score = normalized_variance(result)
if best_score < score:
best_result = n_shift
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