3
dt=1/30; % èíòåðâàë âðåìåííîé äèñêðåòèçàöèè
4
fmin=0.15; % íèæíÿÿ ãðàíèöà - ÷àñòîòíûé äèàïàçîí äûõàòåëüíîé âîëíû
5
dt=1/30; % èíòåðâàë âðåìåííîé äèñêðåòèçàöèè
6
Nmed=1/(dt*fmin); % àïåðòóðà ôèëüòðà
9
names = [ "P1H1" "P1LC1" "P1LC2" "P1LC3" "P1LC4" "P1LC5" "P1LC6" "P1LC7" "P1M1" "P1M2" "P1M3" "P2LC1" "P2LC2" "P2LC3" "P2LC4" "P2LC5" "P3LC1" "P3LC2" "P3LC3" "P3LC4" "P3LC5" ];
10
% names = [ "P1H1" "P1LC1" ];
12
zrp="endh/"; % Zero Folder
14
%%% Îò÷¸ò ïî âèäåîðÿäó:
15
for iName = 1:length(names)
20
RGB=load(Path+Name+"_RGB.txt");
21
RGB_nc=load(Path+Name+"_nc_RGB.txt");
22
nc=0:dt:length(RGB)*dt-dt;
24
disp("ERROR: Îøèáêà ïðè ôîðìèðîâàíèè îò÷¸òà ïî "+Name);
31
figure('Position', [0 0 400 100]); title(Name,'FontSize',36);
33
figure('Name','RGB','Position', [0 0 1800 900]); set(gcf,'name',"Ñðàâíåíèå ìåäèàííîé ôèëüòðàöèè äëÿ "+Name); clf;
34
subplot(2,2,1); plot(nc, RGB(:,1),"red", nc, RGB(:,2),"green", nc, RGB(:,3),"blue");
35
title("Âðåìåííîé ðÿä RGB äî êîìïåíñàöèè öâåòà"); grid on;
36
xlabel("Ñåêóíäû"); ylabel("Èíòåíñèâíîñòü öâåòîâûõ êàíàëîâ"); % ylim([40;105]);
38
subplot(2,2,2); plot(nc, RGB_nc(:,1),"red", nc, RGB_nc(:,2),"green", nc, RGB_nc(:,3),"blue");
39
title("Âðåìåííîé ðÿä RGB ïîñëå êîìïåíñàöèè öâåòà"); grid on;
40
xlabel("Ñåêóíäû"); ylabel("Èíòåíñèâíîñòü öâåòîâûõ êàíàëîâ"); % ylim([40;105]);
44
RGB_med(:,1)=RGB_med(:,1)-medfilt1(RGB_med(:,1),Nmed);
45
RGB_med(:,2)=RGB_med(:,2)-medfilt1(RGB_med(:,2),Nmed);
46
RGB_med(:,3)=RGB_med(:,3)-medfilt1(RGB_med(:,3),Nmed);
47
plot(nc, RGB_med(:,1),"red", nc, RGB_med(:,2),"green", nc, RGB_med(:,3),"blue");
48
title("Âðåìåííîé ðÿä RGB ïîñëå êîìïåíñàöèè öâåòà è ìåäèàííîãî ôèëüòðà ñ îêíîì N_m_e_d="+Nmed);
49
xlabel("Ñåêóíäû"); ylabel("Èíòåíñèâíîñòü öâåòîâûõ êàíàëîâ"); grid on; ylim([-4;4]);
53
chss2(rgb2pw(RGB, "Cr"), Path, Name);
55
disp("ERROR: Îøèáêà ïðè ôîðìèðîâàíèè îò÷¸òà èç èñõîäíûõ äàííûõ");
59
%% Êîìïåíñàöèÿ ÿðêîñòè
61
chss2(rgb2pw(RGB_nc, "Cr"), Path, Name);
63
disp("ERROR: Îøèáêà ïðè ôîðìèðîâàíèè îò÷¸òà èç äàííûõ ñ êîìïåíñàöèåé öâåòà");
67
%% Êîìïåíñàöèÿ ÿðêîñòè + ìåäèàííàÿ ôèëüòðàöèÿ
69
chss2(rgb2pw(RGB_med, "Cr"), Path, Name);
71
disp("ERROR: Îøèáêà ïðè ôîðìèðîâàíèè îò÷¸òà èç äàííûõ ñ êîìïåíñàöèåé öâåòà è ìåäèàííîé ôèëüòðàöèè");