本文整理汇总了C++中DM::FilterNoSplit方法的典型用法代码示例。如果您正苦于以下问题:C++ DM::FilterNoSplit方法的具体用法?C++ DM::FilterNoSplit怎么用?C++ DM::FilterNoSplit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DM
的用法示例。
在下文中一共展示了DM::FilterNoSplit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char** argv)
{
DM DualMesh;
if (argc!=4)
{
cout<<"usage: main filename filterType Iterations.\n For example: ./cf lena.bmp m 30\n";
cout<<"************************************************\n";
cout<<"Possible Filters: t (Total Variation) \n";
cout<<" m (Mean Curvature) \n";
cout<<" g (Gaussian Curvature) \n";
cout<<" d (Difference Curvature, not ready) \n";
cout<<" b (Bernstein Filter) \n";
return -1;
}
DualMesh.read(argv[1]);
ItNum = atoi(argv[3]);
char * filterType = argv[2];
if (*filterType == 't') Type = 0;
if (*filterType == 'm') Type = 1;
if (*filterType == 'd') Type = 3;
if (*filterType == 'b') Type = 4;
DualMesh.split();
double mytime;
DualMesh.Filter(Type, mytime, ItNum);
cout<<"runtime is "<<mytime<<" milliseconds."<<endl;
DualMesh.merge();
DualMesh.write();
DualMesh.read(argv[1]);
DualMesh.FilterNoSplit(Type, mytime, ItNum);
cout<<"runtime (noSplit) is "<<mytime<<" milliseconds."<<endl;
DualMesh.write("CF_NoSplit_result.png");
return 0;
}
示例2: main
int main(int argc, char** argv)
{
DM DualMesh;
if ((argc!=4) && (argc!=6))
{
cout<<endl;
cout<<" -------------------- Curvature Filter ------------------------- "<<endl;
cout<<" Please cite Yuanhao's PhD thesis and related papers. Thank you! "<<endl;
cout<<" --------------------------------------------------------------- \n\n";
cout<<"usage: main imageName filterType Iterations.\n For example: ./cf lena.bmp m 30\n";
cout<<" or "<<endl;
cout<<"usage: main imageName filterType MaxItNum lambda DataFitOrder.\n For example: ./cf lena.bmp m 30 1.2 1.5\n";
cout<<"************************************************\n";
cout<<"Possible Filter Type: t (Total Variation) \n";
cout<<" m (Mean Curvature) \n";
cout<<" g (Gaussian Curvature) \n";
cout<<" d (Difference Curvature) \n";
cout<<" b (Bernstein Filter) \n";
return -1;
}
DualMesh.read(argv[1]);
char * filterType = argv[2];
if (*filterType == 't') Type = 0;
if (*filterType == 'm') Type = 1;
if (*filterType == 'd') Type = 3;
if (*filterType == 'b') Type = 4;
ItNum = atoi(argv[3]);
if (argc==6)
{
lambda = (float)atof(argv[4]);
DataFitOrder = (float)atof(argv[5]);
}
DualMesh.split();
double mytime;
DualMesh.Filter(Type, mytime, ItNum);
cout<<"runtime is "<<mytime<<" milliseconds."<<endl;
DualMesh.merge();
DualMesh.write();
DualMesh.read(argv[1]);
DualMesh.FilterNoSplit(Type, mytime, ItNum);
cout<<"runtime (noSplit) is "<<mytime<<" milliseconds."<<endl;
DualMesh.write("CF_NoSplit_result.png");
if (argc==6)
{
//filter solver for the variational models
DualMesh.read(argv[1]);
DualMesh.Solver(Type, mytime, ItNum, lambda, DataFitOrder);
cout<<"runtime is "<<mytime<<" milliseconds."<<endl;
DualMesh.write("CF_Solver.png");
}
return 0;
}