<commit_before>/*

PICCANTE Examples
The hottest examples of Piccante:
http://vcg.isti.cnr.it/piccante

Copyright (C) 2014
Visual Computing Laboratory - ISTI CNR
http://vcg.isti.cnr.it
First author: <NAME>

This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3.0 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    See the GNU Lesser General Public License
    ( http://www.gnu.org/licenses/lgpl-3.0.html ) for more details.
*/

//This means that OpenGL acceleration layer is disabled
#define PIC_DISABLE_OPENGL

#include "piccante.hpp"

int main(int argc, char *argv[])
{
    std::string img_str;

    if(argc == 2) {
        img_str = argv[1];
    } else {
        img_str = "../data/input/tommaseo_statue.png";
    }

    printf("Reading an image...");
    pic::Image img;
    img.Read(img_str, pic::LT_NOR_GAMMA);
    printf("Ok\n");

    printf("Is it valid? ");
    if(img.isValid()) {
        printf("Ok\n");

        printf("Estimated noise:\n");
        float *noise =pic::estimateNoise(&img, NULL);
        for(int i = 0; i < img.channels; i++) {
            printf("Channel i-th: %f\n", noise[i]);
        }

        pic::ImageVec input = pic::Single(&img);
        pic::Image *output = NULL;

        bool bWritten;

        std::string name = pic::removeExtension(img_str);
        name = pic::removeLocalPath(name);

        //the median filter
        printf("Filtering the image with the Median filter (radius of 3);\n");

        pic::FilterMed fltM(7);
        output = fltM.Process(input, output);

        printf("Ok!\n");
<commit_msg>Update main.cpp<commit_after>/*

PICCANTE Examples
The hottest examples of Piccante:
http://vcg.isti.cnr.it/piccante

Copyright (C) 2014
Visual Computing Laboratory - ISTI CNR
http://vcg.isti.cnr.it
First author: <NAME>

This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3.0 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    See the GNU Lesser General Public License
    ( http://www.gnu.org/licenses/lgpl-3.0.html ) for more details.
*/

//This means that OpenGL acceleration layer is disabled
#define PIC_DISABLE_OPENGL

#include "piccante.hpp"

int main(int argc, char *argv[])
{
    std::string img_str;

    if(argc == 2) {
        img_str = argv[1];
    } else {
        img_str = "../data/input/tommaseo_statue.png";
    }

    printf("Reading an image...");
    pic::Image img;
    img.Read(img_str, pic::LT_NOR_GAMMA);
    printf("Ok\n");

    printf("Is it valid? ");
    if(img.isValid()) {
        printf("Ok\n");

        printf("Estimated noise:\n");
        float *noise = pic::estimateNoise(&img, NULL);
        for(int i = 0; i < img.channels; i++) {
            printf("Channel i-th: %f\n", noise[i]);
        }

        pic::ImageVec input = pic::Single(&img);
        pic::Image *output = NULL;

        bool bWritten;

        std::string name = pic::removeExtension(img_str);
        name = pic::removeLocalPath(name);

        //the median filter
        printf("Filtering the image with the Median filter (radius of 3);\n");

        pic::FilterMed fltM(7);
        output = fltM.Process(input, output);

        printf("Ok!\n");

{'fraction_non_alphanumeric': 0.11769211130967577, 'fraction_numerical': 0.006637732958897115, 'mean_word_length': 2.7673076923076922, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7542794', 'n_tokens_mistral': 1230, 'n_tokens_neox': 1175, 'n_words': 397}