#include <rsdl_borgefors.h>
The data based on which the map is built is a vector (should be changed to any stl container type later) of any datatype with x() and y() functions defined.
The computation of the distance map is done using 3-4 chamfer distance transform.
CAVEAT: To avoid data duplication, objects are stored as pointers in the map. Classes having rsdl_borgefors as the internal data should recompute the borgefors map when define the copy constructor and operator= To enforce this, the copy constructor and the operator= of rsdl_borgefors are not implemented and are private member functions to avoid default ones being generated by the compiler.
Definition at line 35 of file rsdl_borgefors.h.
Public Member Functions | |
| rsdl_borgefors () | |
| default constructor. | |
| rsdl_borgefors (int org_x, int org_y, int size_x, int size_y, iterator_type begin, iterator_type end, bool release_dist_map=false) | |
| constructor: constructs a distance map, with dimensions set by size_x and size_y. | |
| void | set (int org_x, int org_y, int size_x, int size_y, iterator_type begin, iterator_type end, bool release_dist_map=false) |
| sets distance and index maps, with dimensions set by size_x and size_y. | |
| void | set (int org_x, int org_y, int size_x, int size_y, iterator_type begin, iterator_type end, vbl_array_2d< int > index_map, vbl_array_2d< int > *distance_map=0) |
| sets all data members from the caller. | |
| void | reset () |
| resets the data members. | |
| bool | is_valid () const |
| returns true if the map contains valid data. | |
| double | distance (int x, int y) const |
| returns approximated distance to between (x,y) and closest object in the map. | |
| bool | in_map (int x, int y) const |
| verifies if (x,y) position is valid in the map. | |
| const_iterator_type | nearest (int x, int y) const |
| returns a pointer to the closest object to (x,y) in the map. | |
| int | width () const |
| returns width of the map. | |
| int | height () const |
| returns height of the map. | |
| void | origin (int &start_x, int &start_y) const |
| returns origin of the map. | |
| const vbl_array_2d< int > & | distance_map () const |
| const vbl_array_2d< int > & | index_map () const |
| bool | operator== (const rsdl_borgefors< T > &rhs) const |
| equality (comparison) operator. | |
Private Types | |
| typedef vcl_vector< T >::iterator | iterator_type |
| typedef vcl_vector< T >::const_iterator | const_iterator_type |
Private Member Functions | |
| rsdl_borgefors (const rsdl_borgefors< T > &old) | |
| copy constructor, not implemented. | |
| rsdl_borgefors< T > & | operator= (const rsdl_borgefors< T > &rhs) |
| assignment operator, not implemented. | |
| void | initialize (iterator_type begin, iterator_type end) |
| void | chamfer34 () |
| void | forward_chamfer () |
| Performs a forward chamfer convolution on the distance_map_ and update the index_map_ accordingly. | |
| void | backward_chamfer () |
| Performs a forward chamfer convolution on the distance_map_ and update the index_map_ accordingly. | |
| int | minimum4 (int, int, int, int) const |
| Determines the minimum of four ints. | |
| int | minimum5 (int, int, int, int, int) const |
| Determines the minimum of five ints. | |
Private Attributes | |
| bool | is_valid_ |
| int | org_x_ |
| int | org_y_ |
| int | size_x_ |
| int | size_y_ |
| vbl_array_2d< int > | distance_map_ |
| vbl_array_2d< int > | index_map_ |
| vcl_vector< iterator_type > | data_ |
|
|||||
|
Definition at line 38 of file rsdl_borgefors.h. |
|
|||||
|
Definition at line 37 of file rsdl_borgefors.h. |
|
|||||||||
|
default constructor.
Definition at line 18 of file rsdl_borgefors.txx. |
|
||||||||||||||||||||||||||||||||||||
|
constructor: constructs a distance map, with dimensions set by size_x and size_y.
Definition at line 23 of file rsdl_borgefors.txx. |
|
||||||||||
|
copy constructor, not implemented.
|
|
|||||||||
|
Performs a forward chamfer convolution on the distance_map_ and update the index_map_ accordingly.
Definition at line 320 of file rsdl_borgefors.txx. |
|
|||||||||
|
Definition at line 204 of file rsdl_borgefors.txx. |
|
||||||||||||||||
|
returns approximated distance to between (x,y) and closest object in the map. If (x,y) is out of range, -1 is returned instead. Definition at line 115 of file rsdl_borgefors.txx. |
|
|||||||||
|
Definition at line 92 of file rsdl_borgefors.h. |
|
|||||||||
|
Performs a forward chamfer convolution on the distance_map_ and update the index_map_ accordingly.
Definition at line 250 of file rsdl_borgefors.txx. |
|
|||||||||
|
returns height of the map.
Definition at line 87 of file rsdl_borgefors.h. |
|
||||||||||||||||
|
verifies if (x,y) position is valid in the map.
Definition at line 97 of file rsdl_borgefors.txx. |
|
|||||||||
|
Definition at line 93 of file rsdl_borgefors.h. |
|
||||||||||||||||
|
Definition at line 155 of file rsdl_borgefors.txx. |
|
|||||||||
|
returns true if the map contains valid data.
Definition at line 74 of file rsdl_borgefors.h. |
|
||||||||||||||||||||||||
|
Determines the minimum of four ints.
Definition at line 234 of file rsdl_borgefors.txx. |
|
||||||||||||||||||||||||||||
|
Determines the minimum of five ints.
Definition at line 216 of file rsdl_borgefors.txx. |
|
||||||||||||||||
|
returns a pointer to the closest object to (x,y) in the map. It aborts if (x,y) not in map. Should always check in_map(x,y) first. Definition at line 128 of file rsdl_borgefors.txx. |
|
||||||||||
|
assignment operator, not implemented.
|
|
||||||||||
|
equality (comparison) operator.
Definition at line 146 of file rsdl_borgefors.txx. |
|
||||||||||||||||
|
returns origin of the map.
Definition at line 138 of file rsdl_borgefors.txx. |
|
|||||||||
|
resets the data members.
Definition at line 86 of file rsdl_borgefors.txx. |
|
||||||||||||||||||||||||||||||||||||||||
|
sets all data members from the caller.
Definition at line 51 of file rsdl_borgefors.txx. |
|
||||||||||||||||||||||||||||||||||||
|
sets distance and index maps, with dimensions set by size_x and size_y.
Definition at line 35 of file rsdl_borgefors.txx. |
|
|||||||||
|
returns width of the map.
Definition at line 85 of file rsdl_borgefors.h. |
|
|||||
|
Definition at line 116 of file rsdl_borgefors.h. |
|
|||||
|
Definition at line 114 of file rsdl_borgefors.h. |
|
|||||
|
Definition at line 115 of file rsdl_borgefors.h. |
|
|||||
|
Definition at line 112 of file rsdl_borgefors.h. |
|
|||||
|
Definition at line 113 of file rsdl_borgefors.h. |
|
|||||
|
Definition at line 113 of file rsdl_borgefors.h. |
|
|||||
|
Definition at line 113 of file rsdl_borgefors.h. |
|
|||||
|
Definition at line 113 of file rsdl_borgefors.h. |
1.4.4