Do perimeters one island at time instead of doing all holes before all contours
Adapt new code to contains_point()