O'Reilly logo

Visual Media Processing Using MATLAB Beginner's Guide by George Siogkas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – loading, cropping, resizing, and saving a video

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!! ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required