1 package mpi
.fruitfly
.registration
;
3 import java
.io
.Serializable
;
6 * SIFT feature container
8 public class Feature
implements Comparable
< Feature
>, Serializable
11 public float orientation
;
12 public float[] location
;
13 public float[] descriptor
;
15 /** Dummy constructor for Serialization to work properly. */
18 public Feature( float s
, float o
, float[] l
, float[] d
)
27 * comparator for making Features sortable
28 * please note, that the comparator returns -1 for
29 * this.scale > o.scale, to sort the features in a descending order
31 public int compareTo( Feature f
)
33 return scale
< f
.scale ?
1 : scale
== f
.scale ?
0 : -1;
36 public float descriptorDistance( Feature f
)
39 for ( int i
= 0; i
< descriptor
.length
; ++i
)
41 float a
= descriptor
[ i
] - f
.descriptor
[ i
];
44 return ( float )Math
.sqrt( d
);