This is a rather straightforward procedure that will be implemented as a MATLAB function. We will write a function that accepts the filename of an existing video file, the resizing factor, the frames to be processed, and a filename for the output file. The user will be prompted at the first processed frame to crop it to the desired size and position. The function is as follows:
function CropAndResize(inFnm,resF,framesP,outFnm) % Function for loading, cropping, resizing and saving a video % Inputs: % inFnm – Input video filename % resF - Resizing factor (must be positive) % framesP – Frames to be processed ([start end]) % outFnm - Output video filename % Output: % No output needed!! start = framesP(1); % Start frame stop = framesP(2); % End frame % Numeric inputs validation validateattributes(resF,{'numeric'},{'positive'},'CropAndResize','resF...