31 #include "drwnVision.h"
89 const char *
type()
const {
return "pixelSegModel"; }
92 virtual bool save(drwnXMLNode& xml)
const;
93 virtual bool load(drwnXMLNode& xml);
96 int numLabels()
const {
return _pixelUnaryModel.numClasses(); }
103 return *_featureGenerator;
108 void learnTrainingClassWeights(
const vector<string>& baseNames);
110 void learnBoostedPixelModels(
const vector<string>& baseNames,
int subSample = 0);
112 void learnPixelUnaryModel(
const vector<string>& baseNames,
int subSample = 0);
114 void learnPixelContrastWeight(
const vector<string>& baseNames);
116 void learnPixelContrastWeight(
double weight);
118 void learnLongRangePairwiseWeight(
const vector<string>& baseNames,
double threshold,
unsigned radius = 4);
120 void learnLongRangePairwiseWeight(
double weight,
double threshold,
unsigned radius = 4);
122 void learnRobustPottsWeight(
const vector<string>& baseNames);
124 void learnRobustPottsWeight(
double weight);
126 void learnPixelContrastAndRobustPottsWeights(
const vector<string>& baseNames);
128 void learnPixelContrastAndLongRangeWeights(
const vector<string>& baseNames,
double threshold,
unsigned radius = 4);
147 virtual double inferPixelLabels(
const vector<string>& baseNames,
148 vector<MatrixXi>& predictedLabels)
const;
154 void computeBoostedResponses(
const vector<double>& x, vector<double>& y)
const;
159 void buildSampledTrainingSet(
const vector<string>& baseNames,
const char *labelExt,
160 int nLabels, vector<vector<double> >& featureVectors, vector<int>& featureLabels,
161 int subSample,
bool bRawFeatures)
const;
164 void crossValidateWeights(
const vector<string>& baseNames,
165 const vector<double>& pairwiseContrastValues,
166 const vector<double>& robustPottsValues,
const vector<double>& longRangeValues);
double _pixelContrastWeight
weight for pairwise constrast-dependent smoothness term
Definition: drwnPixelSegModel.h:69
Encapsulates a single instance of an image for multi-class pixel labeling problems (i...
Definition: drwnSegImageInstance.h:47
double getPairwiseContrastWeight() const
get the weight of the pairwise contrast term
Definition: drwnPixelSegModel.h:131
double _longRangeEdgeThreshold
percentage of long range edges to include
Definition: drwnPixelSegModel.h:76
drwnTMultiClassLogistic< drwnBiasJointFeatureMap > _pixelUnaryModel
pixelwise unary model
Definition: drwnPixelSegModel.h:64
interface for objects that can serialize and de-serialize themselves
Definition: drwnInterfaces.h:48
Whitens (zero mean, unit variance) feature vector (see also drwnPCA).
Definition: drwnFeatureWhitener.h:55
double _robustPottsWeight
weight for robust potts consistency term
Definition: drwnPixelSegModel.h:79
vector< double > _classTrainingWeights
class training weights (normalized to sum to one)
Definition: drwnPixelSegModel.h:54
Implements a pixel-level CRF model for multi-class image segmentation (pixel labeling).
Definition: drwnPixelSegModel.h:48
Interface for generating per-pixel features for a drwnSegImageInstance object.
Definition: drwnSegImagePixelFeatures.h:49
double getRobustPottsWeight() const
get the weight of the robust potts term
Definition: drwnPixelSegModel.h:135
int numLabels() const
return the number of labels that this model has been trained to recognize
Definition: drwnPixelSegModel.h:96
double getLongRangePairwiseWeight() const
get the weight of the long range pairwise term
Definition: drwnPixelSegModel.h:133
double _longRangeEdgeWeight
weight for (long range) auxiliary edges
Definition: drwnPixelSegModel.h:72
const char * type() const
returns object type as a string (e.g., Foo::type() { return "Foo"; })
Definition: drwnPixelSegModel.h:89
vector< drwnBoostedClassifier * > _pixelClassModels
boosted pixel classifiers for generating pixel features (if boosted pixel classifiers are not learned...
Definition: drwnPixelSegModel.h:59
drwnFeatureWhitener _pixelFeatureWhitener
feature whitener for unary model
Definition: drwnPixelSegModel.h:62
drwnSegImagePixelFeatures * _featureGenerator
pixel feature generator
Definition: drwnPixelSegModel.h:51
const drwnSegImagePixelFeatures & getFeatureGenerator() const
return the object used to generate pixel features from the image instance
Definition: drwnPixelSegModel.h:102
unsigned _longRangeMatchRadius
radius for long range edge match
Definition: drwnPixelSegModel.h:74