Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

prapi::texture::CoOccurence Class Reference

#include <CoOccurence.h>

Inheritance diagram for prapi::texture::CoOccurence:

prapi::ImageTransform< int, int > prapi::FeatureExtractor< double, util::Matrix< int > > Object List of all members.

Detailed Description

A class for calculating co-occurence matrices.


Public Types

enum  CoOccurenceAngle {
  DIR0, DIR45, DIR90, DIR135,
  ALL
}
 This enumeration specifies the angle of made cooccurence matrix The posibilities are: DIR0,DIR45,DIR90,DIR135 and ALL.

enum  Feature {
  MOMENT, INVERSE_MOMENT, CONTRAST, HOMOGENITY,
  ENTROPY
}
 An enumeration for the features calculated from co-occurrence matrices. More...


Public Methods

 CoOccurence (CoOccurenceAngle angle, int radius)
 The constructor of CoOccurence matrix.

void setAngle (CoOccurenceAngle angle)
 Set the angle.

void setRadius (int radius)
 Set the radius.

CoOccurenceAngle getAngle ()
 Get the angle.

int getRadius ()
 Get the radius.

util::Matrix< int > getTransformedImage (const util::Matrix< int > &mat) throw (ImageTransformException&)
 The function makes the co-occurence matrix for the specified direction(s).

double getFeature (const util::Matrix< int > &mat, Feature feature, int k=1, int n=1)
 Calculate a feature from a co-occurrence matrix.

util::List< double > getFeatureVector (const util::Matrix< int > &mat) throw (FeatureExtractionException&)
 Create a feature vector containing all co-occurrence features listed in the Feature enumeration.


Member Enumeration Documentation

enum prapi::texture::CoOccurence::Feature
 

An enumeration for the features calculated from co-occurrence matrices.

Possibilities:

 MOMENT          - The k element difference moment.[ Sum(Sum((i-j)'k*mat(i,j))) ]
 INVERSE_MOMENT  - The k element inverse difference moment. [ Sum(Sum(mat(i,j)/(i-j)'k ]
 CONTRAST        - The contrast. [ Sum(Sum( |i-j|'k*mat(i,j)'n ]
 HOMOGENITY      - Homogenity. [ Sum(Sum(mat(i,j)/(i+ |i-j|)))
 ENTROPY         - Entropy. [ -Sum(Sum(mat(i,j)*log(mat(i,j)))) ]
 


Constructor & Destructor Documentation

prapi::texture::CoOccurence::CoOccurence CoOccurenceAngle    angle,
int    radius
[inline]
 

The constructor of CoOccurence matrix.

Parameters:
angle  The Ange on which direction the matrix is wanted.
radius  The radius how far the matrix will be calculated.


Member Function Documentation

double prapi::texture::CoOccurence::getFeature const util::Matrix< int > &    mat,
Feature    feature,
int    k = 1,
int    n = 1
 

Calculate a feature from a co-occurrence matrix.

Parameters:
mat  The covariance matrix where the feature will be calculated.
feature  The feature which wanted to calculate.
k  The power of (i-j).
n  The power of mat(i,j) in contrast feature.

List< double > prapi::texture::CoOccurence::getFeatureVector const util::Matrix< int > &    mat throw (FeatureExtractionException&) [virtual]
 

Create a feature vector containing all co-occurrence features listed in the Feature enumeration.

Parameters:
mat  The matrix from which the statistics will be calculated.

Implements prapi::FeatureExtractor< double, util::Matrix< int > >.

Matrix< int > prapi::texture::CoOccurence::getTransformedImage const util::Matrix< int > &    mat throw (ImageTransformException&) [virtual]
 

The function makes the co-occurence matrix for the specified direction(s).

The returned matrices will be of size NxN where N = min(256,max(mat)).

Parameters:
mat  The matrix from which the matrix wanted to calculate.
Returns:
a list of co-occurrence matrices for the wanted directions

Implements prapi::ImageTransform< int, int >.


The documentation for this class was generated from the following files:
Documentation generated on 11.09.2003 with Doxygen.
The documentation is copyrighted material.
Copyright © Topi Mäenpää 2003. All rights reserved.