algorithm.psgm
Class PSGMResult

java.lang.Object
  extended by algorithm.psgm.PSGMResult

public class PSGMResult
extends java.lang.Object

"dirty" matching result of the matching algorithm PSGM. The order of the skeleton object might not be the same as the user input was, that is, the original "skeleton1" now could be "skeleton2", as the algorithm requires that the skeleton with lesser end nodes is skeleton1. Also, it might be that one of the skeletons (the "smaller" one, thus, skeleton1) needed to be flipped in order to get good matchings. The MatchList achieved is then defined by the indices of the skeleton end nodes in the flipped skeleton. For a result, with all this stuff cleaned up, use getCleanMatchingResult().


Field Summary
private  boolean flipped
          holds the information if for the found matching, skeleton 1 had to be flipped
private  MatchList ml
          the found matching, maybe with switched partners and with flipped indices
private  boolean reordered
          holds the information if the two skeletons were reordered for execution of the algorithm
private  SkeletonObject so1
          the "smaller" skeleton object (with less end nodes)
private  SkeletonObject so1_flipped
          the "smaller" skeleton object (with less end nodes) parsed from flipped image
private  SkeletonObject so2
          the "bigger" skeleton object (with more end nodes)
 
Constructor Summary
PSGMResult()
           
 
Method Summary
 CleanMatchingResult getCleanMatchingResult()
          From the "dirty" PSGMResult, extract a cleaned up result.
private  MatchList reorderMatchList(MatchList ml)
          In case of reordered skeletons, the matching partners of each single matching in the found matchlist have to be swapped to reconstruct the original order
 void setFlipped(boolean flipped)
          Set if the smaller skeleton (with less end nodes) was flipped in order to get better maching results.
 void setMl(MatchList ml)
          Set the "dirty" matchlist
 void setReordered(boolean reordered)
          Set if the two skeleton were reordered for the execution of the algorithm.
 void setSo1_flipped(SkeletonObject so1Flipped)
          Set the flipped version of the "smaller" skeleton.
 void setSo1(SkeletonObject so1)
          Set the first skeleton, that is, the one with lesser end nodes.
 void setSo2(SkeletonObject so2)
          Set the second skeleton, that is, the one with more end nodes.
private  MatchList unflipMatchList(MatchList ml)
          In case of flipped images, the matching list has to be "translated back": That is, for each matched end node in skeleton1 (the smaller skeleton), we translate back the coordinates to the unflipped image and look for the index of the end nodes with the computed coordinates in the original end node list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

so1

private SkeletonObject so1
the "smaller" skeleton object (with less end nodes)


so1_flipped

private SkeletonObject so1_flipped
the "smaller" skeleton object (with less end nodes) parsed from flipped image


so2

private SkeletonObject so2
the "bigger" skeleton object (with more end nodes)


flipped

private boolean flipped
holds the information if for the found matching, skeleton 1 had to be flipped


ml

private MatchList ml
the found matching, maybe with switched partners and with flipped indices


reordered

private boolean reordered
holds the information if the two skeletons were reordered for execution of the algorithm

Constructor Detail

PSGMResult

public PSGMResult()
Method Detail

getCleanMatchingResult

public CleanMatchingResult getCleanMatchingResult()
From the "dirty" PSGMResult, extract a cleaned up result. In case the two skeletons were reordered, the original order is restored by swapping the matching partners in the matchlist. In case of flipped images, the original indices are "translated back" by calculating the original coordinates for the matched end nodes.

Returns:
clean matching result

unflipMatchList

private MatchList unflipMatchList(MatchList ml)
In case of flipped images, the matching list has to be "translated back": That is, for each matched end node in skeleton1 (the smaller skeleton), we translate back the coordinates to the unflipped image and look for the index of the end nodes with the computed coordinates in the original end node list.

Parameters:
ml - the flipped match list
Returns:
matching list with the "flipped" indices "translated" back to the original indices

reorderMatchList

private MatchList reorderMatchList(MatchList ml)
In case of reordered skeletons, the matching partners of each single matching in the found matchlist have to be swapped to reconstruct the original order

Parameters:
ml - a matchlist with swapped matching partners
Returns:
a clean matchlist, all matching partners swapped back

setSo1_flipped

public void setSo1_flipped(SkeletonObject so1Flipped)
Set the flipped version of the "smaller" skeleton.

Parameters:
so1Flipped - the flipped skeleton to set

setReordered

public void setReordered(boolean reordered)
Set if the two skeleton were reordered for the execution of the algorithm.

Parameters:
reordered - true if the skeletons were reordered, false if not

setSo1

public void setSo1(SkeletonObject so1)
Set the first skeleton, that is, the one with lesser end nodes.

Parameters:
so1 - the "smaller" skeleton to set

setSo2

public void setSo2(SkeletonObject so2)
Set the second skeleton, that is, the one with more end nodes.

Parameters:
so2 - the "bigger" so2 to set

setFlipped

public void setFlipped(boolean flipped)
Set if the smaller skeleton (with less end nodes) was flipped in order to get better maching results.

Parameters:
flipped - true if the smaller skeleton was flipped for this matching, false if not.

setMl

public void setMl(MatchList ml)
Set the "dirty" matchlist

Parameters:
ml - the ml to set