Local region transform

How to use OpenCV to transform local region rigidly