How to perform an object extension and expansion in opencv?

I have an image of hand in grayscale. I want to widen and extend fingers of the hand based on parameters ( length and width ), this finger extension should not distort the background. Each finger will have it’s own parameter which will control the amount of stretch. The vector image below is for visual explanation of what needs to be done.

first, you need to separate that “hand” contour/mask into its parts, i.e. the palm and fingers. why? because you need to know where the fingers are in this contour/mask.

I have the contour/mask for the hand, but I don’t know how to split it into hand and fingers.

convexityDefects() might be helpful

Having those points using convexityDefects(), how to extract fingers portion? Can you maybe help?

have a look again:

the farthest_points , connected, will segment the palm (the inner arrows),
the start_index and end_index points are the resp. neighbouring fingertips

(but no, i wont write your program …)