Image Processing for feature extraction

Similar documents
CoE4TN4 Image Processing. Chapter 3: Intensity Transformation and Spatial Filtering

Vision Review: Image Processing. Course web page:

Part I Feature Extraction (1) Image Enhancement. CSc I6716 Spring Local, meaningful, detectable parts of the image.

CS534 Introduction to Computer Vision. Linear Filters. Ahmed Elgammal Dept. of Computer Science Rutgers University

Digital Image Processing

Practical Image and Video Processing Using MATLAB

Image preprocessing in spatial domain

Introduction. Computer Vision. CSc I6716 Fall Part I. Image Enhancement. Zhigang Zhu, City College of New York

Image Filtering. Median Filtering

EE482: Digital Signal Processing Applications

Table of contents. Vision industrielle 2002/2003. Local and semi-local smoothing. Linear noise filtering: example. Convolution: introduction

Image Enhancement in spatial domain. Digital Image Processing GW Chapter 3 from Section (pag 110) Part 2: Filtering in spatial domain

Computer Vision, Lecture 3

>>> from numpy import random as r >>> I = r.rand(256,256);

IMAGE PROCESSING: AREA OPERATIONS (FILTERING)

Non Linear Image Enhancement

IMAGE ENHANCEMENT IN SPATIAL DOMAIN

ECC419 IMAGE PROCESSING

Image Enhancement. DD2423 Image Analysis and Computer Vision. Computational Vision and Active Perception School of Computer Science and Communication

Image acquisition. Midterm Review. Digitization, line of image. Digitization, whole image. Geometric transformations. Interpolation 10/26/2016

Digital Image Processing. Digital Image Fundamentals II 12 th June, 2017

LAB MANUAL SUBJECT: IMAGE PROCESSING BE (COMPUTER) SEM VII

Midterm Examination CS 534: Computational Photography

Image analysis. CS/CME/BIOPHYS/BMI 279 Fall 2015 Ron Dror

Images and Filters. EE/CSE 576 Linda Shapiro

DIGITAL IMAGE DE-NOISING FILTERS A COMPREHENSIVE STUDY

DIGITAL IMAGE PROCESSING (COM-3371) Week 2 - January 14, 2002

Image Deblurring. This chapter describes how to deblur an image using the toolbox deblurring functions.

SECTION I - CHAPTER 2 DIGITAL IMAGING PROCESSING CONCEPTS

>>> from numpy import random as r >>> I = r.rand(256,256);

Midterm Review. Image Processing CSE 166 Lecture 10

Prof. Feng Liu. Winter /10/2019

Image Processing. Adam Finkelstein Princeton University COS 426, Spring 2019

Matlab (see Homework 1: Intro to Matlab) Linear Filters (Reading: 7.1, ) Correlation. Convolution. Linear Filtering (warm-up slide) R ij

1.Discuss the frequency domain techniques of image enhancement in detail.

PRACTICAL IMAGE AND VIDEO PROCESSING USING MATLAB

Image Enhancement using Histogram Equalization and Spatial Filtering

Image filtering, image operations. Jana Kosecka

Last Lecture. photomatix.com

Image Filtering in Spatial domain. Computer Vision Jia-Bin Huang, Virginia Tech

CSC 320 H1S CSC320 Exam Study Guide (Last updated: April 2, 2015) Winter 2015

Achim J. Lilienthal Mobile Robotics and Olfaction Lab, AASS, Örebro University

8.2 IMAGE PROCESSING VERSUS IMAGE ANALYSIS Image processing: The collection of routines and

Image Enhancement in Spatial Domain

CSE 564: Scientific Visualization

Announcements. Image Processing. What s an image? Images as functions. Image processing. What s a digital image?

Digital Image Processing

Motivation: Image denoising. How can we reduce noise in a photograph?

Last Lecture. photomatix.com

Chapter 3 Image Enhancement in the Spatial Domain. Chapter 3 Image Enhancement in the Spatial Domain

Midterm is on Thursday!

Filip Malmberg 1TD396 fall 2018 Today s lecture

Chapter 6. [6]Preprocessing

Computer Vision for HCI. Noise Removal. Noise in Images

Digital Image Processing

CS/ECE 545 (Digital Image Processing) Midterm Review

Preparing Remote Sensing Data for Natural Resources Mapping (image enhancement, rectifications )

Image Processing COS 426

Frequency Domain Enhancement

Motivation: Image denoising. How can we reduce noise in a photograph?

CSCI 1290: Comp Photo

Last Lecture. Lecture 2, Point Processing GW , & , Ida-Maria Which image is wich channel?

Image Enhancement in the Spatial Domain

Chapter 3. Study and Analysis of Different Noise Reduction Filters

Prof. Vidya Manian Dept. of Electrical and Comptuer Engineering

