imgProcessor.render package¶
Submodules¶
imgProcessor.render.closestConnectedDistance module¶
-
imgProcessor.render.closestConnectedDistance.
closestConnectedDistance
(target, walls=None, max_len_border_line=500, max_n_path=100, concentrate_every_n_pixel=1)[source]¶ returns an array with contains the closest distance from every pixel the next position where target == 1
[walls] binary 2darray - e.g. walls in a labyrinth that have to be surrounded in order to get to the target
[target] binary 2darray - positions given by 1
- [concentrate_every_n_pixel] often the distance of neighbour pixels is similar
- to speed up calculation set this value to e.g. 3 to calculate only the distance for every 3. pixel and interpolate in between
recommended are values up to 3-5
[max_len_border_line] this function calculates distances travelled using region growth e.g.
0123 1123 2223 3333
the last steps (e.g. for all steps 3 border_line=7) are stored in an array of limited length defined in ‘max_len_border_line’
[max_n_path] how many paths are possible between every pixel and the target only needed if fast==False