990 likes | 1.46k Views
Image analysis and computer vision. Image processing basic steps. 1. Image Enhancement 2. Image Restoration 3. Image Analysis 4. Image compression 5. Image Synthesis. Goal in image analysis.
E N D
Image processing basic steps 1. Image Enhancement 2. Image Restoration 3. Image Analysis 4. Image compression 5. Image Synthesis
Goal in image analysis • Image analysis operations are used in applications, that require the measurement and classification of image information • Examples: • Cell recognition from tissue sample • Object recognition from conveyor belt • Zip code reading from envelope
Group discussion • List application possibilities for image analysis!
Image analysis • Basis is visual image, whose content should be interpreted • As a result mostly non-image data • As a goal is to understand images content classifying its content
Image analysis operations • Segmentation • operation that highlights individual objects within an image. • Feature Extraction • after segmentation->measure the individual features of each object • Object Classification • classify the object to particular category segment feature classification space space space feature classification Segmentation extraction feature class image distinct objects
Segmentation operations • Image Preprocessing • Initial Object Discrimination • Image Morphological Operations segment feature classification space space space feature classification Segmentation extraction feature class image distinct objects
Image Preprocessing • In preprocessing eg. change images contrast, filter noise and remove distracting image background • Image enhancement operations is used
Initial Object Discrimination • Separates image objects into rough groups with like characteristics using image enhancement operations • Outlining and contrast enhancement often used
Initial object discrimination - example Original Binary contrast enhanced
Initial object discrimination - example • Sobel edge-enhancement • 1 Filter with horizontal mask • 2 Filter with vertical mask • 3 Add • -1 0 1 -1 -2 -1 • -2 0 2 0 0 0 • -1 0 1 1 2 1
Morphological processing • In preprocessed image the boundaries are very rough-> need to “clean up” • Morphological operations
Morphological operations • Binary operations • Erosion and dilation • Opening and Closing • Outlining • Skeletonization • Gray-scale operations • Top-Hat and Well transformations • Morphological gradient • Watershed edge detection
Binary morphology • Focus on two brightness values. black=0, white=255 • Technically same as spatial convolution • combines pixel brightness with a structuring element, looking for specific pattern • Array of logical values • (cut=AND, union=OR, complement=NOT)
Binary morphology - equation O(x,y) = 0 or 1 (predefined) if X =I (x,y) AND X0 =I (x+1,y) AND X1 =I (x+1,y-1) AND X2 =I (x,y-1) AND X3 =I (x-1,y-1) AND X4 =I (x-1,y) AND X5 =I (x-1,y+1) AND X6 =I (x,y+1) AND X7 =I (x+1,y+1) otherwise, O(x,y) = opposite state
Erosion • Reduces the size of the objects in relation to their background Mask 1 1 1 O(x,y) = 1 if “Hit” 1 1 1 1 1 1 = 0 if “Miss” 1 1 1
Example (1/2) Original Binary contrast enhanced Erosion image
Example (2/2) Binary contrast enhanced Eroded image
Dilation • Uniformly expands the size of object Mask 0 0 0 O(x,y) = 0 if “Hit” 0 0 0 = 1 if “Miss” 0 0 0
Example Binary contrast enhanced Dilated image
Opening • Erosion then Dilation • Removes one pixel mistakes like erosion • Object size remains Binary contrast enhanced Erosion Dilation
Closing • Dilation + erosion • Fills pixel wide holes • Object size remains Binary contrast enhanced Dilation Erosion
Cleaning Original binary contrast enhanced image Opening Cleaned = Opened and Closed
Outlining • Forms one-pixel-wide outlines and tends to be more immune to image noise than most edge enhancement operations • Implementation: • Eroded image subtract from original
Outlining Original Binary contrast enhanced
Outlining Eroded image Original - Eroded image
Skeletonizing • Make “wireframe” model from image • Uses different erosion masks • Analogy: fire, which burns object from each side
Gray-scale operations • Used when binary operations degrade an image • Gray-scale operation can be followed binary operation • Mask terms -255 ... 255 or “Don’t care”
Erosion and Dilation • Erosion reduces the size of objects by darken the bright areas in image • Dilation is inverse operation
Original Erosion Dilation Erosion and Dilation example
Opening and Closing • Opening = erosion + dilation • Opening reduces noise pixels • Closing = dilation + erosion • Closing fills one-pixel-wide holes
Eroded Dilated Morphological gradient • Images outlines as a result • Make copy from image. Erosion to other image and dilation to other. Then images subtract from each other using a dual-image point process. Gradient Image Original Eroded - dilated =
Morphological gradient Original Erosion Dilation Gradient=Erosion-Dilation
Feature Extraction • Operation followed by segmentation • Choose essential features and measure them from objects • Goal is to find features, which help find out object’s class easier segment feature classification space space space feature classification Segmentation extraction feature class image distinct objects
Features • Brightness and color • Texture • Shape • Spatial moments • Edge shape
Feature: Brightness and color Histogram can show • Color (sorting by colors) • Brightness • average brightness • Standard deviation brightness • mode brightness • sum of all pixel brightnesses<-> energy (zero-order spatial moment)
Example: Fruit sorting Problem: • Boxes goes on conveyor belt, which has green apples (Granny Smith) and red apples (Red Delicious) and also oranges • Sort boxes to the correct follow on conveyor belts automatically
Example: Fruit sorting Solution: • Capture image with camera to RGB images • Convert RGB to HSL • Explore Hue color component which fruit it is