#include <Segmentation.h>
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. | |
|
||||||||||||||||
|
Create a new Segmentator.
|
|
|
Create a circular kernel. The result is a (radius*2+1)x(radius*2+1) matrix with a "disk" of ones in the center.
|
|
|
Create a square kernel. The result is a (radius*2+1)x(radius*2+1) matrix with with all entries set to ones.
|
|
||||||||||||
|
Get the fraction of misclassified pixels given a ground truth matrix. The ground truth matrix should contain the correct classifications for the pixels.
|
|
|
Assign each pixel its classification.
|