Problem
Based on the principle of af?ne transformation, write your own function to perform image translation, translation(image, tx, ty), where image is a gravsealc image and tx and ty arc translation factors [they can be an},r real number: positive, negative, or zero) in the )1 (horizontal) and v (vertical) directions. The output image should be of the same size as the input, and its background is black. Test your function by translating image eameraman.tif by half its height in the positive vertical direction and by one-fourth of its width in the positive horizontal direction.