following codes works
Mat image=cvLoadImage("face1.jpg",1);
Mat imagegray, output, imageresult;;
Mat canny;
cvtColor(image, imagegray,CV_BGR2GRAY);
vector<vector<Point>>contours;
vector<Vec4i>hierarchy;
Canny(imagegray,canny,50,150);
findContours(canny,contours,hierarchy,CV_RETR_TREE,CV_CHAIN_APPROX_SIMPLE,cvPoint(0,0));
Mat drawing=Mat::zeros(imagegray.size(),CV_8UC3);
vector<Point>contours_approx;
approxPolyDP(contours[0],contours_approx,100,true)
//approxPolyDP(contours,imageresult,100,true);
drawContours(image,contours,-1,Scalar(255,0,0));
namedWindow("Display");
imshow("Display",image);
waitKey(0);
return(0);
findcontour() needs a canny/threshold binary image for the input.
approxPolyDP() is to approximates a curve to another curve(vector of points).