当前位置: 首页>>代码示例>>C++>>正文


C++ DM::FilterNoSplit方法代码示例

本文整理汇总了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;
}
开发者ID:Amos-zq,项目名称:CurvatureFilter,代码行数:40,代码来源:main.cpp

示例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;
}
开发者ID:taopanpan,项目名称:CurvatureFilter,代码行数:62,代码来源:main.cpp


注:本文中的DM::FilterNoSplit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。