this is the question and the code i have so far. please advise.
In this step, you will write a function that takes affino parameters as Inputs and returna a combined 3 x 3 matrix. DO THIS: Write a function that takes seven Inputs and returns a transformation T. Name this function affine_transform. These include the following: 8 - Rotation around the center of the image (-180,180). sx - Sale factor for the image in the x direction (0,6) sy - Sale factor for the image in the x direction (0,5 tx- translation in the x direction (pixels) ty - translation in the y direction (pixels) shx - Shear in the x direction (0,1) shy - Shear in the y direction [0.1) The order of these is very important. First, assume the image is already centered, then apply shear, scaling, rotation, and finish with translation. [66): ##Put your function here from ipywidgets import interact, interact_manual def affine_transform(a-@,sx 0.5, sy 8.5, txu, ty@,shx @, shy-): T = np.matrix([[i,a,d], [0,1,0], [0,0,1))) *Your transformations go here. a(-180, 180) a - -angle/180 np.pi SH - np.matrix([[1, shx, ), Ishy, 1,0], [0,0,1))) S np.matrix(lisx,0,0), te,sy.bi, 16,0 1155 - np.matrix(I Inp.cos(a), np.sin(a), 01. Inp.sin(a), np.cos(a),e1, [0,0,111) np.matrix([11,0, tx), te, 1, tyl, 10,0,1))) TSH S RAT; mp2 Tkim; return T In this step, you will write a function that takes affino parameters as Inputs and returna a combined 3 x 3 matrix. DO THIS: Write a function that takes seven Inputs and returns a transformation T. Name this function affine_transform. These include the following: 8 - Rotation around the center of the image (-180,180). sx - Sale factor for the image in the x direction (0,6) sy - Sale factor for the image in the x direction (0,5 tx- translation in the x direction (pixels) ty - translation in the y direction (pixels) shx - Shear in the x direction (0,1) shy - Shear in the y direction [0.1) The order of these is very important. First, assume the image is already centered, then apply shear, scaling, rotation, and finish with translation. [66): ##Put your function here from ipywidgets import interact, interact_manual def affine_transform(a-@,sx 0.5, sy 8.5, txu, ty@,shx @, shy-): T = np.matrix([[i,a,d], [0,1,0], [0,0,1))) *Your transformations go here. a(-180, 180) a - -angle/180 np.pi SH - np.matrix([[1, shx, ), Ishy, 1,0], [0,0,1))) S np.matrix(lisx,0,0), te,sy.bi, 16,0 1155 - np.matrix(I Inp.cos(a), np.sin(a), 01. Inp.sin(a), np.cos(a),e1, [0,0,111) np.matrix([11,0, tx), te, 1, tyl, 10,0,1))) TSH S RAT; mp2 Tkim; return T