-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathImageInfo.m
More file actions
32 lines (27 loc) · 760 Bytes
/
ImageInfo.m
File metadata and controls
32 lines (27 loc) · 760 Bytes
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
classdef ImageInfo
properties
Path
Name
Category
end
methods
function obj = ImageInfo(path, category)
obj.Path = char(path);
obj.Name = Path.GetFileName(path);
obj.Category = char(category);
end
function indentifier = GetIndentifier(obj)
indentifier = strcat(obj.Category, " ", obj.Name);
end
function image = GetImage(obj)
image = imread(obj.Path);
end
function image = GetImageGray(obj)
image = obj.GetImage();
% change to grayscale for JPG
if Path.IsJpgFile(obj.Path)
image = rgb2gray(image);
end
end
end
end