automatically obtain the coordinate for the region growing