How to find the external points of a square/rectangle contour?

I was working within contours. I should have worked within approxpolydp vector. Thanks for the clarification.