-
Notifications
You must be signed in to change notification settings - Fork 0
/
loaddata.m
executable file
·48 lines (40 loc) · 1.1 KB
/
loaddata.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
%% Load images for final assignment
% create list of images present for the structure from motion project
% Input:
% -none
%
% Output:
% -filelist: List of names of images to be processed in structure from motion
% -imglist_gray : List of images in grayscale
% -imglist_color: List of images in color
%
% Authors:
% -Bas Buller 4166566
% -Rick Feith 4218272
%% list of images
function [names] = loaddata(folder);
% find all images in the folder
folder_names = dir(folder);
name_list = {folder_names(:).name};
names = {};
for i = 1:length(name_list)
if (endsWith(name_list{i},".png"))
names = [names; char(strcat(string(folder),"/",name_list{i}))];
end
end
% add the imagenames to an array
% filelist = [];
%
% for i = 1:length(names)
% filelist = [filelist, strcat(string(folder),"/",names{i})];
% end
% add the images to an grayscale and color arrays
% imglist_gray = [];
% imglist_color = [];
%
% for i = 1:length(filelist)
% im = imread(char(filelist(i)));
% imglist_gray = [[imglist_gray],[rgb2gray(im)]];
% % imglist_color = [[imglist_color],(im)];
% end
end