#include <flat-zone.hh>
Collaboration diagram for oln::topo::tarjan::obsolete::flat_zone< I >:

Public Types | |
| typedef mlc::exact< I >::ret::point_type | point_type |
| typedef mlc::exact< I >::ret::value_type | data_type |
| typedef oln::mute< I >::ret | image_type |
|
typedef tarjan::tarjan_set< image_type, tarjan::empty_class > | tarjan_cc |
Public Member Functions | |
| flat_zone (const image_type &input_) | |
| void | doit () |
| Compute the image of label. | |
| const unsigned | get_label (const point_type &p) const |
| Get the label of a point p. | |
| const point_type & | get_root (unsigned l) const |
| Get the root point of a label l. | |
| const unsigned | nlabels () const |
| Number of label. | |
| void | merge (const int l1, const int l2) |
Public Attributes | |
| const image_type & | input |
| tarjan_cc | cc |
| image2d< unsigned > | label |
| output image. | |
| std::vector< point_type > | look_up_table |
| image2d< std::vector< oln::point2d > > | ima_region |
| unsigned | nlabels_ |
#include <oln/basics2d.hh> #include <oln/topo/tarjan/flat-zone.hh> #include <oln/convert/stretch.hh> int main() { typedef oln::image2d<ntg::int_u8> img_type; img_type in = oln::load(IMG_IN "test-cmap.pgm"); oln::topo::tarjan::obsolete::flat_zone<img_type> z(in); save(oln::convert::stretch_balance<ntg::int_u8>(z.label, 0, 255), IMG_OUT "oln_topo_flat_zone.pgm"); }
input image
output image
Definition at line 219 of file flat-zone.hh.
|
||||||||||
|
Initialize the flat-zone with an image. doit is called. Definition at line 241 of file flat-zone.hh. References oln::topo::tarjan::obsolete::flat_zone< I >::doit(), and oln::topo::tarjan::obsolete::flat_zone< I >::label.
|
|
||||||||||||||||
|
Merge two flat zone.
Definition at line 361 of file flat-zone.hh. References oln::topo::tarjan::tarjan_set< I, aux_data_type >::is_root(), oln::topo::tarjan::obsolete::flat_zone< I >::label, and oln::topo::tarjan::tarjan_set< I, aux_data_type >::uni().
00362 {
00363 point_type root_l1 = look_up_table[l1];
00364 point_type root_l2 = look_up_table[l2];
00365 assertion(cc.is_root(root_l1));
00366 assertion(cc.is_root(root_l2));
00367 // merge
00368 cc.uni(root_l2, root_l1);
00369 // update our tables
00370 look_up_table[l2] = root_l1;
00371 for (typename std::vector<point_type>::iterator
00372 i = ima_region[root_l2].begin();
00373 i != ima_region[root_l2].end(); ++i)
00374 label[*i] = l1;
00375 ima_region[root_l1].insert(ima_region[root_l1].end(),
00376 ima_region[root_l1].begin(),
00377 ima_region[root_l1].end());
00378 ima_region[root_l2].clear();
00379
00380 --nlabels_;
00381 }
|
1.3.6-20040222