Last active
April 4, 2017 05:35
-
-
Save JorgeGT/1da63221e99265d26dfda4ec23bf312b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
%% Init | |
clear all | |
close all | |
%!cp -v ~/place/spacescience.tech/place/img/1*.png ~/place | |
%% Import data and sum | |
files = dir('1*.png'); | |
image = imread(files(1).name); | |
chnum = zeros(1e3,1e3); | |
for i = 2:length(files) | |
if mod(i,5) == 0 | |
disp([num2str(round(i/length(files)*100,2)) '% completed']) | |
end | |
imori = int16(image); | |
image = int16(imread(files(i).name)); | |
difference = abs(double(logical(image-imori))); | |
if sum(sum(difference)) < 1000 % delete frames with colormap changes | |
chnum = chnum + difference; | |
end | |
end | |
%% Plot | |
figure('Position',[0 0 1000,1000],'Visible','off') | |
imagesc(chnum) | |
axis equal | |
axis off | |
colormap(inferno(700)) % needs https://es.mathworks.com/matlabcentral/fileexchange/51986-perceptually-uniform-colormaps | |
caxis([0 20]) % rounded up from prctile(chnum(:),[2 98]) | |
c = colorbar('southoutside'); | |
c.FontSize = 6; | |
c.Label.String = '\bfActivity (recorded color changes)'; | |
c.Position = c.Position .* [0.9 0.9 0.3 0.3]; | |
export_fig ~/Dropbox/out_3 -png -r300 % needs https://github.com/altmany/export_fig |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment