vocabtree  0.0.1
SimpleDataset::SimpleImage Class Reference

SimpleImage class used with the SimpleDataset class. More...

#include <dataset.hpp>

Inheritance diagram for SimpleDataset::SimpleImage:
Collaboration diagram for SimpleDataset::SimpleImage:

Public Member Functions

 SimpleImage (const std::string &path, uint64_t imageid)
 Constructs a SimpleImage given the Image relative path in the Dataset directory, and a corresponding unique image ID. More...
 
std::string feature_path (const std::string &feat_name) const
 Returns the corresponding feature path given a feature name (ex. "sift"). More...
 
std::string location () const
 Returns the image location relative to the database data directory. More...
 
- Public Member Functions inherited from Image
 Image (uint64_t image_id)
 
virtual ~Image ()
 All images are assigned a unique id in the dataset. More...
 

Protected Attributes

std::string image_path
 

Additional Inherited Members

- Data Fields inherited from Image
uint64_t id
 

Detailed Description

SimpleImage class used with the SimpleDataset class.

Features are stored in <data_dir>/<feats>/<feat_name>

Definition at line 82 of file dataset.hpp.

Constructor & Destructor Documentation

SimpleDataset::SimpleImage::SimpleImage ( const std::string &  path,
uint64_t  imageid 
)

Constructs a SimpleImage given the Image relative path in the Dataset directory, and a corresponding unique image ID.

Definition at line 126 of file dataset.cxx.

References image_path.

126  : Image(imageid) {
127  image_path = path;
128 }

Member Function Documentation

std::string SimpleDataset::SimpleImage::feature_path ( const std::string &  feat_name) const
virtual

Returns the corresponding feature path given a feature name (ex. "sift").

Implements Image.

Definition at line 130 of file dataset.cxx.

130  {
131  uint32_t level0 = id >> 20;
132  uint32_t level1 = (id - (level0 << 20)) >> 10;
133 
134  std::stringstream ss;
135  ss << "/feats/" << feat_name << "/" <<
136  std::setw(4) << std::setfill('0') << level0 << "/" <<
137  std::setw(4) << std::setfill('0') << level1 << "/" <<
138  std::setw(9) << std::setfill('0') << id << "." << feat_name;
139 
140  return ss.str();
141 }
std::string SimpleDataset::SimpleImage::location ( ) const
virtual

Returns the image location relative to the database data directory.

Implements Image.

Definition at line 143 of file dataset.cxx.

Referenced by bench_oxford(), compute_features(), main(), and SimpleDataset::write().

143  {
144  return image_path;
145 }

Field Documentation

std::string SimpleDataset::SimpleImage::image_path
protected

Definition at line 95 of file dataset.hpp.

Referenced by SimpleImage().


The documentation for this class was generated from the following files: