added image contour processing