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
0412c711
Commit
0412c711
authored
Oct 08, 2015
by
Josejulio Martínez Magaña
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Passes the ear features to the next Actitivity.
parent
180e5455
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
15 deletions
+26
-15
SIFTActivity.java
...a/com/aluxoft/earrecognition/activities/SIFTActivity.java
+26
-15
No files found.
app/src/main/java/com/aluxoft/earrecognition/activities/SIFTActivity.java
View file @
0412c711
...
...
@@ -7,6 +7,9 @@ import android.os.Bundle;
import
com.aluxoft.earrecognition.EarIdentifier
;
import
com.aluxoft.earrecognition.R
;
import
com.aluxoft.earrecognition.common.EarFeature
;
import
com.aluxoft.earrecognition.common.EarIdList
;
import
com.google.gson.Gson
;
import
java.io.File
;
import
java.util.concurrent.Callable
;
...
...
@@ -29,25 +32,33 @@ public class SIFTActivity extends Activity {
loading
.
setCancelable
(
false
);
loading
.
setProgressStyle
(
ProgressDialog
.
STYLE_SPINNER
);
Task
.
callInBackground
(
new
Callable
<
Objec
t
>()
{
Task
.
callInBackground
(
new
Callable
<
EarIdLis
t
>()
{
@Override
public
Object
call
()
throws
Exception
{
synchronized
(
this
)
{
// Sift
EarIdentifier
identifier
=
new
EarIdentifier
(
null
);
Intent
intent
=
SIFTActivity
.
this
.
getIntent
();
Bundle
extras
=
intent
.
getExtras
();
String
imagePath
=
(
String
)
extras
.
get
(
"image_path"
);
String
features
=
identifier
.
computeFeatures
(
imagePath
);
// Once we have the features, we can delete the image.
new
File
(
imagePath
).
delete
();
}
return
null
;
public
EarIdList
call
()
throws
Exception
{
// Sift
EarIdentifier
identifier
=
new
EarIdentifier
(
null
);
Intent
intent
=
SIFTActivity
.
this
.
getIntent
();
Bundle
extras
=
intent
.
getExtras
();
String
imagePath
=
(
String
)
extras
.
get
(
"image_path"
);
EarFeature
earFeature
=
identifier
.
computeFeatures
(
imagePath
);
// Once we have the features, we can delete the image.
new
File
(
imagePath
).
delete
();
// Compares the current features with the database.
EarIdList
result
=
new
EarIdList
();
// Generate the top-x.
// Pass results to next activity.
result
.
setCurrentFeature
(
earFeature
);
return
result
;
}
}).
continueWith
(
new
Continuation
<
Objec
t
,
Object
>()
{
}).
continueWith
(
new
Continuation
<
EarIdLis
t
,
Object
>()
{
@Override
public
Object
then
(
Task
<
Objec
t
>
task
)
throws
Exception
{
public
Object
then
(
Task
<
EarIdLis
t
>
task
)
throws
Exception
{
Intent
intent
=
new
Intent
(
"com.auriclon.activity_select_user"
);
intent
.
putExtra
(
"list"
,
new
Gson
().
toJson
(
task
.
getResult
()));
startActivity
(
intent
);
return
null
;
}
...
...
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