本文整理汇总了C++中ParameterSet::GetParamNum方法的典型用法代码示例。如果您正苦于以下问题:C++ ParameterSet::GetParamNum方法的具体用法?C++ ParameterSet::GetParamNum怎么用?C++ ParameterSet::GetParamNum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParameterSet
的用法示例。
在下文中一共展示了ParameterSet::GetParamNum方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Init
HRESULT NextParametersGenerator::Init(const ParameterSet& paramSet, const ParameterSetRange& paramSetRange)
{
if(paramSet.GetParamNum() != paramSetRange.GetParamNum())
return E_FAIL;
int nParamNum = paramSet.GetParamNum();
m_currParamSet = paramSet;
m_paramSetRange = paramSetRange;
for(int x=0; x<nParamNum; x++)
{
m_currParamSet.SetParameterByIndex(x,m_paramSetRange.GetParameterLow(x));
}
m_nextParamSet = m_currParamSet;
//--- calculate total iteration ---
double low,high,step;
int times = 1;
int currTimes = 1;
for(int x=0; x<m_paramSetRange.GetParamNum(); x++)
{
m_paramSetRange.GetParameterRange(x,&low,&high,&step);
currTimes = (int)((high-low)/step) +1;
times *= currTimes;
}
m_nTotalIteration = times;
m_nCurrIteration = 0;
return S_OK;
}
示例2: TestDetection
void TestDetection()
{
DetectionModule *pDM = new DetectionModule();
pDM->Init("E:\\ImDetection\\ImDetectionApp\\Test\\Rscreen_shortFinger.avi");
pDM->DoDetection();
SimpleFingerDetectionResultSet resultSet;
pDM->GetDetectionResult(resultSet);
for(int x=0; x<resultSet.m_nFrameNum; x++)
{
SimpleDetectionResult* &currDR = resultSet.m_arrSimpleDR[x];
WCHAR str[MAX_PATH];
swprintf(str, L"[shooting] %d , fingerNum = %d \n",x,currDR->GetFingerNum());
//cout << str <<endl;
OutputDebugStringW(str);
//_DPRINTF((L"%d , fingerNum = %d \n",x,m_pDetectionModule->m_arrDetectionResults[x]->m_nFingerNum));
}
ParameterSet paramSet;
pDM->GetParameters(paramSet);
for(int x=0; x<paramSet.GetParamNum(); x++)
{
cout << "x = " <<x <<"name = " << paramSet.GetParameterName(x) << "value = " << paramSet.GetParameterByIndex(x) <<endl;
//printf("%d, %s %d \n",x,paramSet.GetParameterName(x),paramSet.GetParameter(x));
}
paramSet.SetParameterByIndex(4,60/255.0);
pDM->DoDetection();
delete pDM;
}
示例3: TestClasses
void TestClasses()
{
ParamSetAndMeasurement pam;
pam = LoaderAndWriter::LoadParameterSetAndMeasurementFromFile("E:\\ImDetection\\ImDetectionApp\\OptimalParameterEstimation\\Result5\\TotalResult.txt");
for(int x=36; x >=30; x--)
{
vector<int> vecIndex = pam.GetParamSetAndMeasurementSetPairIndexArrByScore(x);
char filaname[MAX_PATH];
sprintf(filaname,"E:\\ImDetection\\ImDetectionApp\\OptimalParameterEstimation\\Result5\\%d.txt",x);
LoaderAndWriter::WriteSpecificParameterSetAndMeasurementToFile(pam,vecIndex,filaname);
}
CalculateScore cal;
LoaderAndWriter myLoaderAndWriter;
{
SimpleFingerDetectionResultSet fileResultSet = myLoaderAndWriter.LoadDetectionResultSetFromFile("GT.txt");
SimpleFingerDetectionResultSet resultSetDR = myLoaderAndWriter.LoadDetectionResultSetFromFile("DR.txt");
cal.SetGroundTruth(fileResultSet);
cal.SetDetectionResult(resultSetDR);
}
MeasurementSet ms;
cal.DoCalculateScore(&ms);
SimpleFingerDetectionResultSet resultSetDR;
cal.GetDetectionResult(&resultSetDR);
myLoaderAndWriter.WriteDetectionResultSetToFile(resultSetDR,"test_write.txt");
ParamSetAndMeasurementSet pair;
{
ParameterSet paramSet;
paramSet.AddParameter("ABC",10);
paramSet.AddParameter("DEf",10);
pair.AddParamSetAndMeasurementSetPair(paramSet,ms);
}
LoaderAndWriter::WriteParameterSetAndMeasurementSetToFile(pair,"paraAndmeasure.txt");
ParameterSet paramSet2;
//pair.GetParamSetAndScorePair(0,¶mSet2,&score2);
paramSet2;
NextParametersGenerator myGenerator;
ParameterSet paramSet3;
paramSet3.AddParameter("A",0.2);
paramSet3.AddParameter("B",10);
paramSet3.AddParameter("C",1);
ParameterSetRange paramSetRange;
paramSetRange.AddParameterRange(0,1,0.2);
paramSetRange.AddParameterRange(5,15,5);
paramSetRange.AddParameterRange(1,7,2);
double low,high,step;
paramSetRange.GetParameterRange(0,&low,&high,&step);
ParameterSet iteParamSet;
bool flagFinish = false;
myGenerator.Init(paramSet3,paramSetRange);
int counter = 0;
while(!flagFinish)
{
myGenerator.GetNextParamSet(&iteParamSet);
for(int x=0; x<iteParamSet.GetParamNum(); x++)
{
cout << iteParamSet.GetParameterName(x) << "," << iteParamSet.GetParameterByIndex(x) <<endl;
}
cout << "=================== "<< counter <<endl;
myGenerator.GenerateNextParamSet(&flagFinish);
counter++;
}
system("pause");
}