-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathextract_image_metadata.m
More file actions
24 lines (21 loc) · 875 Bytes
/
extract_image_metadata.m
File metadata and controls
24 lines (21 loc) · 875 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
function extract_image_metadata(image_path)
try
% Read the image
info = imfinfo(image_path);
% Extract and display metadata
fprintf('Image Metadata:\n');
fprintf('----------------\n');
fprintf('Filename: %s\n', info.Filename);
fprintf('File format: %s\n', info.Format);
fprintf('Image size: %d x %d pixels\n', info.Width, info.Height);
fprintf('Color space: %s\n', info.ColorType);
fprintf('Bit depth: %d\n', info.BitDepth);
fprintf('Creation date: %s\n', info.DateTime);
% Display additional metadata if needed
% Example: Camera settings, resolution, etc.
% fprintf('Camera: %s\n', info.CameraModel);
% fprintf('Resolution: %d DPI\n', info.XResolution);
catch ME
fprintf('Error: %s\n', ME.message);
end
end