Skip to content
GitLab
Menu
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
24faf95d
Commit
24faf95d
authored
Feb 28, 2020
by
Julia Garriga Ferrer
Browse files
[core][components matching] Adds check for similar vectors in sift
parent
42e0dfbd
Pipeline
#22171
passed with stage
in 2 minutes and 23 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
darfix/core/componentsMatching.py
View file @
24faf95d
...
...
@@ -162,7 +162,7 @@ class ComponentsMatching():
elif
method
==
Method
.
sift_feature_matching
:
keypoints
=
self
.
_create_sift_keypoints
()
best_v
=
[]
mp
=
sift
.
MatchPlan
()
# Match components with id1 and id2
for
i
,
kp1
in
enumerate
(
keypoints
[
id1
]):
...
...
@@ -174,7 +174,13 @@ class ComponentsMatching():
reverse
=
True
):
# Only add match if neither x nor y are already in the list.
if
x
not
in
final_matches
.
keys
()
and
y
not
in
final_matches
.
values
():
final_matches
[
x
]
=
y
v
=
numpy
.
array
([
numpy
.
median
(
good
[(
x
,
y
)][:,
1
].
x
-
good
[(
x
,
y
)][:,
0
].
x
),
numpy
.
median
(
good
[(
x
,
y
)][:,
1
].
y
-
good
[(
x
,
y
)][:,
0
].
y
)])
if
not
numpy
.
any
(
best_v
):
best_v
=
v
final_matches
[
x
]
=
y
elif
numpy
.
linalg
.
norm
(
best_v
-
v
)
<
tol
:
final_matches
[
x
]
=
y
elif
method
==
Method
.
euclidean_distance
:
for
i
,
X
in
enumerate
(
self
.
components
[
id1
]):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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