#include <fvutils/statistical/histogram_block.h>
Inheritance diagram for firevision::HistogramBlock:
Public Member Functions | |
HistogramBlock (histogram_block_type_t type, hint_t object_type, uint16_t width, uint16_t height, uint16_t depth=0) | |
Constructor. | |
HistogramBlock (FireVisionDataFileBlock *block) | |
Copy constructor. | |
virtual | ~HistogramBlock () |
Destructor. | |
uint16_t | width () const |
Returns the the width of the histogram. | |
uint16_t | height () const |
Returns the the height of the histogram. | |
uint16_t | depth () const |
Returns the the depth of the histogram. | |
hint_t | object_type () const |
Returns the type of the object the histogram is associated with. | |
void | set_object_type (hint_t object_type) |
Set the type of the object the histogram is associated with. | |
void | set_data (uint32_t *data) |
Directly set the histogram data. | |
void | set_value (uint16_t x, uint16_t y, uint32_t val) |
Store a value in a certain cell of a 2-dimensional histogram. | |
void | set_value (uint16_t x, uint16_t y, uint16_t z, uint32_t val) |
Store a value in a certain cell of a 3-dimensional histogram. | |
uint32_t | get_value (uint16_t x, uint16_t y) |
Obtain a certain value from a 2-dimensional histogram. | |
uint32_t | get_value (uint16_t x, uint16_t y, uint16_t z) |
Obtain a certain value from a 3-dimensional histogram. | |
void | reset () |
Reset the histogram. |
Additionally, the very basic routines to acccess and manipulate data in the histograms are provided.
Definition at line 55 of file histogram_block.h.
firevision::HistogramBlock::HistogramBlock | ( | histogram_block_type_t | type, | |
hint_t | object_type, | |||
uint16_t | width, | |||
uint16_t | height, | |||
uint16_t | depth = 0 | |||
) |
Constructor.
type | the type of the histogram block | |
object_type | the object type this histogram is meant for (e.g, ball) | |
width | the width of the histogram | |
height | the height of the histogram | |
depth | the depth of the histogram |
Definition at line 49 of file histogram_block.cpp.
References firevision::FireVisionDataFileBlock::_data, firevision::FireVisionDataFileBlock::_spec_header, firevision::_histogram_block_header_t::depth, firevision::_histogram_block_header_t::height, firevision::_histogram_block_header_t::object_type, and firevision::_histogram_block_header_t::width.
firevision::HistogramBlock::HistogramBlock | ( | FireVisionDataFileBlock * | block | ) |
Copy constructor.
block | another block |
Definition at line 66 of file histogram_block.cpp.
References firevision::FireVisionDataFileBlock::_data, and firevision::FireVisionDataFileBlock::_spec_header.
firevision::HistogramBlock::~HistogramBlock | ( | ) | [virtual] |
uint16_t firevision::HistogramBlock::depth | ( | ) | const |
Returns the the depth of the histogram.
Definition at line 100 of file histogram_block.cpp.
References firevision::_histogram_block_header_t::depth.
Referenced by firevision::Histogram::Histogram(), and firevision::BayesColormapGenerator::load_histograms().
uint32_t firevision::HistogramBlock::get_value | ( | uint16_t | x, | |
uint16_t | y, | |||
uint16_t | z | |||
) |
Obtain a certain value from a 3-dimensional histogram.
x | the x-coordinate | |
y | the y-coordinate | |
z | the z-coordinate |
Definition at line 222 of file histogram_block.cpp.
References firevision::_histogram_block_header_t::depth, firevision::_histogram_block_header_t::height, and firevision::_histogram_block_header_t::width.
uint32_t firevision::HistogramBlock::get_value | ( | uint16_t | x, | |
uint16_t | y | |||
) |
Obtain a certain value from a 2-dimensional histogram.
x | the x-coordinate | |
y | the y-coordinate |
Definition at line 195 of file histogram_block.cpp.
References firevision::_histogram_block_header_t::depth, firevision::_histogram_block_header_t::height, and firevision::_histogram_block_header_t::width.
Referenced by firevision::Histogram::add(), firevision::Histogram::get_average(), firevision::Histogram::get_median(), firevision::Histogram::get_sum(), firevision::Histogram::get_value(), firevision::Histogram::inc_value(), firevision::Histogram::print_to_stream(), firevision::Histogram::set_value(), and firevision::Histogram::sub().
uint16_t firevision::HistogramBlock::height | ( | ) | const |
Returns the the height of the histogram.
Definition at line 91 of file histogram_block.cpp.
References firevision::_histogram_block_header_t::height.
Referenced by firevision::Histogram::Histogram(), and firevision::BayesColormapGenerator::load_histograms().
hint_t firevision::HistogramBlock::object_type | ( | ) | const |
Returns the type of the object the histogram is associated with.
Definition at line 109 of file histogram_block.cpp.
References firevision::_histogram_block_header_t::object_type.
Referenced by firevision::HistogramFile::add_histogram_block().
void firevision::HistogramBlock::reset | ( | ) |
Reset the histogram.
Definition at line 247 of file histogram_block.cpp.
References firevision::FireVisionDataFileBlock::_data_size.
Referenced by firevision::Histogram::reset().
void firevision::HistogramBlock::set_data | ( | uint32_t * | data | ) |
Directly set the histogram data.
Note: You are reponsible that the data has the right size and format!
data | pointer to the histogram data |
Definition at line 128 of file histogram_block.cpp.
References firevision::FireVisionDataFileBlock::_data, and firevision::FireVisionDataFileBlock::_data_size.
void firevision::HistogramBlock::set_object_type | ( | hint_t | object_type | ) |
Set the type of the object the histogram is associated with.
object_type | the new type of the object |
Definition at line 118 of file histogram_block.cpp.
References firevision::_histogram_block_header_t::object_type.
Referenced by firevision::BayesColormapGenerator::save_histograms().
void firevision::HistogramBlock::set_value | ( | uint16_t | x, | |
uint16_t | y, | |||
uint16_t | z, | |||
uint32_t | val | |||
) |
Store a value in a certain cell of a 3-dimensional histogram.
x | the x-coordinate | |
y | the y-coordinate | |
z | the z-coordinate | |
val | the new value |
Definition at line 166 of file histogram_block.cpp.
References firevision::_histogram_block_header_t::depth, firevision::_histogram_block_header_t::height, and firevision::_histogram_block_header_t::width.
void firevision::HistogramBlock::set_value | ( | uint16_t | x, | |
uint16_t | y, | |||
uint32_t | val | |||
) |
Store a value in a certain cell of a 2-dimensional histogram.
x | the x-coordinate | |
y | the y-coordinate | |
val | the new value |
Definition at line 139 of file histogram_block.cpp.
References firevision::_histogram_block_header_t::depth, firevision::_histogram_block_header_t::height, and firevision::_histogram_block_header_t::width.
Referenced by firevision::Histogram::add(), firevision::Histogram::inc_value(), and firevision::Histogram::set_value().
uint16_t firevision::HistogramBlock::width | ( | ) | const |
Returns the the width of the histogram.
Definition at line 82 of file histogram_block.cpp.
References firevision::_histogram_block_header_t::width.
Referenced by firevision::Histogram::Histogram(), and firevision::BayesColormapGenerator::load_histograms().