Extraction of object from contour and save it as new image

I have an image where an object is having an irregular shape. I am able to draw contour around it. I want it to save that object as a new image on my local disk.

yes, and?

imagine asking this on Stack Overflow. their rules are a good idea to take as guidelines here.

I searched it, sir. But couldn’t find it. If you could provide me the link it would be highly helpful for me.

sure! here are some links:

and then, if you still have a question, your question could come with information. your initial post contained nothing specific.