Computer Vision Basics Geoff Hulten Predictions in Computer
Computer Vision Basics Geoff Hulten
Predictions in Computer Vision Classification Cat Eye Closed Dog Localization Segmentation Important Points Cat vs Not-Cat Important Points Eye vs Not Eye Opened
Image Basics Greyscale Intensity 8 -bpp 255 0 0 0 128 0 0 0 64 Encoding Normalize Red Channel 255 Green Channel 255 Color Encoding 255 0 0 0 Blue Channel 255 00 0 0 128 255 0 0 0 64 0 0 0. 5 0 0 0 . 25 Intensity 0 255 1. 0 To Grey 1. 0 . 21 . 72 . 03 . 21 . 72 . 01
Indexing Image Data x 0 1 2 1. 0 0 0 1 0 0. 5 0 2 0 0 . 25 y 0 X=0 Y=0 X=1 Y=0 X=2 Y=0 X=0 Y=1 X=1 Y=1 X=2 Y=1 X=0 Y=2 X=1 Y=2 X=2 Y=2 1. 0 0 0. 5 0 0. 25 from PIL import Image image = Image. open(<path>) pixels = image. load() intensity = image. getpixel( ( 1, 1) ) / 255. 0 intensity = pixels[1, 1] / 255. 0
Blink Image Pipeline Load Grey Normalize Size 24 x 24 Crop Region of Interest Localize 1. 0 0 0. 5 0 0 0 . 25 24 x 24 Intensity Array 2. 3 -. 5 Not in -. 5. 87 Homework -. 5 Framework -. 5. 16 24 x 24 Normalized Array
Very Basic Image Features Define the Region • Whole Image • Grids • Regions of Interest • Relative to Points of Interest Select the Property Select the Conversion • Intensity • Average • Response to • Min/Max • Gradient • Wavelets • Histograms
Intensity Features Example Features: Region = Whole Image Property = Intensity 1. 0 0 0. 5 0 0 0 . 25 Average: 0. 194 Max: 1. 0 Min: 0. 0 Hist 0 -. 2: . 666 Hist. 2 -. 4: . 111 Hist. 4 -. 6: . 111 Hist. 6 -. 8: 0 Hist. 8 -1: . 111 Example Features: Region = Middle Column Property = Intensity 1. 0 0 0. 5 0 0 0 . 25 Average: 0. 166 Max: 0. 5 Min: 0. 0 Hist 0 -. 2: . 666 Hist. 2 -. 4: 0 Hist. 4 -. 6: . 333 Hist. 6 -. 8: 0 Hist. 8 -1: 0
Selecting Regions Whole Image Regular Grid 8 Intensity Features 32 Intensity Features Region of Interest 8 Intensity Features Using Localization 24 Intensity Features Combinations If using: Avg, Min, Max, 5 histograms 72 Intensity Features Feature selection: • By region • By feature type
Gradients Pixel Intensity Image X-Gradient Y-Gradient Pixel Intensity Gradient (on second axis) 0. 25 11 0. 9 0. 25 0. 8 0. 7 0. 25 0 0. 6 -0. 5 0. 4 0. 3 0. 2 0. 1 00 -1 00 11 Image 22 33 44 X Location 55 X-Gradient 66 77 88 Y-Gradient
Features from Gradients Whole Image Regular Grid Region of Interest Using Localization 16 Gradient Features 64 Gradient Features 16 Gradient Features 48 Gradient Features Example Features: Average. X: 0. 194 Max. X: 1. 0 Min. X: 0. 0 Hist. X 0 -. 2: . 666 Hist. X. 2 -. 4: . 111 Hist. X. 4 -. 6: . 111 Hist. X. 6 -. 8: 0 Hist. X. 8 -1: . 111 Average. Y: 0. 23 Max. Y: 0. 4 Min. Y: 0. 1 Hist. Y 0 -. 2: . 2 Hist. Y. 2 -. 4: 0 Hist. Y. 4 -. 6: . 2 Hist. Y. 6 -. 8: 0 Hist. Y. 8 -1: . 6 Combinations 144 Gradient Features
Convolutions 3 x 3 Filter 0 0 0 -1 0 0 0 Response Convolve Intensity Data 0 0 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 0 0 0
Sobel Edge Detection Simple X Gradient Sobel X Gradient 0 0 0 -1 0 1 -2 0 0 0 -1 0 1 Simple Y Gradient Sobel Y Gradient 0 1 2 1 0 0 0 0 -1 -2 -1
Wavelet Features Gabor Wavelets Haar Wavelets Neural Networks?
Summary of Basics of Computer Vision • Basic Predictions • Classification • Localization • Segmentation • Construct Features With • Region • Intensity or response • Statistics • Preprocessing Pipeline • Normalize: color, size • Localize & crop • Convert to intensity, normalize • A lot of modern computer vision done with neural networks – we’ll get there…
- Slides: 14