Lengthen a contour

Hello,
For a non closed contour how to lengthen it for N pixels in the direction of the contour ?

Thank you,
CJ