ELEC Dr Reji Mathew Electrical Engineering UNSW

Carmen Alonso Montes 23rd-27th November 2015

Sensors and Sensing Cameras and Camera Calibration

ANALYSIS OF IMAGE ENHANCEMENT TECHNIQUES USING MATLAB

Filtering in the spatial domain (Spatial Filtering)

CS6670: Computer Vision Noah Snavely. Administrivia. Administrivia. Reading. Last time: Convolution. Last time: Cross correlation 9/8/2009

Filters. Materials from Prof. Klaus Mueller

Digital Image Processing

Image processing for gesture recognition: from theory to practice. Michela Goffredo University Roma TRE

CSE 564: Visualization. Image Operations. Motivation. Provide the user (scientist, t doctor, ) with some means to: Global operations:

Digital Image Fundamentals. Digital Image Processing. Human Visual System. Contents. Structure Of The Human Eye (cont.) Structure Of The Human Eye

Digital Image Fundamentals. Digital Image Processing. Human Visual System. Contents. Structure Of The Human Eye (cont.) Structure Of The Human Eye

Image restoration and color image processing

A Study On Preprocessing A Mammogram Image Using Adaptive Median Filter

CS 4501: Introduction to Computer Vision. Filtering and Edge Detection

Digital Image Processing

Image Processing Computer Graphics I Lecture 20. Display Color Models Filters Dithering Image Compression

Computing for Engineers in Python

CEE598 - Visual Sensing for Civil Infrastructure Eng. & Mgmt.

USE OF HISTOGRAM EQUALIZATION IN IMAGE PROCESSING FOR IMAGE ENHANCEMENT

Reading Instructions Chapters for this lecture. Computer Assisted Image Analysis Lecture 2 Point Processing. Image Processing

Spatial Domain Processing and Image Enhancement

On spatial resolution

International Journal of Innovative Research in Engineering Science and Technology APRIL 2018 ISSN X

Chapter 2 Image Enhancement in the Spatial Domain

Digital Image Fundamentals and Image Enhancement in the Spatial Domain

Digital Image Processing. Lecture # 4 Image Enhancement (Histogram)

CAP 5415 Computer Vision. Marshall Tappen Fall Lecture 1

Computer Vision. Howie Choset Introduction to Robotics

Image and Video Processing

COMPARITIVE STUDY OF IMAGE DENOISING ALGORITHMS IN MEDICAL AND SATELLITE IMAGES

CoE4TN4 Image Processing. Chapter 4 Filtering in the Frequency Domain

Stochastic Image Denoising using Minimum Mean Squared Error (Wiener) Filtering

An Adaptive Kernel-Growing Median Filter for High Noise Images. Jacob Laurel. Birmingham, AL, USA. Birmingham, AL, USA

Image features: Histograms, Aliasing, Filters, Orientation and HOG. D.A. Forsyth

Transcription:

Image Processing for feature extraction 1

Outline Rationale for image pre-processing Gray-scale transformations Geometric transformations Local preprocessing Reading: Sonka et al 5.1, 5.2, 5.3 2

Image (pre)processing for feature extraction (cont d) Pre-processing does not increase the image information content It is useful on a variety of situations where it helps to suppress information that is not relevant to the specific image processing or analysis task (i.e. background subtraction) The aim of preprocessing is to improve image data so that it suppresses undesired distortions and/or it enhances image features that are relevant for further processing 3

Image (pre)processing for feature extraction Early vision: pixelwise operations; no high-level mechanisms of image analysis are involved Types of pre-processing enhancement (contrast enhancement for contour detection) restoration (aim to suppress degradation using knowledge about its nature; i.e. relative motion of camera and object, wrong lens focus etc.) compression (searching for ways to eliminate redundant information from images) 4

What are image features? Image features can refer to: Global properties of an image: i.e. average gray level, shape of intensity histogram etc. Local properties of an image: We can refer to some local features as image primitives: circles, lines, texels (elements composing a textured region) Other local features: shape of contours etc. 5

Example of global image features a) apples b) oranges hue saturation intensity 6

Example of local image features Circumscribed (benign) lesions in digital mammography Spiculated lesions in (digital mammography) The feature of interest: shape of contour; regularity of contour -Can be described by Fourier coefficients -We can build a feature vector for each contour containing its Fourier coefficients 7

Image features Are local, meaningful, detectable parts of an image: Meaningful: features are associated to interesting scene elements in the image formation process They should be invariant to some variations in the image formation process (i.e. invariance to viewpoint and illumination for images captured with digital cameras) Detectable: They can be located/detected from images via algorithms They are described by a feature vector 8

