Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
33 lines (26 sloc) 1.12 KB
% Image Saliency
addpath('gbvs');
addpath('Output');
old_background = "eyetrackingstory_01/stimuli/free_ebooks/old/withbackground/*.jpg";
young_background = "eyetrackingstory_01/stimuli/free_ebooks/young/withbackground/*.jpg";
directories = [old_background, young_background];
output_root_images = 'Output/Saliency/Heatmaps/';
output_root_csv = 'Output/Saliency/CSV/';
old_background_files = dir(old_background);
size_thing = size(old_background_files);
num_files = size_thing(1);
size_directories = size(directories);
for dir_index = 1:size_directories(2)
background_files = dir(directories(dir_index));
size_thing = size(background_files);
num_files = size_thing(1);
for index = 1:num_files
filename = erase(background_files(index).name, {'.jpg'});
img = imread(background_files(index).name);
map = gbvs(img).master_map_resized;
img_with_heatmap = heatmap_overlay(img, map);
imwrite(img_with_heatmap, strcat(output_root_images, filename, '.jpg'));
csv_filename = erase(filename, {'.jpg'});
csvwrite(strcat(output_root_csv, csv_filename, '.csv'), map);
end
end
You can’t perform that action at this time.