Calculating Affine Transformation matrix from 4 corner points
If you already have the pairs of corresponding two points from each coordinate,
you can use the function fitgeotrans
 to calculate the transformation matrix.

Once you have got the transformation matrix, the transformation can be done with imwarp.

Note that you are going to use Homography transformation rather than affine transformation in this case (because you have specified corresponding 4 points, which may cause trapezoidal distortion).

The code would be like this...

% assume that the input image is in the variable inputImage.
nPixelsX = 50; % assume that there is square image with 50 pixels for each axes after transformation.
nPixelsY = 50;

movingPoints = [73,86; ...
                117,88; ...
                70,127; ...
                115,128]; % set image's corresponding points
fixedPoint = [0,0; ...
              nPixelsY,0; ...
              0,nPixelsX; ...
              nPixelsY,nPixelsX]; % set ideal coordinate's corresponding points
transformationType = 'Projective';  % this should be homology transformation
tform = fitgeotrans(movingPoints,fixedPoints,transformationType); % make transformation matrix

resultReference = imref2d([nPixelsY, nPixelsX]);
desiredImage = imwarp(inputImage, tform, 'OutputView', resultReference); % transform