Preprocessing Pixel brightness transformations (also called gray scale transformations) Do not depend on the position of the pixel in the image Geometric transformations Modify both pixel coordinates and intensity levels Neighborhood-based operations (filtering) 9

Outline Rationale for image pre-processing Gray-scale transformations Geometric transformations Local preprocessing Reading: Sonka et al 5.1, 5.2, 5.3 10

Gray-scale transformations work on histograms A histogram H(r) counts how many times each quantized value occurs It is a 1D array H(i)=number of pixels in image having intensity level i Total area of image=total area under the histogram Can convert from the histogram (counting values) to probabilities (percentages) by just dividing by the area: This produces a probability density function. 11

Contrast adjustment on histograms Adjusting constrast causes the histogram to stretch or shrink horizontally: Stretching = more contrast Shrinking = less contrast 12

Histogram equalization Is a gray-scale transformation for the enhancement of the appearance of images Ex: images that are predominantly dark have all the useful information compressed into the dark end of the histogram The aim: create an image with equally distributed brightness levels over the whole brightness scale Find a grayscale transformation function that creates an output image with a uniform histogram (or nearly so) 13

Histogram equalization Ideal case input output Real case input output 14

Histogram equalization: how it works 1. Initialize the array H=zeros(1, 256) 2. Generate the histogram: scan each pixel and place it in the appropriate bin 3. Generate the cumulative histogram H c (which is the approximation of the discrete distribution function) Map input level p into output level T[p] using T G 1 NM [ p] = round H ( p) c 15

Ideal case: histogram in the input image is gaussian 16

Example 17

Adaptive histogram equalization Allows localized contrast enhancement: Shadows Background variations Other situations where global enhancement wouldn t work Remap based on local, not global histogram Example: 7x7 window around the point Problem: ringing artifacts 18

Adaptive histogram equalization (cont d) 19

Histogram specification Histogram equalization: uniform output histogram We can instead make it whatever we want it to be Comparing two images Stitching multiple images Image-compositing operations Use histogram equalization as an intermediate step 20

Histogram specification First, equalize the histogram of the input image: Then histogram equalize the desired output histogram: Histogram specification is 21

Outline Rationale for image pre-processing Gray-scale transformations Geometric transformations Local preprocessing Reading: Sonka et al 5.1, 5.2, 5.3 22

Problem How are these images related? Slide from T. Svoboda, Homography from point pairs 23

Geometric transformations Commonly used in computer graphics Used in image analysis as well Eliminate geometric distortion that occurs during image acquisition Useful, for instance, when matching two or several images that correspond to the same object Two basic steps: Pixel coordinate transformation Brightness interpolation 24

Pixel coordinate transformations Special cases Bilinear transforms: four pairs of corresponding points are sufficient to find the transformation coefficients x =a 0 +a 1 x+a 2 y+a 3 xy y =b 0 +b 1 x+b 2 y+b 4 xy Affine transforms: only three pairs needed x =a 0 +a 1 x+a 2 y y =b 0 +b 1 x+b 2 y Examples of affine transforms: Rotation Change of scale Skewing 25

Projective transformations Projections of a planar scene by a pinhole camera are always related by homographies Application: rectifying images of planar scenes to a frontoparallel view 26

27

Outline Rationale for image pre-processing Gray-scale transformations Geometric transformations Local preprocessing Reading: Sonka et al 5.1, 5.2, 5.3 28

Local preprocessing Denotes neighborhood operations The output is a function of the pixel s value and of its neighbors Weighted sums, average, min, max, median etc Local preprocessing can be linear or not Image smoothing, edge detection etc. Adapted from Brian Morse, http://morse.cs.byu.edu/450/home/index.php 29

Kernels Most common neighborhood operation: weighted sum The weights of the sum constitute the mask or the kernel of the filter Adapted from Brian Morse, http://morse.cs.byu.edu/450/home/index.php 30

Convolution Spatial filtering is often referred as convolution of the image by a kernel or mask 31

Steps in computing the (2,4) output pixel: a) Rotate the convolution kernel 180 degrees about its center element. b) Slide the center element of the convolution kernel so that it lies on top of the (2,4) element of A. c) Multiply each weight in the rotated convolution kernel by the pixel of A underneath. Sum the individual products from step c. The (2,4) output pixel is: 32

Filtering with MATLAB Image processing toolbox Function imfilter() can be used for filtering either by correlation or convolution. I = imread('coins.png'); h = ones(5,5) / 25; I2 = imfilter(i,h); imshow(i), title('original Image'); figure, imshow(i2), title('filtered Image') 33

Boundary effects 34

Boundary effects: zero-padding 35

Boundary effects: border replication 36

