The backup port is a second best designated port for a segment on the designated switch
. So when a switch delivers the designated port for the segment, it will have a backup port if this switch has another port connected to the same segment. In my opinion, the illustration above is not correct. Switch1 and Switch2 are connected with two segments! So there is no way that Switch2 will have a backup port; it only has one port to each of the segments.
The figure below depicts the port roles on the give network.
In case that a switch has a backup port to a segment, its guaranteed to be the second best designated port. It is connected to the same switch and hence will have the same (lowest) path cost towards and (if applicable) the same (lowest) Sender BID. When the original designated port becomes operational again, the original designated port will take up its role again as designated port.
In the figure below, Switch1 and Switch2 are connected with one segment. Switch1 and Switch2 each have two ports to that segment. Switch1 is the designated switch for that segment (it delivers the designated port) and will also have the backup port for that segment. Fa0/2 on Switch2 is now a non-designated port.
An alternate port is a second best root port for a switch
. So when a switch looses the connectivity to the root; it will automatically select the alternate port as root port. The root port and the alternate port are on different segments.