void MPIErrorValueCalculator::calculateErrorValue(ModelTuningParameters & params) {

	vector< ModelTuningParameters > paramList(1);
	paramList[0] = params;
	
	calculateParallelErrorValue(paramList);

	/// This is necessary because otherwise the error value is not transferred
	/// since no reference is passed to calculateParallelErrorValue
	params.setErrorValue(paramList[0].getErrorValue());
}
示例#2
0
void
clientSimple::call(string  const serverUrl,
                   string  const methodName,
                   value * const resultP) {

    carriageParm_http0 carriageParm(serverUrl);

    rpcPtr rpcPtr(methodName, paramList());

    rpcPtr->call(this->clientP.get(), &carriageParm);
    
    *resultP = rpcPtr->getResult();
}
示例#3
0
	void invokeHelper(Param0 p0, Param1 p1) const
	{
		ArgList2<Param0, Param1> paramList(p0, p1);
		return invokeDelegate(deleg_, stored_, paramList);
	}
示例#4
0
	void invokeHelper(Param0 p0) const
	{
		ArgList1<Param0> paramList(p0);
		return invokeDelegate(deleg_, stored_, paramList);
	}
示例#5
0
	void invokeHelper(Param0 p0, Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) const
	{
		ArgList8<Param0, Param1, Param2, Param3, Param4, Param5, Param6, Param7> paramList(p0, p1, p2, p3, p4, p5, p6, p7);
		return invokeDelegate(deleg_, stored_, paramList);
	}
示例#6
0
	void invokeHelper(Param0 p0, Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) const
	{
		ArgList6<Param0, Param1, Param2, Param3, Param4, Param5> paramList(p0, p1, p2, p3, p4, p5);
		return invokeDelegate(deleg_, stored_, paramList);
	}
示例#7
0
	void invokeHelper(Param0 p0, Param1 p1, Param2 p2, Param3 p3) const
	{
		ArgList4<Param0, Param1, Param2, Param3> paramList(p0, p1, p2, p3);
		return invokeDelegate(deleg_, stored_, paramList);
	}
示例#8
0
	void invokeHelper(Param0 p0, Param1 p1, Param2 p2) const
	{
		ArgList3<Param0, Param1, Param2> paramList(p0, p1, p2);
		return invokeDelegate(deleg_, stored_, paramList);
	}
/************* Main *****************/
int main(int argc, char *argv[]){
	try{
		if(argc<3){
			std::cout << "Wrong number of parameter";
			paramList();
			return 1;
		}
		int medianBlurKernelRadius	= 1; 
		int bilateralRadius			= 3; 
		float bilateralDistSigma	= 1.5;
		float bilateralWeightSigma	= 0.03;
		float saturationFactor		= 1.5f;
		float saturationOffset		= 0.05f;

		for(int p = 3; p < argc; ++p){
			std::string param(argv[p]);
			if(param.compare("-mr") == 0 && p < argc-1){
				++p;
				medianBlurKernelRadius = atoi(argv[p]);
			}else if(param.compare("-br") == 0 && p < argc-1){
				++p;
				bilateralRadius = atoi(argv[p]);
			}else if(param.compare("-bds") == 0 && p < argc-1){
				++p;
				bilateralDistSigma = atof(argv[p]);
			}else if(param.compare("-bws") == 0 && p < argc-1){
				++p;
				bilateralWeightSigma = atof(argv[p]);
			}else if(param.compare("-sf") == 0 && p < argc-1){
				++p;
				saturationFactor = atof(argv[p]);
			}else if(param.compare("-so") == 0 && p < argc-1){
				++p;
				saturationOffset = atof(argv[p]);
			}else{
				std::cout << "Wrong parameter" << std::endl;
				paramList();
				return 3;
			}
		}

		cv::Mat_<unsigned char> src = cv::imread(argv[1],CV_LOAD_IMAGE_GRAYSCALE);
		cv::Mat_<unsigned char> elabImage = src.clone();

		if(medianBlurKernelRadius>0){
			medianBlurElab(elabImage,medianBlurKernelRadius);
			cv::imwrite("medianBlur.png", elabImage);
		}

		std::vector<float> squaredColorWeight;
		computeSquaredColorWeight(elabImage,squaredColorWeight);
		logColumnMap(squaredColorWeight,elabImage.rows,"squaredColorWeights.png");

		if(bilateralRadius > 0 && bilateralDistSigma > 0 && bilateralWeightSigma > 0){
			bilateralFilterOnMap(squaredColorWeight,bilateralRadius,bilateralDistSigma,bilateralWeightSigma);
			logColumnMap(squaredColorWeight,elabImage.rows,"bilateralWeights.png");
		}

		applyColumnMap(elabImage,squaredColorWeight,saturationOffset,saturationFactor);

		cv::imwrite(argv[2], elabImage);
	}catch(...){
		return 2;
	}
	return 0;
}