I have some images with keypoints marking the corners of a mask. I want to crop these images and define the new keypoints.
For example, given this image. Keypoints marked by the black 'x'
I want to crop the image, i.e. the grey box and detect the new keypoints as shown by the red 'x'.
I expect that a solution would be to convert the keypoints into a mask, crop the mask and then convert back to keypoints. Is this the best solution and if so can anyone provide guidance on keypoint extraction from a mask?
Note: the shapes are not as simple as the rectangle shown below and could be any shape.
Thank you in advance