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


C++ BitmapImage::Erode方法代码示例

本文整理汇总了C++中BitmapImage::Erode方法的典型用法代码示例。如果您正苦于以下问题:C++ BitmapImage::Erode方法的具体用法?C++ BitmapImage::Erode怎么用?C++ BitmapImage::Erode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BitmapImage的用法示例。


在下文中一共展示了BitmapImage::Erode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: gradeResponseCards

void gradeResponseCards(){
    string gabarito;
    string path;


    DIR* directory;
    struct dirent *ep;

    list<string> gabaritos;

    cout << "Entre com o gabarito oficial: ";
    getline(cin, gabarito);
    cout << "Entre com o caminho com os gabaritos à serem corrigidos: ";
    getline(cin, path);


    directory = opendir(path.c_str());

    if(directory == NULL){
        cerr << "Error(" << errno << ") opening " << directory << endl;
        return;
    }
    while((ep = readdir(directory))){

        auto filePath = path + "/" + ep->d_name;
        if(has_suffix(filePath, ".bmp")){
            cout << filePath << endl;
            gabaritos.push_back(filePath);
        }

    }
    cout << "-------------------------------------------------" << endl;
    cout << "        Gabarito: " << gabarito << endl;
    cout << "-------------------------------------------------" << endl;
    cout << "        Diretorio: " << directory << endl;
    for(auto it = gabaritos.begin(); it != gabaritos.end(); it++){
        cout << "-------------------------------------------------" << endl;
        string aux="";
        aux+= *it;
        string aux2="";
        BitmapImage teste = BitmapImage(aux, find_file_name((*it)));
        cout << teste.fileName << endl;
        teste.toBlackAndWhite();
        teste.Erode(5);
        teste.Dilate(8);
        teste.findTopLeftRectangle();
        teste.findBotLeftRectangle();
        teste.findTopRightRectangle();
        teste.findAnswers(teste.topLeft);
        cout << "    Respostas: ";
        int sum = 0;
        int blank = 0;
        int multipleAnswers = 0;
        for (int i = 0; i < teste.answers.size(); i++) {
            if(gabarito[i] == teste.answers[i]) sum++;
            if(teste.answers[i] == 'O') blank++;
            if(teste.answers[i] == 'X') multipleAnswers ++;
            cout << teste.answers[i];
        }
        cout << endl;
        cout << "    Acertos: " << sum << endl;
        cout << "    Brancos: " << blank << endl;
        cout << "    Multiplas Respostas: " << multipleAnswers << endl;

    }
    cout << "-------------------------------------------------" << endl;
    return;
}
开发者ID:franktominc,项目名称:PIDBmp,代码行数:68,代码来源:main.cpp


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