contrib/brl/bseg/vpro/vpro_spatial_filter_process.cxx
Go to the documentation of this file.
00001 #include "vpro_spatial_filter_process.h"
00002 //:
00003 // \file
00004 #include <vcl_iostream.h>
00005 #include <brip/brip_vil1_float_ops.h>
00006 #include <vil1/vil1_memory_image_of.h>
00007 
00008 bool vpro_spatial_filter_process::execute()
00009 {
00010   if (this->get_N_input_images()!=1)
00011   {
00012     vcl_cout << "In vpro_spatial_filter_process::execute() -"
00013              << " not at exactly one input image\n";
00014     return false;
00015   }
00016   vil1_image img = vpro_video_process::get_input_image(0);
00017   this->clear_input();
00018 
00019   vil1_memory_image_of<float> fimg = brip_vil1_float_ops::convert_to_float(img);
00020 
00021   vil1_memory_image_of<float> out;
00022   brip_vil1_float_ops::spatial_frequency_filter(fimg, dir_fx_, dir_fy_, f0_,
00023                                            radius_, show_filtered_fft_,
00024                                            out);
00025   if (show_filtered_fft_)
00026     output_image_ = brip_vil1_float_ops::convert_to_byte(out, 0.0f, 0.05f);
00027   else
00028     output_image_ = brip_vil1_float_ops::convert_to_byte(out, 0.0f, 150.0f);
00029   return true;
00030 }