Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
XRD
darfix
Commits
87d3eb84
Commit
87d3eb84
authored
May 26, 2021
by
Julia Garriga Ferrer
Browse files
[core][image registration] Don't apply shift using Data function
parent
d95e6f93
Changes
1
Hide whitespace changes
Inline
Side-by-side
darfix/core/imageRegistration.py
View file @
87d3eb84
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment