algorithm.psgm
Class SkeletonPathGetter

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

public class SkeletonPathGetter
extends java.lang.Object

we use a special representation for skeleton paths in our algorithm: the idea is to sample each skeleton path in M equidistant points in both skeletons. That way, we include some knowledge about the contours in the following calculations.

for each of these skeleton points, we get the distance to the feature points on the object counter, approximated by the skeleton object's distance map.

These M distances are saved in a vector. this vector is used to represent this skeleton path.


Field Summary
private static org.apache.log4j.Logger logger
           
 
Constructor Summary
SkeletonPathGetter()
           
 
Method Summary
static void getAllSkeletonPathVectors(SkeletonObject so1, SkeletonObject so2)
          use this function to set the skeletons' skeleton path vectors.
static void getAllSkeletonPathVectors(SkeletonObject so1, SkeletonObject so2, int numberOfSamplePoints)
          use this function to set the skeletons' skeleton path vectors.
private static double getNormalization(SkeletonObject so)
          to make sure the approach is scale - invariant, get a normalization factor based on the average distance of any object pixel to the contour.
private static int getNumberOfSamplePoints(SkeletonObject so1, SkeletonObject so2)
          Deprecated.  
static void getSkeletonPathRepresentation(SkeletonObject so, SkeletonPath path, int numberOfSamplePoints, double normalization)
          get the path vector representation for the specified skeleton path.
private static void getSkeletonPathVectors(SkeletonObject so, int numberOfSamplePoints)
          helper function to get skeleton path vectors for the specified skeleton.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static org.apache.log4j.Logger logger
Constructor Detail

SkeletonPathGetter

public SkeletonPathGetter()
Method Detail

getAllSkeletonPathVectors

public static void getAllSkeletonPathVectors(SkeletonObject so1,
                                             SkeletonObject so2)
                                      throws InvalidSkeletonException
use this function to set the skeletons' skeleton path vectors. the function changes the skeleton paths themselves, so no return type is needed. As no number of sample points is specified, an appropiate number of points is chosen automatically.

Parameters:
so1 - first skeletonobject to be sampled
so2 - second skeletonobject to be sampled
Throws:
InvalidSkeletonException

getAllSkeletonPathVectors

public static void getAllSkeletonPathVectors(SkeletonObject so1,
                                             SkeletonObject so2,
                                             int numberOfSamplePoints)
                                      throws InvalidSkeletonException
use this function to set the skeletons' skeleton path vectors. the function changes the skeleton paths themselves, so no return type is needed

Parameters:
so1 - first skeletonobject to be sampled
so2 - second skeletonobject to be sampled
numberOfSamplePoints - the number of points to sample the paths with
Throws:
InvalidSkeletonException

getSkeletonPathVectors

private static void getSkeletonPathVectors(SkeletonObject so,
                                           int numberOfSamplePoints)
                                    throws InvalidSkeletonException
helper function to get skeleton path vectors for the specified skeleton. for every endnode, get all emanating paths and call the function to sample a path for each of these paths.

Parameters:
so - skeleton whose parts shall be sampled
numberOfSamplePoints -
Throws:
InvalidSkeletonException

getSkeletonPathRepresentation

public static void getSkeletonPathRepresentation(SkeletonObject so,
                                                 SkeletonPath path,
                                                 int numberOfSamplePoints,
                                                 double normalization)
                                          throws InvalidSkeletonException
get the path vector representation for the specified skeleton path.

Parameters:
path - the path to be sampled
numberOfSamplePoints - the number of skeleton points to be sampled
normalization - the normalization factor
Throws:
InvalidSkeletonException

getNumberOfSamplePoints

private static int getNumberOfSamplePoints(SkeletonObject so1,
                                           SkeletonObject so2)
                                    throws InvalidSkeletonException
Deprecated. 

we have to get a reasonable number of sample points, if no number was specified.

we assume the average number of points in all skeleton paths (in both skeletons) as the best number of sample points.

Parameters:
so1 - the first skeleton to be sampled
so2 - the second skeleton to be sampled
Throws:
InvalidSkeletonException

getNormalization

private static double getNormalization(SkeletonObject so)
to make sure the approach is scale - invariant, get a normalization factor based on the average distance of any object pixel to the contour.

Parameters:
so - SkeletonObject to get the normalization factor for
Returns:
normalization factor