#include <iostream>
#include <vector>
#include <slip/convolution.hpp>
#include <slip/Block.hpp>
#include <slip/border_treatment.hpp>
#include <slip/GrayscaleImage.hpp>
#include <slip/dynamic.hpp>
static void usage(const char * );
int main(int argc, char **argv)
{
std::vector<std::string> args;
for(int i = 0; i < argc; i++)
{
args.push_back(argv[i]);
}
if((args.size() == 1) || (args[1] == "-h") || (args[1] == "--help"))
{
usage(args[0].c_str());
exit(0);
}
if(args.size() == 5)
{
I.read(args[2]);
const std::size_t rows = I.
rows();
const std::size_t cols = I.
cols();
for(size_t i = 0; i < rows; ++i)
{
derivative_kernel.
begin(),
I2.row_begin(i),
}
for(size_t j = 0; j < cols; ++j)
{
smooth_kernel.
begin(),smooth_kernel.
end(),
Gx.col_begin(j),
}
for(size_t i = 0; i < rows; ++i)
{
smooth_kernel.
begin(),smooth_kernel.
end(),
I2.row_begin(i),
}
for(size_t j = 0; j < cols; ++j)
{
derivative_kernel.
begin(),derivative_kernel.
end(),
Gy.col_begin(j),
}
for(size_t i = 0; i < rows; ++i)
{
for(size_t j = 0; j < cols; ++j)
{
}
}
G.write(args[4]);
}
else
{
usage(args[0].c_str());
exit(1);
}
return 0;
}
static void usage(const char* cmd)
{
std::cout<<std::endl;
std::cout<<"NAME:"<<std::endl;
std::cout<<"\t"<<cmd<<" - Computes the gradient norm using the Sobel masks"<<std::endl;
std::cout<<std::endl;
std::cout<<"SYNOPSIS:"<<std::endl;
std::cout<<"\t"<<cmd<<" -i file -o file"<<std::endl;
std::cout<<std::endl;
std::cout<<"DESCRIPTION: Computes the gradient norm using the Sobel masks :\n"<<std::endl;
std::cout<<"\thx = [-1 0 1; and hy = [-1 -2 -1; "<<std::endl;
std::cout<<"\t -2 0 2; 0 0 0;"<<std::endl;
std::cout<<"\t -1 0 1] 1 2 1]"<<std::endl;
std::cout<<"\t "<<std::endl;
std::cout<<std::endl;
std::cout<<"\t -i input image"<<std::endl;
std::cout<<"\t -o output image"<<std::endl;
std::cout<<"\t -h, --help\t display this help and exit"<<std::endl;
std::cout<<std::endl;
std::cout<<"AUTHOR:"<<std::endl;
std::cout<<"\t Benoit Tremblais <tremblais@sic.univ-poitiers.fr>"<<std::endl;
std::cout<<std::endl;
std::cout<<"REPORTING BUGS:"<<std::endl;
std::cout<<"\t Report bugs to slip trac serveur"<<std::endl;
std::cout<<std::endl;
std::cout<<"COPYRIGHT:"<<std::endl;
std::cout<<"\t This is free software; see the source for copying conditions."<<std::endl;
std::cout<<std::endl;
std::cout<<"SEE ALSO:"<<std::endl;
std::cout<<std::endl;
}