Skip to content

Commit da14949

Browse files
committed
Resolved conflicts
2 parents afa291d + b8ae9a7 commit da14949

File tree

124 files changed

+7181
-934
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+7181
-934
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.ui.javadoc=false
3+
org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="false" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * Get the {@link ${bare_field_name}].\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="false" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * Set the {@link ${bare_field_name}}.\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="false" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * The constructor for the class.\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\r\n *\r\n */</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * The {@link ${type_name}} class.\r\n *\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment"/><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>

Jestures/Releasenotes.md

-1
This file was deleted.

Jestures/build.gradle

+21-36
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,18 @@
1-
buildscript {
2-
repositories {
3-
jcenter()
4-
mavenCentral()
5-
}
6-
dependencies {
7-
}
8-
}
9-
101
plugins {
11-
id "com.jfrog.bintray" version "1.7.3"
2+
id 'com.jfrog.bintray' version '1.7.3'
123
id 'com.jfrog.artifactory' version '4.5.2'
13-
}
14-
15-
allprojects {
16-
apply plugin: 'java-library'
17-
apply plugin: 'java'
18-
apply plugin: 'maven'
19-
apply plugin: 'maven-publish'
20-
apply plugin: 'signing'
4+
id 'java-library'
5+
id 'java'
6+
id 'maven'
7+
id 'maven-publish'
8+
id 'signing'
219
}
2210

2311
group = project_group
2412
archivesBaseName = project_artifact
2513
version = project.project_version
2614

15+
//TASKS
2716
task sourcesJar(type: Jar, dependsOn: classes) {
2817
classifier = 'sources'
2918
from sourceSets.main.allSource
@@ -71,19 +60,19 @@ repositories {
7160
}
7261
}
7362

63+
7464
dependencies {
7565
//compile all jar in libs
7666
localCompile fileTree(dir: 'libs', include: '*.jar')
7767
compile 'org.apache.commons:commons-math3:3.6.1'
7868
compile 'com.google.guava:guava:23.0'
7969
testCompile 'junit:junit:4.12'
70+
compile 'log4j:log4j:1.2.17'
8071
compile 'com.github.haifengl:smile-core:1.5.1'
81-
compile 'com.jfoenix:jfoenix:8.0.3' // Java 8
82-
72+
compile 'com.jfoenix:jfoenix:8.0.4' // Java 8
8373
compile 'org.kordamp.ikonli:ikonli-core:1.7.0'
8474
compile 'org.kordamp.ikonli:ikonli-javafx:1.7.0'
8575
compile 'org.kordamp.ikonli:ikonli-material-pack:1.7.0'
86-
8776
compile 'eu.hansolo.enzo:Enzo:0.3.6'
8877
compile 'com.google.code.gson:gson:2.8.4'
8978
}
@@ -101,7 +90,6 @@ sourceSets {
10190
}
10291

10392

