Added imwrite inside show contour.

porting back changes from pandaboard