This example demonstrates the use of the field averaging technique. The code in our function will be based on the previous example, but this time we have to make some minor adjustments to fit our problem. Let's see the function that performs field averaging:
function [vid] = FieldAverage(vid,order) % Function for de-interlacing a video using Field Average % Inputs: % vid – Input video matrix (we assume color video) % order - Choice for row replacement % (1: odd rows from odd frames, % 2: even rows from odd frames) % Output: % vid - Output video matrix (de-interlaced) vid = single(vid); % Convert matrix to single to perform averaging for fr = 2:size(vid,4)-1% For all frames (but the first & last) for row = 1:size(vid,1) % For all rows in frame switch order % Checking choice for the order of merging case 1 % Odd rows from odd frames if mod(fr,2) == 0 % For even frames if...