added convex hull calculation for determining the outline of objects