de.unihalle.informatik.MiToBo.core.datatypes
Class MTBStructuringElement

java.lang.Object
  extended by de.unihalle.informatik.MiToBo.core.datatypes.MTBStructuringElement

@ALDMetaInfo(export=ALLOWED)
@ALDParametrizedClass
public class MTBStructuringElement
extends Object

class representing a 2D flat (, i.e. without different gray values) structuring element
for the use with morphological operations
values are stored in a recatangular 2D array (rows: 1st dimension, columns: 2nd dimension)
whereas onValue represents set locations and 0 represents unset locations

Author:
glass

Constructor Summary
MTBStructuringElement()
          create quadratic 3x3 structuring element
MTBStructuringElement(int[][] mask)
          creates structuring element from given 2D-array, center is assumed to be at the center of the array
MTBStructuringElement(int[][] mask, int centerX, int centerY)
          creates structuring element from given 2D-array
 
Method Summary
static MTBStructuringElement createCircularElement(int size)
           
static MTBStructuringElement createHorizontalLineElement(int length)
           
static MTBStructuringElement createQuadraticElement(int size)
           
static MTBStructuringElement createRectangularElement(int sizeX, int sizeY)
           
static MTBStructuringElement createVerticalLineElement(int length)
           
 int getCenterX()
           
 int getCenterY()
           
 int getSizeX()
           
 int getSizeY()
           
 int getValue(int x, int y)
           
 MTBStructuringElement invert()
          inverts the values of the structuring element
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MTBStructuringElement

public MTBStructuringElement(int[][] mask,
                             int centerX,
                             int centerY)
creates structuring element from given 2D-array

Parameters:
mask -
centerX -
centerY -

MTBStructuringElement

public MTBStructuringElement(int[][] mask)
creates structuring element from given 2D-array, center is assumed to be at the center of the array

Parameters:
mask -

MTBStructuringElement

public MTBStructuringElement()
create quadratic 3x3 structuring element

Method Detail

getValue

public int getValue(int x,
                    int y)
Parameters:
x -
y -
Returns:
value at (x,y)

getSizeX

public int getSizeX()
Returns:
size in x-direction (width)

getSizeY

public int getSizeY()
Returns:
size in y-direction (height)

getCenterX

public int getCenterX()
Returns:
x-coordinate of center

getCenterY

public int getCenterY()
Returns:
y-coordinate of center

createQuadraticElement

public static MTBStructuringElement createQuadraticElement(int size)
Parameters:
size -
Returns:
quadratic shaped structuring element

createRectangularElement

public static MTBStructuringElement createRectangularElement(int sizeX,
                                                             int sizeY)
Parameters:
sizeX -
sizeY -
Returns:
rectangular shaped structuring element

createCircularElement

public static MTBStructuringElement createCircularElement(int size)
Parameters:
size -
Returns:
circular shaped structuring element

createHorizontalLineElement

public static MTBStructuringElement createHorizontalLineElement(int length)
Parameters:
length -
value -
Returns:
line shaped structuring element, horizontally (in x-direction) oriented

createVerticalLineElement

public static MTBStructuringElement createVerticalLineElement(int length)
Parameters:
length -
Returns:
line shaped structuring element, vertically (in y-direction) oriented

invert

public MTBStructuringElement invert()
inverts the values of the structuring element

Returns:
inverted structuring element


Copyright © 2010–2015 Martin Luther University Halle-Wittenberg. All rights reserved.