00001 #include "vpro_fourier_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_fourier_process::execute() 00009 { 00010 if (this->get_N_input_images()!=1) 00011 { 00012 vcl_cout << "In vpro_fourier_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 vil1_memory_image_of<float> pow_two_img; 00021 brip_vil1_float_ops::resize_to_power_of_two(fimg, pow_two_img); 00022 //compute fourier transform 00023 vil1_memory_image_of<float> mag, phase; 00024 brip_vil1_float_ops::fourier_transform(pow_two_img, mag, phase); 00025 00026 //convert magnitude component to byte 00027 output_image_ = brip_vil1_float_ops::convert_to_byte(mag, -range_, range_); 00028 return true; 00029 }
1.7.5.1