1
function pw = rgb2pw2(pwc, VideoFile)
3
cad = 30; % 30 êàäðîâ/ñåê
4
lag = 100; % íàèáîëüøèé ëàã ÀÊÔ
6
fMi = 40.0/60.0; % ÷àñòîòà ñðåçà äëÿ 40 óä/ìèí (0.6667 Ãö)
7
fMa = 240.0/60.0; % ÷àñòîòà ñðåçà äëÿ 240 óä/ìèí (4.0 Ãö)
8
lvl = 10; % êîëè÷åñòâî óðîâíåé ðàçëîæåíèÿ ÊÌÀ
9
wavname = 'db40'; % ìîäåëü âåéâëåò-ôóíêöèé
11
dt = 1.0/cad; % èíòåðâàë äèñêðåòèçàöèè âðåìåíè, ñåê
12
len = length(pwc(:,2)); % êîëè÷åñòâî îòñ÷åòîâ G-ñèãíàëà
13
dfc = cad/(len-1); % èíòåðâàë äèñêðåòèçàöèè ÷àñòîòû, Ãö
14
lMax = 0.5*len; % ïîëîâèíà îò êîëè÷åñòâà îòñ÷åòîâ ñèãíàëà
15
tim(1) = 0.0; fa(1) = 0.0; fqc(1) = 0.0;
17
tim(i) = tim(i-1)+dt; % âðåìÿ â ñåêóíäàõ
19
SfMi(1) = 0.0; CfMi(1) = 1.0; SfMa(1) = 0.0; CfMa(1) = 1.0;
22
pw = (112.0*pwc(:,1)-93.8*pwc(:,2)-18.2*pwc(:,3))./255.0;
23
SMO_med = floor(cad/fMi);
24
% % % Àëãîðèòìû G, GR, Cr
25
DEV_med = medfilt1(pw.*pw,SMO_med);
26
STD_med(:,1) = sqrt(DEV_med);
31
file=fopen(NameVideoFile(VideoFile)+'_pw.txt','w');
32
fprintf(file,'%f\n',pw);