Created
February 18, 2015 11:22
-
-
Save fado/1e4dc3ecb612edc57ffe to your computer and use it in GitHub Desktop.
Background generator...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [ Bkg ] = bckGenerator( videoStream, sampling ) | |
buffer = []; | |
counter = 0; | |
% start : step size : end | |
for t = 1:sampling:size(videoStream, 4) | |
counter = counter + 1; | |
currentFrame = read(videoStream, t); | |
currentFrameGrey = rgb2gray(currentFrame); | |
currentFrameGrey = double(currentFrameGrey); | |
buffer(:,:,counter) = currentFrameGrey; | |
end | |
Bkg = median(buffer, 3); | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment