contrib/brl/bseg/vpro/vpro_edge_line_process.cxx
Go to the documentation of this file.
00001 // This is brl/bseg/vpro/vpro_edge_line_process.cxx
00002 #include "vpro_edge_line_process.h"
00003 //:
00004 // \file
00005 #include <vcl_iostream.h>
00006 #include <sdet/sdet_fit_lines.h>
00007 #include "vpro_edge_process.h"
00008 #include "vpro_line_fit_process.h"
00009 
00010 vpro_edge_line_process::vpro_edge_line_process(sdet_detector_params& dp,
00011                                                sdet_fit_lines_params& flp)
00012   : sdet_detector_params(dp), sdet_fit_lines_params(flp)
00013 {
00014 }
00015 
00016 vpro_edge_line_process::~vpro_edge_line_process()
00017 {
00018 }
00019 //------------------------------------------------------------------
00020 //: setup a pipeline for edges and line segments
00021 //
00022 bool vpro_edge_line_process::execute()
00023 {
00024   this->clear_output();
00025   //my_spat_objs_.clear();
00026   if (this->get_N_input_images()!=1)
00027   {
00028     vcl_cout << "In vpro_edge_line_process::execute() - not exactly one input image\n";
00029     return false;
00030   }
00031   vpro_edge_process ep(*((sdet_detector_params*)this));
00032   ep.add_input_image(this->get_input_image(0));
00033   if (!ep.execute())
00034   {
00035     this->clear_input();
00036     return false;
00037   }
00038   vpro_line_fit_process lfp(*((sdet_fit_lines_params*)this));
00039   lfp.add_input_topology(ep.get_output_topology());
00040   if (!lfp.execute())
00041   {
00042     this->clear_input();
00043     return false;
00044   }
00045   output_spat_objs_ = lfp.get_output_spatial_objects();
00046   this->clear_input();
00047   return true;
00048 }