at.ac.sbg.cosy.soccerbot.recognition.splitmerge
Class SplitMergeService

java.lang.Object
  extended by at.ac.sbg.cosy.soccerbot.recognition.splitmerge.SplitMergeService

public class SplitMergeService
extends java.lang.Object

Service class providing all entry points for performing the Split and Merge algorithm

Author:
Peter Wild

Field Summary
static int CONFIG_IMGSIZE
          Length of square image, image size has to be CONFIG_IMGSIZE^2
static int CONFIG_MAXHIERARCHY
          Hierarchy level at which the image resides, has to be QuadNode.calculateMaxHierarchy(CONFIG_IMGSIZE) - that is log2(CONFIG_IMGSIZE)
static int[] QUADTREE_AV
          Int array holding all average node color / quadtree_up /quadtree_down values within the splitMerge phase.
static int[] QUADTREE_BITSET
          Bit set holding information whether a quadtree node exists within the image.
 
Constructor Summary
SplitMergeService()
           
 
Method Summary
static void doService(IRegionCollector collector)
          This is the main entry point for performing the Split and Merge Algorithm image has to be contained within int array QUADTREE_AV
static void group(int maxHierarchy, int[] bitSet, int[] quadTreeAv, int[] todoBitSet, int[] queue, int[] stack, IRegionCollector collector)
          Appends all neighbors of the node specified through queueProcessPtr and queue to the queue and increases queueAppendPtr appropriately.
static void splitMerge(int maxHierarchy, int[] bitSet, int[] quadTreeAv)
          Creates a quadtree structure reflected in bitSet using data in quadTreeAv by performing the following tasks: Tasks: - copy original picture in argb values into quadTreeAv and convert pixel values to HSV - create QuadTree performing merge step (we start with a fully splitted quadTree) - at each merge step update bitSet and quadTreeAv by computing average pixel value of node A similarity check of 4 children is used to estimate if a merge is possible.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_IMGSIZE

public static final int CONFIG_IMGSIZE
Length of square image, image size has to be CONFIG_IMGSIZE^2

See Also:
Constant Field Values

CONFIG_MAXHIERARCHY

public static final int CONFIG_MAXHIERARCHY
Hierarchy level at which the image resides, has to be QuadNode.calculateMaxHierarchy(CONFIG_IMGSIZE) - that is log2(CONFIG_IMGSIZE)

See Also:
Constant Field Values

QUADTREE_AV

public static int[] QUADTREE_AV
Int array holding all average node color / quadtree_up /quadtree_down values within the splitMerge phase. After grouping holds region appliance information. Size has to be QuadNode.calculateSize(CONFIG_MAXHIERARCHY).


QUADTREE_BITSET

public static int[] QUADTREE_BITSET
Bit set holding information whether a quadtree node exists within the image. Size has to be BitSet.calculateSize(QUADTREE_AV.length).

Constructor Detail

SplitMergeService

public SplitMergeService()
Method Detail

doService

public static void doService(IRegionCollector collector)
This is the main entry point for performing the Split and Merge Algorithm image has to be contained within int array QUADTREE_AV

Parameters:
collector - list, which stores a vector describing a list of regions within the image

splitMerge

public static void splitMerge(int maxHierarchy,
                              int[] bitSet,
                              int[] quadTreeAv)
Creates a quadtree structure reflected in bitSet using data in quadTreeAv by performing the following tasks: Tasks: - copy original picture in argb values into quadTreeAv and convert pixel values to HSV - create QuadTree performing merge step (we start with a fully splitted quadTree) - at each merge step update bitSet and quadTreeAv by computing average pixel value of node A similarity check of 4 children is used to estimate if a merge is possible. The procedure updates bitSet and quadTreeAv to hold all necessary quadTree information

Parameters:
maxHierarchy - the maximum hierarchy level of embedded argbImage
bitSet - the structure reflecting information whether a node is occupied or not
quadTreeAv - the structure reflecting average pixel values of quadtree nodes

group

public static void group(int maxHierarchy,
                         int[] bitSet,
                         int[] quadTreeAv,
                         int[] todoBitSet,
                         int[] queue,
                         int[] stack,
                         IRegionCollector collector)
Appends all neighbors of the node specified through queueProcessPtr and queue to the queue and increases queueAppendPtr appropriately. Returns the new queueAppendPtr

Parameters:
maxHierarchy - the maximum hierarchy level of embedded argbImage
bitSet - contains information whether the quadNode entry exists or not
quadTreeAv - is the structure reflecting average pixel values of quadtree nodes
todoBitSet - contains information which node has already been processed and is already contained in a region
queue - where to insert new elements of the region
stack - stack used for processing neighbors
collector - results are stored using this collector