For demonstration I show an animated gif, of what the program is doing.
This image starts with an image for 5 seconds showing all the objects. Then in the next frames
every single object, which can be found by the program is shown in B/W, while the other objects are shown reddish. Here comes the image:
Afterwards, after stepping through these image regions, every region can be saved as a separate image file.