[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Chapter summary:
C++ implementation of the library.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The algorithms such as rendering, updating the volume or change detection in c++ are developed and the API to such algorithms are subclasses of boxm2_cpp_process_base
. For example, class boxm2_render_process: public boxm2_cpp_process_base
. Such process has three virtual functions
init()
: to initialize data members or parameters.
run(vcl_vector<brdb_value_sptr> & input, vcl_vector<brdb_value_sptr> & output)
: runs the algorithm. The input and output vectors are used for interfacing with the process.
finish()
: to destroy any intermediate data created.
Few processes are discussed below:
boxm2_cpp_render_process
: This process renders an expected image of the provided model from a given viewpoint. The inputs to such process include scene, camera, and dimensions of output image and the output of such a process include expected image. This process uses a single pass of ray-tracing to update the volume.
boxm2_cpp_update_process
:This process updates the model using an EO image and the given sensor model. The inputs to such process include scene, camera, image and the output of such a process is updated scene. This process uses multiple passes of ray-tracing to update the volume.
boxm2_cpp_refine_process
:This process refines/merge the scene. This refining/merging results in the scene getting finer or coarser at places where the evidence of surface increases or decreases respectively. The inputs to such process include scene and threshold and the output of such a process is updated scene. This process requires serial iterating over blocks.
Each process uses inputs as processing inputs and return output if any through output vector. The process is light-weight as it only process the data provided to it. Multiple processes might be called in a given system which leads to discussion of boxm2_cpp_processor
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A processor boxm2_cpp_processor
is subclass from boxm2_processor
. The cpp processor is responsible for calling cpp processes and passing them inputs. The processor is a high level manager which interacts with the user and translates the user actions into different process calls. Example of usage of such a processor is shown below:
An example of C++ rendering algorithm is shown below.
//: load the scene boxm2_scene_sptr scene = new boxm2_scene(scene_file()); // initialize the cache boxm2_nn_cache cache( scene.ptr() ); //: initialize the cpp processor boxm2_cpp_processor cpp_pro; cpp_pro.init(); cpp_pro.set_scene(scene.ptr()); //: initialize process boxm2_cpp_render_process cpp_render; cpp_render.init(); cpp_render.set_cache(&cache); //: inputs for the process. brdb_value_sptr brdb_scene_sptr = new brdb_value_t<boxm2_scene_sptr>(scene); brdb_value_sptr brdb_cam = new brdb_value_t<vpgl_camera_double_sptr>(cam); brdb_value_sptr brdb_inimg = new brdb_value_t<vil_image_view_base_sptr>(floatimg); vcl_vector<brdb_value_sptr> input; input.push_back(brdb_scene_sptr); input.push_back(brdb_cam); input.push_back(brdb_inimg); //init output vector vcl_vector<brdb_value_sptr> output; //: run the process cpp_pro.run(&cpp_render, input, output); vcl_cout<<"Time taken is :" <<t.all()<<vcl_endl; cpp_pro.finish(); |
In this example, processor is initialized and then it is used to call rendering process. Similarly multiple processes can be called using this processor.
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on May, 1 2013 using texi2html 1.76.