Go to the documentation of this file.00001 #ifndef brip_quadtree_utils_h
00002 #define brip_quadtree_utils_h
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include <vcl_vector.h>
00015 #include <vcl_iostream.h>
00016 #include <vil/vil_image_view.h>
00017 #include <brip/brip_quadtree_node.h>
00018 #include <vbl/vbl_array_2d.h>
00019
00020 template <class T>
00021 class brip_quadtree_utils
00022 {
00023 public:
00024
00025 static void fill_image_region(brip_quadtree_node_base_sptr node,
00026 vil_image_view<T>& img);
00027
00028
00029 static void fill_image_from_node(brip_quadtree_node_base_sptr node,
00030 vil_image_view<T>& img);
00031
00032
00033
00034
00035
00036
00037 static void
00038 extract_nodes_from_image(vil_image_view<T> const & img,
00039 vil_image_view<bool> const & mask,
00040 vil_image_view<T> const& parent_img,
00041 vil_image_view<bool> const& parent_mask,
00042 unsigned scale,
00043 vbl_array_2d<brip_quadtree_node_base_sptr>& nodes);
00044
00045
00046 static void connect_children(vbl_array_2d<brip_quadtree_node_base_sptr>& nodes,
00047 unsigned scale,
00048 vbl_array_2d<brip_quadtree_node_base_sptr> const& prev);
00049
00050
00051 static
00052 void quadtrees_from_pyramid(vcl_vector<vil_image_view<T> > levels,
00053 vcl_vector<vil_image_view<bool> > masks,
00054 vbl_array_2d<brip_quadtree_node_base_sptr>& roots);
00055
00056
00057 static void print_node( brip_quadtree_node_base_sptr const& node,
00058 vcl_ostream& os = vcl_cout,
00059 vcl_string indent = "");
00060 };
00061
00062
00063 #define BRIP_QUADTREE_UTILS_INSTANTIATE(T) extern "please include brip_quadtree_utils.txx first"
00064
00065
00066 #endif