Package net.sourceforge.jiu.color.data
Interface CoOccurrenceMatrix
-
- All Known Implementing Classes:
MemoryCoOccurrenceMatrix
public interface CoOccurrenceMatrixAn interface for co-occurrence matrices. An implementing class storesintcounter values for pairs of pixels. These counters represent the number of times two pixels are direct neighbors in an image.- Author:
- Marco Schmidt
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclear()Sets all counters to zero.intgetDimension()Returns the dimension of this matrix.intgetValue(int i, int j)Returns the matrix value at a given position.voidincValue(int i, int j)Increases the counter for pair (i, j) by one.voidsetValue(int i, int j, int newValue)Sets the counter for pair (i, j) to a new value.
-
-
-
Method Detail
-
clear
void clear()
Sets all counters to zero.
-
getDimension
int getDimension()
Returns the dimension of this matrix. This is the number of rows and columns.- Returns:
- matrix dimension (larger than zero)
-
getValue
int getValue(int i, int j)Returns the matrix value at a given position.- Parameters:
i- column index, from 0 togetDimension()- 1j- row index, from 0 togetDimension()- 1- Throws:
IllegalArgumentException- for invalid index pairs (i, j)
-
incValue
void incValue(int i, int j)Increases the counter for pair (i, j) by one. This method can be implemented by the callsetValue(i, j, getValue(i, j) + 1);.- Parameters:
i- column index, from 0 togetDimension()- 1j- row index, from 0 togetDimension()- 1- Throws:
IllegalArgumentException- for invalid index pairs (i, j)
-
setValue
void setValue(int i, int j, int newValue)Sets the counter for pair (i, j) to a new value.- Parameters:
i- column index, from 0 togetDimension()- 1j- row index, from 0 togetDimension()- 1- Throws:
IllegalArgumentException- for invalid index pairs (i, j)
-
-