Linear filtering for noise removal What is noise? In computer vision, noise may refer to any entity, in images, data, or intermediate results, that is not interesting for the purposes of the main computation For instance: In edge detection algorithms, noise can be the spurious fluctuations of pixel values introduced by the image acquisition system For algorithms taking as input the results of some numerical computation, noise can be introduced by the computer s limited precision, round-offs errors etc. We will concentrate on image noise 37

Image noise We assume that the main image noise is additive and random I ˆ +, ( i, j) = I ( i, j) n( i j) The amount of noise in an image can be estimated by the means of σ n, the standard deviation of n(i,j) Signal to noise ratio: σ SNR = s σ SNR db n ; σ = 10log s 10 σ n 38

Additive stationary Gaussian noise The simplest noise model The intensity of each pixel has added to it a value chosen from the same Gaussian probability distribution. Model parameters: - mean (usually 0); ˆ i, j = I i, j + - standard deviation. o first intended to describe thermal noise in cameras: o o ( ) ( ) n( i j) I, Electrons can be freed from the CCD material itself through thermal vibration and then, trapped in the CCD well, be indistinguishable from "true" photoelectrons. The Gaussian noise model is often a convenient approximation when we do not know and we cannot estimate the noise characteristics. 39

Limitations of stationary Gaussian noise this model allows noise values that could be greater than maximum camera output or less than 0. Functions well only for small standard deviations may not be stationary (e.g. thermal gradients in the ccd) 40

sigma=1 41

sigma=16 42

Salt-and-pepper noise Salt-and-pepper noise: presence of single dark pixels in bright regions ( salt ) or single bright pixels in white regions ( pepper ); also called impulsional, spot, or peak noise 43

From Trucco and Verri a) Synthetic image of a grey-level checkerboard and grey-level profile along a row b) After adding Gaussian noise (σ=5) c) After adding salt-and-pepper noise 44

45 Linear filtering for noise removal: smoothing Goal: eliminate/reduce noise without altering the signal too much. Response of a linear filter to additive gaussian noise: ( ) ( ) ( ) ( ) ( ) = = = = = + = = = = = k h f m m h m m k f m m h m m k f k h A k j h i E k h A k j h i E k h A E A j i E j i n j i E j i E, 2 2 2 2 2 2 2 2 2 2 ), ( 0 ), ˆ( ), ( ), ˆ( ), ( ˆ,,,, ˆ σ σ μ μ

Example: Smoothing by Averaging 46

Limits of the uniform filter It creates ringing The ringing phenomenon can be explained by aliasing. 47

Smoothing with a Gaussian 48

Gaussian Kernel Idea: Weight contributions of neighboring pixels by nearness 49

Smoothing with a Gaussian kernel The FT of a Gaussian is a Gaussian and thus has no secondary lobes Gaussian smoothing is isotropic A smoothing kernel proportional to exp x2 + y 2 2σ 2 50

Design of a Gaussian filter we need to produce a discrete approximation to the Gaussian function before we can perform the convolution. In theory, the Gaussian distribution is non-zero everywhere, which would require an infinitely large convolution mask. in practice it is effectively zero more than about three standard deviations from the mean, and so we can truncate the mask. The size of the mask is chosen according to σ. w= 3Xσ 51

Gaussian filtering Theorem of central limit: repeated convolution of a uniform 3X3 mask with itself yields a Gaussian filter. This is also called Gaussian smoothing by repeated averaging (RA) Convolving a 3x3 mask n times with an image I approximates the Gaussian convolution of I with a Gaussian mask of σ = n / 3 and size 3(n+1)-n=2n+3 52

Smoothing with non-linear filters Main problems of the averaging filter: 1) Ringing introduces additional noise 2) Impulsive noise is only attenuated and diffused, not removed 3) Sharp boundaries of objects are blurred. Blurring will affect the accuracy of boundary detection Note: first problem is solved by Gaussian filters Second and third problems are addressed by non-linear filters (i.e. filters that can not be modeled as a convolution) 53

Averaging using a rotating mask A non-linear smoothing method that avoids edge blurring by searching for the homogeneous part of the current pixel neighborhood The homogeneity of a subneighborhood is measured using a brightness dispersion σ 2 σ 2 1 1 = g( i, j) g( i, n ( i, j) R n ( i, j) R 2 j) The resulting image is in fact sharpened 54

Averaging using a rotating mask (cont d) Try eight different oriented regions Calculate the brightness dispersion in each Use the average of the oriented neighborhood with the lowest dispersion 55

Median filtering In a set of ordered values, the median is the central value. Median filtering reduces blurring of edges. The idea: replace the current point in the image by the median of the brightness in its neighborhood. 56

Median filtering: discussion is not affected by individual noise spikes eliminates impulsive noise quite well does not blur edges much and can be applied iteratively. Main disadvantage of median filtering in a rectangular neighborhood: damaging of thin lines and sharp corners in the image 57