A connectivity solution for extraction of thin objects