move the drawing of input image out of the for loop of drawing contours