104-
10593
//BINTRAY
10694
bintray {
10795
user = project.hasProperty('bintrayUsername') ? project.property('bintrayUsername') : System.getenv('BINTRAY_USER')
@@ -120,7 +108,7 @@ bintray {
120108
issueTrackerUrl = "https://github.com/$project.your_github_name/$project.project_name/issues"
121109
vcsUrl = "https://github.com/$your_github_name/${project.project_name}.git"
122110
githubRepo = "$your_github_name/$project.project_name"
123-
githubReleaseNotesFile = 'Releasenotes.md'
111+
//githubReleaseNotesFile = 'Releasenotes.md'
124112
version {
125113
name = project.project_version
126114
vcsTag = project.project_version
@@ -170,7 +158,6 @@ publishing {
170158
artifactId project_artifact
171159
version project.project_version
172160

173-
174161
artifact sourcesJar {
175162
classifier 'sources'
176163
}
@@ -183,7 +170,6 @@ publishing {
183170
classifier 'all'
184171
}
185172

186-
187173
pom {
188174
packaging 'jar'
189175
withXml {
@@ -197,32 +183,34 @@ publishing {
197183

198184
builder.licenses {
199185
builder.license {
200-
builder.name 'The Apache Software License, Version 2.0'
201-
builder.url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
186+
builder.name project.project_license
187+
builder.url project.project_license_url
202188
builder.distribution 'repo'
203189
}
204190
}
191+
205192
builder.scm {
206-
builder.url 'scm:svn:http://github.com/Giulianini/Track4J'
207-
builder.connection 'scm:svn:http://github.com/Giulianini/Track4J.git'
208-
builder.developerConnection 'scm:svn:ssh://github.com/Giulianini/Track4J.git'
193+
builder.url "scm:svn:http://github.com/$project.your_github_name/$project.project_name"
194+
builder.connection "scm:svn:http://github.com/$your_github_name/${project.project_name}.git"
195+
builder.developerConnection "scm:svn:ssh://github.com/$your_github_name/${project.project_name}.git"
209196
}
197+
210198
builder.developers {
211199
builder.developer {
212200
builder.name 'Luca Giulianini'
213201
builder.email '[email protected]'
214202
}
215-
216203
}
217204

218205
// maven central publishing optionals
219206
builder.issueManagement {
220207
builder.system 'github'
221-
builder.url 'https://github.com/p6spy/p6spy/issues'
208+
builder.url "https://github.com/$project.your_github_name/$project.project_name/issues"
222209
}
210+
223211
builder.ciManagement {
224212
builder.system 'Travis CI'
225-
builder.url 'https://travis-ci.org/p6spy/p6spy'
213+
builder.url "https://travis-ci.org/$project.your_github_name/$project.project_name"
226214
}
227215
}
228216
}
@@ -232,15 +220,12 @@ publishing {
232220
}
233221

234222
publishing {
235-
236223
if (!version.toString().endsWith('-SNAPSHOT'))
237224
publish.dependsOn bintrayUpload
238225
else if (version.toString().endsWith('-SNAPSHOT'))
239226
publish.dependsOn artifactoryPublish
240227
}
241228

242-
243-
244229
signing {
245230
required { gradle.taskGraph.hasTask("uploadArchives") }
246231
sign configurations.archives

Jestures/gradle.properties

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
project_artifact = jestures

Jestures/src/main/java/jestures/core/codification/Codification.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
package jestures.core.codification;
1717

1818
/**
19-
* The @link{Codification} class.
19+
* The codification type. By default the codification is derivative but other type of codification can be created.
2020
*/
2121
public enum Codification {
2222
/**

Jestures/src/main/java/jestures/core/codification/Codifier.java

+21-10
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,28 @@
1919

2020
import org.apache.commons.math3.geometry.euclidean.twod.Vector2D;
2121

22-
import jestures.core.tracking.Tracker;
22+
import jestures.core.tracking.TrackerImpl;
2323
import jestures.core.tracking.TrackingObserver;
2424

2525
/**
26-
* The @link{Codifier} class.
26+
* A Codifier take absolute vector in space (vector2D or vector3D) and transforms them in a relative way.
27+
* <p>
28+
* This can be done in a derivative way or using other type of codification, for example a starting point codification
29+
* where every vector is subtracted by the first vector of the list.
2730
*/
2831
public interface Codifier {
32+
33+
/**
34+
* Get the {@link Codification}.
35+
*
36+
* @return the {@link Codification} type
37+
*/
38+
Codification getCodificationType();
39+
2940
/**
3041
* Codify the body joint according to class specification. This performs discretization on skeleton stream.
3142
* <p>
32-
* Codification can be derivative or on vectorial space.
43+
* Codification can be derivative or on starting point.
3344
*
3445
* @param newVector
3546
* the primary {@link Vector2D} joint according to sensor settings
@@ -45,23 +56,23 @@ public interface Codifier {
4556
Queue<Vector2D> extractFeatureVector();
4657

4758
/**
48-
* Attache the {@link Tracker} for feeback notification.
59+
* Attache the {@link TrackerImpl} for feedback notification.
4960
*
5061
* @param recognizer
51-
* the {@link Tracker}
62+
* the {@link TrackerImpl}
5263
*/
53-
void attacheCoreRecognizer(TrackingObserver recognizer);
64+
void attacheTracker(TrackingObserver recognizer);
5465

5566
/**
5667
* Reset the frame for starting a new gesture.
5768
*/
5869
void resetFrame();
5970

6071
/**
61-
* Set the frame length.
62-
*
72+
* Set the frame length or FPS.
73+
*
6374
* @param length
64-
* the {@link FrameLenght}.
75+
* the {@link FrameLength}.
6576
*/
66-
void setFrameLength(FrameLenght length);
77+
void setFrameLength(FrameLength length);
6778
}

Jestures/src/main/java/jestures/core/codification/DerivativeCodifier.java

+21-23
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*******************************************************************************/
1616
package jestures.core.codification;
1717

18+
import java.util.ArrayList;
1819
import java.util.Queue;
1920

2021
import org.apache.commons.math3.geometry.euclidean.twod.Vector2D;
@@ -24,30 +25,38 @@
2425
import jestures.core.tracking.TrackingObserver;
2526

2627
/**
27-
* The @link{DerivativeCodifier} class.
28+
* A derivative codifier takes absolute vectors and create a list of theirs derivatives.
29+
* <p>
30+
* For example (2, 0) (3, 5) (3, 6) become (1, 5) (0, 1) and so on.
2831
*/
2932
public class DerivativeCodifier implements Codifier {
30-
private final Queue<Vector2D> featureVector;
33+
private Queue<Vector2D> featureVector;
3134
private Vector2D oldVector;
3235
private Vector2D derivative; // NOPMD
3336
private Vector2D startingVector;
3437
private int frame;
35-
private FrameLenght frameLength;
38+
private FrameLength frameLength;
3639
private TrackingObserver recognizer;
40+
private static final Codification CODIFICATION = Codification.DERIVATIVE;
3741

3842
/**
3943
* The @link{DerivativeCodifier.java} constructor.
4044
*
4145
* @param frames
4246
* the gesture's duration in frame
4347
*/
44-
public DerivativeCodifier(final FrameLenght frames) {
45-
this.featureVector = EvictingQueue.create(FrameLenght.THREE_SECONDS.getFrameNumber());
48+
public DerivativeCodifier(final FrameLength frames) {
49+
this.featureVector = EvictingQueue.create(frames.getFrameNumber());
4650
this.oldVector = new Vector2D(0, 0);
4751
this.frame = 0;
4852
this.frameLength = frames;
4953
}
5054

55+
@Override
56+
public Codification getCodificationType() {
57+
return DerivativeCodifier.CODIFICATION;
58+
}
59+
5160
@Override
5261
public void codifyOnSkeletonChange(final Vector2D newVector) {
5362
// CALCOLO DERIVATA
@@ -59,11 +68,12 @@ public void codifyOnSkeletonChange(final Vector2D newVector) {
5968
this.startingVector = newVector;
6069
}
6170
if (this.frame > this.frameLength.getFrameNumber() - 1) {
71+
this.recognizer.notifyOnFeatureVectorEvent(new ArrayList<Vector2D>(this.featureVector));
6272
this.resetFrame();
63-
this.recognizer.notifyOnFeatureVectorEvent(this.featureVector);
6473
} else {
65-
this.incrementFrame();
66-
this.recognizer.notifyOnFrameChange(this.frame, this.derivative, this.startingVector.subtract(newVector));
74+
this.recognizer.notifyOnFrameChange(this.frame, this.featureVector, this.derivative,
75+
this.startingVector.subtract(newVector));
76+
this.frame++;
6777
}
6878
}
6979

@@ -73,7 +83,7 @@ public Queue<Vector2D> extractFeatureVector() {
7383
}
7484

7585
@Override
76-
public void attacheCoreRecognizer(final TrackingObserver recognizer) {
86+
public void attacheTracker(final TrackingObserver recognizer) {
7787
this.recognizer = recognizer;
7888
}
7989

@@ -82,22 +92,10 @@ public synchronized void resetFrame() {
8292
this.frame = 0;
8393
}
8494

85-
private synchronized void incrementFrame() {
86-
this.frame++;
87-
}
88-
89-
/**
90-
* Get the gesture lenght.
91-
*
92-
* @return the {@link FrameLenght}
93-
*/
94-
public FrameLenght getGestureLenght() {
95-
return this.frameLength;
96-
}
97-
9895
@Override
99-
public void setFrameLength(final FrameLenght length) {
96+
public synchronized void setFrameLength(final FrameLength length) {
10097
this.frameLength = length;
98+
this.featureVector = EvictingQueue.create(length.getFrameNumber());
10199
}
102100

103101
}

Jestures/src/main/java/jestures/core/codification/FeatureExtractionFrequency.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public enum FeatureExtractionFrequency {
2525
/**
2626
* Gestures duration in frame. 30 FPS base
2727
*/
28-
TEN_SECOND(10), TWENTY_SECONDS(20), THIRTY_SECONDS(30);
28+
FPS_10(10), FPS_20(20), FPS_30(30);
2929

3030
private int frequencyNumber;
3131

Jestures/src/main/java/jestures/core/codification/FrameLenght.java renamed to Jestures/src/main/java/jestures/core/codification/FrameLength.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@
1919
/**
2020
* The @link{JestureFrameLenght} class.
2121
*/
22-
public enum FrameLenght {
22+
public enum FrameLength {
2323
/**
2424
* Gestures duration in frame. 30 FPS base
2525
*/
26-
ONE_SECOND(30), TWO_SECONDS(60), THREE_SECONDS(90);
26+
FPS_30(30), FPS_20(20), FPS_10(10);
2727

2828
private int frameNumber;
2929

3030
/**
3131
* The @link{JestureFrameLenght.java} constructor.
3232
*/
33-
FrameLenght(final int frames) {
33+
FrameLength(final int frames) {
3434
this.frameNumber = frames;
3535
}
3636

0 commit comments

Comments
 (0)