A Wavefront algorithm in Matlab that is more complex than Flood Fill.
00:00 Introduction
00:28 Map
00:54 Setting Wavefront
04:31 Wavefront cycle
16:39 Map 1 Test
17:08 Map 2 Test
17:48 Conclusion
INITIALIZATION:
map selection
neighborhood definition
maximum amount of steps
initial filling number
coordinates and buffer arrays
initial position
WAVEFRONT:
until maximum amount of steps:
-numeric filling value increases and array positions reset
-while arrays containing data of coordinates are not empty
--coordinate arrays position increases
--currently checked position is taken from coordinate arrays
--coordinate data from arrays are erased
--checking neighborhood:
---new position is one neighboring step from current position
---if target is reached, complete the algorithm
---if on map and image shows free space:
----the position gets the filling value and is recorded as data of the buffering arrays
-prepare coordinate data storing arrays for next cycle
-reset the buffering arrays