Exemplo n.º 1
0
void DecisionStrategy::Init(){
	_decisionWeights = new Vector<Vector<FeatureWeight>*>();
	for (int d = 0; d < NUM_DECISIONS; d++){
		_decisionWeights->PushEnd(new Vector<FeatureWeight>());
		// only add pertinent features
		Vector<Feature>* pertinentFeatures = getPertinentFeatures(static_cast<Decisions>(d));
		for (UINT f = 0; f < pertinentFeatures->Length(); f++) {
			Feature feature = pertinentFeatures->at(f);
			FeatureWeight fw(feature, initGauss(gen));
			_decisionWeights->at(d)->PushEnd(fw);
		}
	}
}
Exemplo n.º 2
0
void PixelModel::initModel(){
	
	//TODO fix so we initialize with some data
	double pixelValues[NUM_CHANNELS] = {50,50,50};
	double sigma[NUM_CHANNELS] = {30,30,30};

	for(int r=0; r < rows; r++){
		for(int c=0; c < cols; c++){
			for(int k=0; k < NUM_DISTRIBUTIONS; k++){
				initGauss(getPixelGauss(r,c,k),sigma,pixelValues,1.0/NUM_DISTRIBUTIONS);
				for(int i=0; i < NUM_CHANNELS; i++){
					pixelValues[i] = 50 * k + 50;
				}
			}

		}
	}
}