io.visualize
Class MatchingViewer

java.lang.Object
  extended by io.visualize.MatchingViewer

public class MatchingViewer
extends java.lang.Object

visualize a matching between two skeletons.


Field Summary
static int backgroundColor
           
private  java.awt.image.BufferedImage bimg
          the bufferedimage containing the visualization in the end
private  MatchList correspondences
          the correspondences to be displayed
private static org.apache.log4j.Logger logger
           
static int objectColor
           
private static long serialVersionUID
           
static int skeletonColor
           
private  SkeletonObject so1
          the first skeleton object that has been matched
private  SkeletonObject so2
          the second skeleton object that has been matched
static int xoffset
          the x-offset, where the "right" image has to be displayed
static int yoffset
          the y-offset, where the "right" image will be shifted vertical by this offset
 
Constructor Summary
MatchingViewer(SkeletonObject so1, SkeletonObject so2, MatchList ml)
          constructor.
 
Method Summary
private  void createSkeletonVisualization()
          create the skeleton- and matching visualization
 java.awt.image.BufferedImage getVisualization()
          Get an image, displaying both skeleton objects, with corresponding nodes linked by lines.
private  void initBufferedImage()
          set width and height of the buffered image.
private  void setContourPixel(SkeletonObject so, int totalOffsetX, int totalOffsetY)
          set the contour pixel in the buffered image.
private  void setCorrespondenceLines(int totalOffsetX, int totalOffsetY)
          display line for each correspondence.
private  void setSkeletonPixel(SkeletonObject so, int totalOffsetX, int totalOffsetY)
          set the object's skeleton pixel.
 void setVisualization(java.awt.image.BufferedImage bimg)
          Set the image viualizing the two skeleton objects and their correspondences.
private  void visualize()
          visualize the Skeletons and their correspondences.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

bimg

private java.awt.image.BufferedImage bimg
the bufferedimage containing the visualization in the end


so1

private final SkeletonObject so1
the first skeleton object that has been matched


so2

private final SkeletonObject so2
the second skeleton object that has been matched


correspondences

private final MatchList correspondences
the correspondences to be displayed


logger

private static org.apache.log4j.Logger logger

backgroundColor

public static final int backgroundColor

objectColor

public static final int objectColor

skeletonColor

public static final int skeletonColor

xoffset

public static final int xoffset
the x-offset, where the "right" image has to be displayed

See Also:
Constant Field Values

yoffset

public static final int yoffset
the y-offset, where the "right" image will be shifted vertical by this offset

See Also:
Constant Field Values
Constructor Detail

MatchingViewer

public MatchingViewer(SkeletonObject so1,
                      SkeletonObject so2,
                      MatchList ml)
constructor. create a new MatchingVisualizer with two skeleton objects that were matched, and a list of the found correspondences.

Parameters:
so1 - first skeleton that has been matched
so2 - second skeleton that has been matched
ml - a list of endnode correspondences between the first and second skeleton, given by their index in the list of end nodes
Method Detail

visualize

private void visualize()
visualize the Skeletons and their correspondences. An image is created that shows both skeleton objects with the corresponding nodes linked by lines.


createSkeletonVisualization

private void createSkeletonVisualization()
create the skeleton- and matching visualization


initBufferedImage

private void initBufferedImage()
set width and height of the buffered image. it has to be at least as high as the bigger of the two input images, and it has to be at least as wide as the two input images' width added.


setContourPixel

private void setContourPixel(SkeletonObject so,
                             int totalOffsetX,
                             int totalOffsetY)
set the contour pixel in the buffered image.

Parameters:
so - the skeleton object to be display.
totalOffsetX - the x-offset of the object to the left border of the image
totalOffsetY -

setSkeletonPixel

private void setSkeletonPixel(SkeletonObject so,
                              int totalOffsetX,
                              int totalOffsetY)
set the object's skeleton pixel.

Parameters:
so - the skeletonObject to be displayed
totalOffsetX - the x-offset to the left border of the image
totalOffsetY -

setCorrespondenceLines

private void setCorrespondenceLines(int totalOffsetX,
                                    int totalOffsetY)
display line for each correspondence.

Parameters:
totalOffsetX - the offset between the two displayed skeletons.
totalOffsetY -

getVisualization

public java.awt.image.BufferedImage getVisualization()
Get an image, displaying both skeleton objects, with corresponding nodes linked by lines.

Returns:
an image displaying the found correspondences

setVisualization

public void setVisualization(java.awt.image.BufferedImage bimg)
Set the image viualizing the two skeleton objects and their correspondences.

Parameters:
bimg - the visualization image to set