24 #include <core/exception.h>
25 #include <fvutils/statistical/histogram_block.h>
26 #include <fvutils/statistical/histogram_file.h>
30 namespace firevision {
39 HistogramFile::HistogramFile()
42 attached_histograms.clear();
48 attached_histograms.clear();
57 if (attached_histograms.find(block->
object_type()) != attached_histograms.end()) {
72 FireVisionDataFile::BlockList::iterator blit;
76 for (blit = bl.begin(); blit != bl.end(); ++blit) {
77 if ((*blit)->type() == FIREVISION_HISTOGRAM_TYPE_16
78 || (*blit)->type() == FIREVISION_HISTOGRAM_TYPE_32) {
98 if (attached_histograms.find(object_type) == attached_histograms.end()) {
99 throw Exception(
"File contains no histogram for type %d", object_type);
102 return attached_histograms[object_type]->get_value(x, y, z);
115 if (attached_histograms.find(object_type) == attached_histograms.end()) {
116 throw Exception(
"File contains no histogram for type %d", object_type);
119 attached_histograms[object_type]->set_value(x, y, z, val);