#include <inter-pixel.hh>
Collaboration diagram for oln::topo::inter_pixel::interpixel< I >:
Public Types | |
typedef mlc::exact< I >::ret::dpoint_type | dpoint_type |
typedef mlc::exact< I >::ret::point_type | point_type |
typedef oln::topo::inter_pixel::node< I > | node_type |
typedef oln::topo::inter_pixel::fwd_dir_iter< I::dim > | fwd_dir_iter_type |
typedef oln::topo::inter_pixel::bkd_dir_iter< I::dim > | bkd_dir_iter_type |
typedef oln::topo::inter_pixel::internal::dir_traits< I::dim >::ret | dir_type |
typedef oln::topo::inter_pixel::internal::dir_traits< I::dim > | dir_traits_type |
typedef std::pair< typename mlc::exact< I >::ret::point_type, typename oln::topo::inter_pixel::internal::dir_traits< I::dim >::ret > | head_type |
typedef oln::mute< I, oln::topo::inter_pixel::node< I > >::ret | inter_pixel_type |
Public Member Functions | |
interpixel (const I &img) | |
Construct an inter pixel map of the image img. | |
const node_type | operator[] (const point_type &p) const |
head_type | folw (const head_type &in) const |
std::ostream & | print (std::ostream &ostr) const |
Print the inter pixel map. | |
Static Public Attributes | |
const dpoint_type | neighb_ [4] |
const dpoint_type | inter_neighb_ [4] |
This example give the node of the black connected component (bottom left).
#include <ntg/int.hh> #include <oln/basics2d.hh> #include <oln/topo/inter-pixel/inter-pixel.hh> #include <iostream> using namespace oln::topo::inter_pixel; int main() { typedef oln::image2d<ntg::int_u8> img_type; img_type in = oln::load(IMG_IN "test-cmap.pgm"); interpixel<oln::image2d<ntg::int_u8> > ip(in); std::cout << ip << std::endl; // Print: // (5,0): east north south // (5,5): north west south // (7,5): east north west // (10,9): east north west // (10,11): north west south // (11,14): north west south }
Definition at line 75 of file inter-pixel.hh.
|
Definition at line 120 of file inter-pixel.hh.
00121 { 00122 precondition(data_[in.first].get(in.second) == true); 00123 00124 head_type out = in; 00125 00126 do 00127 { 00128 out.first += inter_neighb_[out.second]; 00129 00130 if (out.first == in.first || data_[out.first].rank() > 2) 00131 { 00132 out.second = dir_traits_type::opposite(out.second); 00133 break; 00134 } 00135 00136 dir_type next = dir_traits_type::next(out.second); 00137 dir_type prev = dir_traits_type::prev(out.second); 00138 00139 out.second = data_[out.first].get(next) ? next : 00140 data_[out.first].get(prev) ? prev : out.second; 00141 } 00142 while (out.first != in.first); 00143 00144 return out; 00145 } |
|
Definition at line 110 of file inter-pixel.hh.
00111 {
00112 return data_[p];
00113 }
|
|
Initial value: {typename mlc::exact< I >::ret::dpoint_type(0,1), typename mlc::exact< I >::ret::dpoint_type(-1,0), typename mlc::exact< I >::ret::dpoint_type(0,-1), typename mlc::exact< I >::ret::dpoint_type(1,0)} Definition at line 198 of file inter-pixel.hh. |
|
Initial value: {typename mlc::exact< I >::ret::dpoint_type(0,0), typename mlc::exact< I >::ret::dpoint_type(-1,0), typename mlc::exact< I >::ret::dpoint_type(-1,-1), typename mlc::exact< I >::ret::dpoint_type(0,-1)} Definition at line 192 of file inter-pixel.hh. |