14 Jan 15 class demo
Contents
imfino
clear
load filelist
filename = char(files{1});
info = imfinfo(filename);
disp(info)
Filename: 'C:\Users\jloomis1\Google Drive\ece564\2015\basics20...'
FileModDate: '16-Jan-2013 22:31:05'
FileSize: 607096
Format: 'jpg'
FormatVersion: ''
Width: 2048
Height: 1536
BitDepth: 24
ColorType: 'truecolor'
FormatSignature: ''
NumberOfSamples: 3
CodingMethod: 'Huffman'
CodingProcess: 'Sequential'
Comment: {}
Make: 'FUJIFILM'
Model: 'FinePix6900ZOOM'
Orientation: 1
XResolution: 72
YResolution: 72
ResolutionUnit: 'Inch'
Software: 'Digital Camera FinePix6900ZOOM Ver1.00'
DateTime: '2013:01:15 16:31:16'
YCbCrPositioning: 'Co-sited'
Copyright: ' '
DigitalCamera: [1x1 struct]
ExifThumbnail: [1x1 struct]
DigitalCamera field
info.DigitalCamera info.DigitalCamera.Flash
ans =
FNumber: 2.8000
ExposureProgram: 'Normal program'
ISOSpeedRatings: 100
ExifVersion: [48 50 49 48]
DateTimeOriginal: '2013:01:15 16:31:16'
DateTimeDigitized: '2013:01:15 16:31:16'
ComponentsConfiguration: 'YCbCr'
CompressedBitsPerPixel: 1.5000
ShutterSpeedValue: 6
ApertureValue: 3
BrightnessValue: 3.1100
ExposureBiasValue: 0
MaxApertureValue: 3
MeteringMode: 'Pattern'
Flash: 'Flash fired, no strobe return detection fun...'
FocalLength: 9.7000
MakerNote: [1x238 double]
FlashpixVersion: [48 49 48 48]
ColorSpace: 'sRGB'
CPixelXDimension: 2048
CPixelYDimension: 1536
InteroperabilityIFD: [1x1 struct]
FocalPlaneXResolution: 2678
FocalPlaneYResolution: 2674
FocalPlaneResolutionUnit: 3
SensingMethod: 'One-chip color area sensor'
FileSource: 'DSC'
SceneType: 'A directly photographed image'
ans =
Flash fired, no strobe return detection function, unknown flash mode, flash function present, no red-eye reduction mode or unknown.
EXIF
info.ExifThumbnail
ans =
Compression: 'OJPEG'
Orientation: 1
XResolution: 72
YResolution: 72
ResolutionUnit: 'Inch'
JPEGInterchangeFormat: 1102
JPEGInterchangeFormatLength: 9225
YCbCrPositioning: 'Co-sited'
rgb = imread(filename);
whos rgb
imshow(rgb);
Name Size Bytes Class Attributes rgb 1536x2048x3 9437184 uint8 Warning: Image is too big to fit on screen; displaying at 33%
grayscale image
g = rgb2gray(rgb); imshow(g);
Warning: Image is too big to fit on screen; displaying at 33%
histogram
imhist(g);
pick a region
clf do_input = false; if do_input imshow(g); [sample rect] = imcrop; save demo1 else load demo1 sample = imcrop(g,rect); end imshow(sample);
histogram of region 1
imhist(sample);
pick region2 (another way of saving input)
close all % imshow(g); % [sample2 rect] = imcrop; % rect rect = [658.5100 652.5100 227.9800 281.9800]; % rect = [892.5100 679.5100 137.9800 62.9800]; sample2 = imcrop(g,rect); imshow(sample2);
histogram of region 2
imhist(sample2);
final result
Compare two regions of brightness
% sample region 1 subplot(2,2,1); imshow(sample); subplot(2,2,2); imhist(sample); % sample region 2 subplot(2,2,3); imshow(sample2); subplot(2,2,4); imhist(sample2);