Importance sampling and region growing in images