59 if(
argv[a][0] ==
'-'){
67 cerr <<
"Ignoring mask. Image is a positive example." << endl;
72 cerr <<
"Ignoring mask. Image is a negative example." << endl;
96 cerr <<
"Opening image file: " <<
image_file << endl;
100 vigra::ImageImportInfo info(
image_file.c_str());
103 vigra::FRGBImage in(info.width(), info.height());
109 if (
pos == 0 &&
neg == 0){
111 cerr <<
"Opening mask file: " <<
mask_file << endl;
119 cerr <<
"Error - image and mask files are different dimension:" << endl;
120 cerr <<
"Image:\t" << info.width() <<
" x " << info.height() << endl;
121 cerr <<
"Mask:\t" <<
mask_info.width() <<
" x " <<
mask_info.height() << endl << endl;
127 vigra::FRGBImage
tmp_mask_in(info.width(), info.height());
146 if (info.width() >= info.height()){
156 cerr <<
"Image dimensions:\t" << info.width() <<
" x " << info.height() << endl;
157 cerr <<
"Scaling by:\t\t" <<
sizefactor << endl;
158 cerr <<
"New dimensions:\t\t" <<
nw <<
" x " <<
nh << endl;
183 if (
pos == 0 &&
neg == 0){
209 cerr <<
"Image dimensions:\t" << info.width() <<
" x " << info.height() << endl;
212 cerr <<
"Total pixels:\t\t" << in.width()*in.height() << endl;
215 cerr <<
"Converting to LUV colourspace..." << endl;
221 cerr <<
"Generating fiducial points..." << endl;
243 cerr <<
"Total fiducial points: " <<
gNumLocs << endl;
246 float *
frameBuf =
new float[in.width()*in.height()];
247 float *
u_values =
new float[in.width()*in.height()];
248 float *
v_values =
new float[in.width()*in.height()];
251 float** pixels = CreateMatrix( (
float)0, in.height(), in.width() );
273 for (
int i = 0;
i < in.height();
i++ ){
274 for (
int j = 0;
j < in.width();
j++ ){
281 char basename[] =
"gabor_filters/celeste";
286 response = ProcessChannel( pixels, in.height(), in.width(),
response, &len, basename );
289 if (
pos == 0 &&
neg == 0){
297 cerr <<
"Generating feature vector by Gabor filtering..." << endl;
428 }
catch (vigra::StdException & e){
431 std::cout << e.what() << std::endl;
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.