Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

prapi::texture::KernelSegmentator Class Reference

#include <Segmentation.h>

List of all members.

Detailed Description

KernelSegmentator performs supervised segmentation on an matrix.

On each pixel of an input matrix, classifier constructs a sample that is classified using a given classifier. The classification result is placed on an output matrix. The sample is constructed by placing a kernel over the input pixel and calculating a histogram over it. The segmentation problem is presented as a layered matrix. To get a histogram bin index for a pixel, the segmentator collects the corresponding pixels from each layer to a vector and consults a LayerCombiner to modify the local histogram.

Public Methods

 KernelSegmentator (Classifier< int > &classifier, Matrix< char > kernel, const MultiFeatureHistogram::LayerCombiner &combiner)
 Create a new Segmentator.

Matrix< int > getSegmentation (const util::List< Matrix< int > > &mats)
 Assign each pixel its classification.

Static Public Methods

Matrix< char > createCircularKernel (int radius)
 Create a circular kernel.

Matrix< char > createSquareKernel (int radius)
 Create a square kernel.

double getError (const Matrix< int > &segmentation, const Matrix< int > &groundTruth) throw (InvalidArgumentException&)
 Get the fraction of misclassified pixels given a ground truth matrix.

Constructor & Destructor Documentation

prapi::texture::KernelSegmentator::KernelSegmentator Classifier< int > &    classifier,
Matrix< char >    kernel,
const MultiFeatureHistogram::LayerCombiner   combiner

Create a new Segmentator.

classifier  the classifier to be used in classifying pixels
length  the length of the histograms that are created
kernel  a kernel matrix with ones on the pixels that are considered in building up the local histogram.
combiner  a LayerCombiner that is used to modify the local histogram

Member Function Documentation

Matrix< char > prapi::texture::KernelSegmentator::createCircularKernel int    radius [static]

Create a circular kernel.

The result is a (radius*2+1)x(radius*2+1) matrix with a "disk" of ones in the center.

radius  the radius of the kernel disk

Matrix< char > prapi::texture::KernelSegmentator::createSquareKernel int    radius [static]

Create a square kernel.

The result is a (radius*2+1)x(radius*2+1) matrix with with all entries set to ones.

radius  the radius of the kernel

double prapi::texture::KernelSegmentator::getError const Matrix< int > &    segmentation,
const Matrix< int > &    groundTruth
throw (InvalidArgumentException&) [static]

Get the fraction of misclassified pixels given a ground truth matrix.

The ground truth matrix should contain the correct classifications for the pixels.

InvalidArgumentException  & if the matrices are of different size

Matrix< int > prapi::texture::KernelSegmentator::getSegmentation const util::List< Matrix< int > > &    mats

Assign each pixel its classification.

mats  matrix layers.
combine  how to combine layers

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.