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
c3752212
Commit
c3752212
authored
Aug 16, 2021
by
Julia Garriga Ferrer
Committed by
Julia Garriga Ferrer
Aug 17, 2021
Browse files
[core][imageregistration][shift_detection] Fix bug when h is 0
parent
23e8332f
Changes
1
Hide whitespace changes
Inline
Side-by-side
darfix/core/imageRegistration.py
View file @
c3752212
...
...
@@ -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
)))
...
...
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