-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetProcessedImage.m
More file actions
36 lines (36 loc) · 1.49 KB
/
Copy pathgetProcessedImage.m
File metadata and controls
36 lines (36 loc) · 1.49 KB
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
% Check if the image designated by the given path string has already been
% processed. If it has been processed, return the processed image.
% Otherwise, return an empty array.
%
% Author: Elliot Tuck
% Date: 20170803
function processed_image = getProcessedImage(path)
processed_image = [];
if (~isappdata(0, 'processed_data'))
% processed_data has not been created yet, so there is definitely no
% processed version of the current image
return;
else
% processed_data has been created, so check if it contains a processed
% version of the image in question
processed_data = getappdata(0, 'processed_data');
camera = getappdata(0, 'camera');
cameraName = camera.name;
if (~isfield(processed_data.images, cameraName))
% processed_data does not contain a folder for the current camera,
% so it definitely does not have a processed version of the
% current image
return;
else
% processed_data contains a folder for the current camera, so check
% if it has a processed version of the current image
[~, imageName, ~] = fileparts(path);
if (isfield(processed_data.images.(cameraName), imageName))
% processed_data contains a processed version of the current
% image
processed_image = ...
processed_data.images.(cameraName).(imageName);
end
end
end
end