contrib/brl/bseg/vpro/vpro_ihs_process.cxx
Go to the documentation of this file.
00001 // This is brl/bseg/vpro/vpro_ihs_process.cxx
00002 #include "vpro_ihs_process.h"
00003 #include <vcl_iostream.h>
00004 #include <vil1/vil1_memory_image_of.h>
00005 #include <vil1/vil1_rgb.h>
00006 #include <brip/brip_vil1_float_ops.h>
00007 
00008 vpro_ihs_process::vpro_ihs_process()
00009 {
00010   failure_ = false;
00011 }
00012 
00013 vpro_ihs_process::~vpro_ihs_process()
00014 {
00015 }
00016 
00017 
00018 bool vpro_ihs_process::execute()
00019 {
00020   if (failure_)
00021     return false;
00022   if (this->get_N_input_images()!=1)
00023   {
00024     vcl_cout << "In vpro_ihs_process::execute() -"
00025              << " not exactly one input image\n";
00026     failure_ = true;
00027     return false;
00028   }
00029   vil1_memory_image_of<vil1_rgb<unsigned char> > in_image(this->get_input_image(0));
00030   vil1_memory_image_of<float> I,H,S;
00031   vil1_memory_image_of<vil1_rgb<unsigned char> > image;
00032   brip_vil1_float_ops::convert_to_IHS(in_image, I, H, S);
00033   brip_vil1_float_ops::display_IHS_as_RGB(I, H, S, image);
00034   output_image_=image;
00035   input_images_.clear();
00036   return true;
00037 }
00038