#include <Quantizer.h>
Inheritance diagram for prapi::EqualAreaQuantizer:

The distribution is split into pieces whose areas are as close to equal as possible. This ensures maximum resolution where feature density is highest.
Public Methods | |
| EqualAreaQuantizer (int levels=1) | |
| Create a EqualAreaQuantizer with the given number of quantization levels. | |
| template<class T> void | extractFrom (const List< T > &lst) |
| Extract the quantization from a sorted list of values. | |
| template<class T> void | extractFrom (const LinkedList< T > *lst) |
| Extract the quantization from a sorted linked list of values. | |
| int | getBinIndex (double value) throw (QuantizationException&) |
| Get the bin index for the given value, i.e. | |
| void | setLevels (int l) |
| Set the number of quantization levels. | |
| List< double > | getCutvalues () const |
| Get the list of cut values used by this quantizer. | |
| const List< double > & | cutvalues () const |
| Get the list of cut values used by this quantizer. | |
| List< double > & | cutvalues () |
| Get the list of cut values used by this quantizer. | |
Static Public Methods | |
| template<class T> void | createList (const Matrix< T > &mat, List< T > &lst, int n=0) |
| Create a list of values from a matrix. | |
| template<class T> void | createList (const Matrix< T > &mat, SortedLinkedList< T > *&lst, int n=0) |
| Create a linked list of values from a matrix. | |
Friends | |
| std::ostream & | operator<< (std::ostream &sout, const EqualAreaQuantizer &quantizer) |
| Write to a stream. | |
| std::istream & | operator>> (std::istream &sin, EqualAreaQuantizer &quantizer) |
| Read from a stream. | |
|
||||||||||||||||||||
|
Create a linked list of values from a matrix. The list will contain the matrix' items in ascending order, and the result is suitable for an extractFrom(SortedLinkedList*) call.
Example: Matrix<double> mat(...); SortedLinkedList<double>* lst = NULL; EqualAreaQuantizer::createList(img,lst); EqualAreaQuantizer q(8); q.extractFrom(lst);
|
|
||||||||||||||||||||
|
Create a list of values from a matrix. The list will contain the matrix' items in scanning order. If a sorted list is used, the result is suitable for an extractFrom(List&) call.
Example: Matrix<double> mat(...); SortedDoubleList lst; EqualAreaQuantizer::createList(img,lst); EqualAreaQuantizer q(8); q.extractFrom(lst); Note that using a SortedList for a large number of entries is extremely inefficient as each insertion into the list may involve massive memory transfers. A better solution is to use an ordinary list and sort it afterwards or to use the createList(Matrix&,SortedLinkedList*&) method.
|
|
||||||||||
|
Extract the quantization from a sorted linked list of values. This method does not assume any prior quantization. That is, the given list is just an ordered set of values.
|
|
||||||||||
|
Extract the quantization from a sorted list of values. This method does not assume any prior quantization. That is, the given list is just an ordered set of values.
|
|
|
Get the bin index for the given value, i.e. quantize the value.
Implements prapi::Quantizer. |
|
|
Set the number of quantization levels. The output values produced by getBinIndex will range from 0 to l-1. Reimplemented from prapi::Quantizer. |