So my computer is not too strong.. to say the least..
Yet I want to create a median of all pixels in an entire specific movie.
I was able to do it for a sequence of frames in memory.. but I am not sure on how to do it when reading more frames each time... how do I give median weight?
(like I'll read 100 frames each time but the median has to update according to the current median \* 100 \* times I read + 100 \* current image..)
I have this code:

```
mov = VideoReader('MVI_3478.MOV');
seq = read(mov, [1 frames]);
% create background
channels = size(seq, 3);
height = size(seq,1);
width = size(seq,2);
BG = zeros(height, width, channels, 'uint8');
for c = 1:channels
    for y = 1:height
        for x = 1:width
            BG(y,x,c) = median(seq(y,x,c,:));
        end
    end
end

```

and my question is, given that I will add another loop above everything, how to give median weight?

Thanks!