56 void readConfiguration(drwnXMLNode& node);
58 drwnProperties::setProperty(drwnProperties::findProperty(name), value);
61 void usage(std::ostream& os)
const;
66 string filebase(
const char *dirKey,
const char *baseName);
69 string filebase(
const char *dirKey,
const string& baseName);
72 string filename(
const char *dirKey,
const char *baseName,
const char *extKey);
75 string filename(
const char *dirKey,
const string& baseName,
const char *extKey);
84 typedef enum _drwnStandardMultiSegRegionDatasets {
89 } drwnStandardMultiSegRegionDatasets;
143 void read(
const char *filename);
145 void read(drwnXMLNode& root);
148 bool empty()
const {
return _colors.empty(); }
150 int size()
const {
return (
int)_colors.size(); }
155 set<int> keys()
const;
157 string name(
int key)
const;
159 unsigned int color(
int key)
const;
162 static unsigned char red(
unsigned int c) {
163 return ((c >> 16) & 0xff);
166 static unsigned char green(
unsigned int c) {
167 return ((c >> 8) & 0xff);
170 static unsigned char blue(
unsigned int c) {
174 static unsigned int rgb(
unsigned char r,
unsigned char g,
unsigned char b) {
175 return ((
unsigned int)(r << 16) | (
unsigned int)(g << 8) | (
unsigned int)b);
179 virtual void initializeForDataset(
const drwnStandardMultiSegRegionDatasets& dataset);
182 MatrixXi convertImageToLabels(
const cv::Mat& img)
const;
184 MatrixXi convertImageToLabels(
const char *filename)
const;
187 MatrixXi loadLabelFile(
const char *filename)
const;
191 unsigned int& operator[](
int key);
195 virtual void initDefaultRegions();
static unsigned char green(unsigned int c)
converts from 32-bit colour to 8-bit green
Definition: drwnMultiSegConfig.h:166
static unsigned int rgb(unsigned char r, unsigned char g, unsigned char b)
converts 8-bit red, green and blue into 32-bit colour
Definition: drwnMultiSegConfig.h:174
string _segDir
directory containing over-segmentations (relative to _baseDir)
Definition: drwnMultiSegConfig.h:41
Provides an abstract interface for dynamic properties.
Definition: drwnProperties.h:338
string _cacheDir
directory to store pre-computed features (relative to _baseDir)
Definition: drwnMultiSegConfig.h:42
string _imgDir
directory containing images (relative to _baseDir)
Definition: drwnMultiSegConfig.h:39
bool _bUseCache
set true to store features in the _cacheDir
Definition: drwnMultiSegConfig.h:48
bool _bCompressedCache
set true to compress cached data
Definition: drwnMultiSegConfig.h:49
void setConfiguration(const char *name, const char *value)
set individual configurable parameter
Definition: drwnMultiSegConfig.h:57
string _segExt
file extension for over-segmentations (drwnSuperpixelContainer)
Definition: drwnMultiSegConfig.h:47
static unsigned char red(unsigned int c)
converts from 32-bit colour to 8-bit red
Definition: drwnMultiSegConfig.h:162
Interface for a configurable module.
Definition: drwnConfigManager.h:35
string _imgExt
file extension of images
Definition: drwnMultiSegConfig.h:45
string _outputDir
directory to write results (relative to _baseDir)
Definition: drwnMultiSegConfig.h:44
string _lblDir
directory conatining labels (relative to _baseDir)
Definition: drwnMultiSegConfig.h:40
int size() const
returns the number of defined regions
Definition: drwnMultiSegConfig.h:150
Manages configuration settings for multiple image segmentation.
Definition: drwnMultiSegConfig.h:36
bool empty() const
returns true if no regions have been definied
Definition: drwnMultiSegConfig.h:148
vector< string > _names
name of class for i-th key
Definition: drwnMultiSegConfig.h:130
string _lblExt
file extension of image
Definition: drwnMultiSegConfig.h:46
Provides a mechanism for mapping region IDs to colours and class names. Can be initialized from an XM...
Definition: drwnMultiSegConfig.h:126
map< int, int > _keys
mapping from keys to colour and name index
Definition: drwnMultiSegConfig.h:128
string _baseDir
base directory for data, models and results
Definition: drwnMultiSegConfig.h:38
static unsigned char blue(unsigned int c)
converts from 32-bit colour to 8-bit blue
Definition: drwnMultiSegConfig.h:170
vector< unsigned int > _colors
colour for i-th key
Definition: drwnMultiSegConfig.h:129
string _modelsDir
directory to read and write model files (relative to _baseDir)
Definition: drwnMultiSegConfig.h:43