|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectalgorithm.psgm.OSBv5
public class OSBv5
This is a java adaption of Latecki's OSBv5 matlab code
Originally, the OSB (Optimal Subsequence Bijection) was developped to match time series. Input were originally two sequences of points a and b, and the goal was to find subsequences a' and b' of a and b, so that a' best matches b'. Skipping of elements is allowed in both series, but skipping elements in the first series is punished.
The main idea of OSB is to create a distance matrix for the two series. Then, the "cheapest" path through that matrix is searched, resulting in an optimal correspondence between the elements in a and b. The path cost is than given by the costs (given by the distance matrix) for matching the single elements to the corresponding elements.
In the context of skeleton matching, OSB can be used to calculate the total costs to match one end node in the one skeleton to one end node in the other skeleton. Input is then the path distance matrix for the two skeleton end nodes, and the "cheapest" path through the path distance matrix is searched. As the path distance matrix encodes information about the emanating skeleton paths, it is a proper mean to estimate the dissimilarity between the two end nodes it is specified for. The assumption is: The more similar one or more emanating paths from the two end nodes are, the more similar are the endnodes.
| Field Summary | |
|---|---|
private static org.apache.log4j.Logger |
logger
logger |
| Constructor Summary | |
|---|---|
OSBv5()
|
|
| Method Summary | |
|---|---|
private static MatchList |
findDAG(double[][] matx,
int warpwin,
int queryskip,
int targetskip,
double jumpcost,
double[][] original)
find the shortest path through a given matrix. |
static double |
getJumpCost(double[][] p)
get the cost for skipping rows. |
static MatchList |
getMatchingCosts(double[][] matx)
get the matching costs for a given distance matrix, that is, the "cheapest" path through that matrix. |
private static double[][] |
prepareMatrix(double[][] matx)
Before applying OSB, the matrix should be prepared: To allow skipping the first and last elements in the matrix, additional rows and columns are added. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static org.apache.log4j.Logger logger
| Constructor Detail |
|---|
public OSBv5()
| Method Detail |
|---|
public static MatchList getMatchingCosts(double[][] matx)
matx - the matrix to get the costs forprivate static double[][] prepareMatrix(double[][] matx)
matx - the matrix to be prepared
private static MatchList findDAG(double[][] matx,
int warpwin,
int queryskip,
int targetskip,
double jumpcost,
double[][] original)
matx - the matrix to find the shortest path throughwarpwin - the warp window, i.e. the maximal difference between row index
and column indexqueryskip - a restriction on how many consecutive elements of sequence t1
(= rows in the matrix) can be skippedtargetskip - a restriction on how many consecutive elements of sequence t2
(= columns in the matrix) can be skippedjumpcost - the costs to punish skipping rowsoriginal - the original (unprepared) matrix
public static double getJumpCost(double[][] p)
p - the cost matrix
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||