I have an image and a mask. I want the image to be the same, but rotated, scaled and positioned like mask. What can I use?
1 Answer
Assuming that the image is blank everywhere but where the face is drawn...
The first step is to scale the image to the mask. That doesn't require a detailed explanation here as it is too trivial a problem.
Second, rotate the image by 90 degrees three times and save each one.
Third, for the four versions of the image (the original and three rotations), do the image addition. The only one with information will be the one that is rotationally aligned with the mask.