On binary images it is very useful to extract features using markers. In the example bellow the goal is to extract only the digits 1 and 4 from the image shown in figure 1. Note that they both have a | in common so it is very easy to make markers to them (using some erosions for instance). Figure 2 shows the markers. The final result is shown in figure 3.
1 1 1 1 1 1 Structuring element used 1 1 1
fig. 1 - Original Image
fig. 2 - Marker Image
fig. 3 - Final Result
In the image bellow we show a 1D signal (blue) that was subtracted by a constant resulting the plot yellow (the marker image). The reconstruction is the discrete red plot.
0 0 0 1 1 1 Structuring element used 0 0 0
fig. 4 - Combined signals