Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F64773561
point_matching.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, May 29, 08:44
Size
1 KB
Mime Type
text/x-python
Expires
Fri, May 31, 08:44 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
17956188
Attached To
R6746 RationalROMPy
point_matching.py
View Options
# Copyright (C) 2018 by the RROMPy authors
#
# This file is part of RROMPy.
#
# RROMPy is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# RROMPy is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with RROMPy. If not, see <http://www.gnu.org/licenses/>.
#
import
numpy
as
np
from
scipy.optimize
import
linear_sum_assignment
as
LSA
from
rrompy.utilities.base.types
import
Np1D
,
Np2D
__all__
=
[
'pointMatching'
,
'chordalMetricTable'
]
def
pointMatching
(
distanceMatrix
:
Np2D
)
->
Np1D
:
return
LSA
(
distanceMatrix
)[
1
]
def
chordalMetricTable
(
x
:
Np1D
,
y
:
Np1D
)
->
Np2D
:
x
,
y
=
np
.
array
(
x
),
np
.
array
(
y
)
xInf
,
yInf
=
np
.
where
(
np
.
isinf
(
x
))[
0
],
np
.
where
(
np
.
isinf
(
y
))[
0
]
x
[
xInf
],
y
[
yInf
]
=
0.
,
0.
T
=
np
.
abs
(
np
.
tile
(
x
.
reshape
(
-
1
,
1
),
len
(
y
))
-
y
.
reshape
(
1
,
-
1
))
T
[
xInf
,
:],
T
[:,
yInf
]
=
1.
,
1.
T
[
np
.
ix_
(
xInf
,
yInf
)]
=
0.
T
=
T
.
T
*
(
np
.
abs
(
x
)
**
2.
+
1.
)
**
-.
5
T
=
T
.
T
*
(
np
.
abs
(
y
)
**
2.
+
1.
)
**
-.
5
return
T
Event Timeline
Log In to Comment