Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Ear recognition
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Boston University
Ear recognition
Commits
41653cbb
Commit
41653cbb
authored
Nov 26, 2015
by
Josejulio Martínez Magaña
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made the app more tolerant to inconsistencies on the feature data.
It ignores any data that seems wrong.
parent
0c7eff39
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
EarFeature.java
...in/java/com/aluxoft/earrecognition/common/EarFeature.java
+15
-1
No files found.
app/src/main/java/com/aluxoft/earrecognition/common/EarFeature.java
View file @
41653cbb
...
...
@@ -68,7 +68,14 @@ public class EarFeature {
assert
this
.
_getFeatures
().
type
()
==
feature2
.
_getFeatures
().
type
();
MatOfDMatch
matches
=
new
MatOfDMatch
();
matcher
.
match
(
this
.
_getFeatures
(),
feature2
.
_getFeatures
(),
matches
);
Mat
features1
=
this
.
_getFeatures
();
Mat
features2
=
feature2
.
_getFeatures
();
if
(
features1
==
null
||
features2
==
null
)
{
return
Double
.
MAX_VALUE
;
}
matcher
.
match
(
features1
,
features2
,
matches
);
DMatch
[]
aMatches
=
matches
.
toArray
();
double
distance
=
0
;
...
...
@@ -86,11 +93,18 @@ public class EarFeature {
features
=
gson
.
fromJson
(
featuresString
,
features
.
getClass
());
Mat
mFeatures
=
new
Mat
();
if
(
features
==
null
||
features
.
size
()
==
0
)
{
return
null
;
}
mFeatures
.
create
(
features
.
size
(),
kFeatureSize
,
CvType
.
CV_32F
);
float
buffer
[]
=
new
float
[
1
];
for
(
int
i
=
0
;
i
<
features
.
size
();++
i
)
{
ArrayList
<
Double
>
feature
=
features
.
get
(
i
);
if
(
feature
==
null
||
feature
.
size
()
!=
kFeatureSize
)
{
return
null
;
}
for
(
int
j
=
0
;
j
<
feature
.
size
();++
j
)
{
buffer
[
0
]
=
feature
.
get
(
j
).
floatValue
();
mFeatures
.
put
(
i
,
j
,
buffer
);
...
...
Write
Preview
Markdown
is supported
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