Added code for opening and closing before finding contours.
Change maximum vertex count before using object simplification (convex hull)