function [ A, vidWidth, vidHeight ] = importVideoToColumn( videoPath )
%[A, Width, Height] = IMPORTVIDEOTOCOLUMN (videoPath) - funkce nahraje
%video z lokace "\videoPath" do pracovniho prostredi a transformuje do
%sloupcoveho tvaru (matice pozorovani A).
%   A         - matice pozorovani;
%   Width     - sirka videozaberu;
%   Height    - vyska videozaberu;
%   videoPath - cesta k souboru videa.

vidReader = VideoReader( videoPath );

vidWidth = vidReader.Width;
vidHeight = vidReader.Height;

pixelCount = vidHeight * vidWidth;
frameCount = floor( vidReader.Duration * vidReader.FrameRate ) - 1;

A = zeros( pixelCount, frameCount, 'uint8' );

for frame = 1 : frameCount
    frameRGB = readFrame( vidReader );
    frameGray = rgb2gray( frameRGB );
    
    A(:, frame) = frameGray(:); % skladani sloupcu snimku "pod sebe"
end

A = double(A);
end