CMPUT 206. Introduction to Digital Image Processing

Similar documents
Lecture: Edge Detection

Image Processing

Linear Operations Using Masks

EE795: Computer Vision and Intelligent Systems

Classification of image operations. Image enhancement (GW-Ch. 3) Point operations. Neighbourhood operation

Digital filters. Remote Sensing (GRS-20306)

Filtering Images. Contents

Filtering and Enhancing Images

Lecture 6: Edge Detection

Lectures Remote Sensing

Image Processing. BITS Pilani. Dr Jagadish Nayak. Dubai Campus

ECG782: Multidimensional Digital Signal Processing

Ulrik Söderström 16 Feb Image Processing. Segmentation

ECG782: Multidimensional Digital Signal Processing

Part 3: Image Processing

Digital Image Processing. Image Enhancement - Filtering

CS334: Digital Imaging and Multimedia Edges and Contours. Ahmed Elgammal Dept. of Computer Science Rutgers University

Lesson 6: Contours. 1. Introduction. 2. Image filtering: Convolution. 3. Edge Detection. 4. Contour segmentation

Edge and local feature detection - 2. Importance of edge detection in computer vision

Image Processing. Daniel Danilov July 13, 2015

Broad field that includes low-level operations as well as complex high-level algorithms

Image Processing. Traitement d images. Yuliya Tarabalka Tel.

Image processing. Reading. What is an image? Brian Curless CSE 457 Spring 2017

C E N T E R A T H O U S T O N S C H O O L of H E A L T H I N F O R M A T I O N S C I E N C E S. Image Operations II

ME/CS 132: Introduction to Vision-based Robot Navigation! Low-level Image Processing" Larry Matthies"

Topic 4 Image Segmentation

Biometrics Technology: Image Processing & Pattern Recognition (by Dr. Dickson Tong)

Anno accademico 2006/2007. Davide Migliore

Detection of Edges Using Mathematical Morphological Operators

Neighborhood operations

Lecture 7: Most Common Edge Detectors

SECTION 5 IMAGE PROCESSING 2

IMAGE PROCESSING >FILTERS AND EDGE DETECTION FOR COLOR IMAGES UTRECHT UNIVERSITY RONALD POPPE

CS 4495 Computer Vision. Linear Filtering 2: Templates, Edges. Aaron Bobick. School of Interactive Computing. Templates/Edges

Other Linear Filters CS 211A

Segmentation and Grouping

Edge detection. Convert a 2D image into a set of curves. Extracts salient features of the scene More compact than pixels

Image Processing. Application area chosen because it has very good parallelism and interesting output.

Perception. Autonomous Mobile Robots. Sensors Vision Uncertainties, Line extraction from laser scans. Autonomous Systems Lab. Zürich.

CHAPTER 3 IMAGE ENHANCEMENT IN THE SPATIAL DOMAIN

Filtering and Edge Detection. Computer Vision I. CSE252A Lecture 10. Announcement

Biomedical Image Analysis. Spatial Filtering

Edge Detection CSC 767

Point and Spatial Processing

EECS490: Digital Image Processing. Lecture #19

Filtering in frequency domain

Part 3: Image Processing

Filtering Images in the Spatial Domain Chapter 3b G&W. Ross Whitaker (modified by Guido Gerig) School of Computing University of Utah

A New Technique of Extraction of Edge Detection Using Digital Image Processing

Digital Image Procesing

What will we learn? Neighborhood processing. Convolution and correlation. Neighborhood processing. Chapter 10 Neighborhood Processing

Sobel Edge Detection Algorithm

CS534: Introduction to Computer Vision Edges and Contours. Ahmed Elgammal Dept. of Computer Science Rutgers University

Edge Detection. Announcements. Edge detection. Origin of Edges. Mailing list: you should have received messages

Lecture 4: Spatial Domain Transformations

Edge detection. Gradient-based edge operators

Neighbourhood Operations

Practical Image and Video Processing Using MATLAB

Lecture 4: Image Processing

Image Processing: Final Exam November 10, :30 10:30

EEM 463 Introduction to Image Processing. Week 3: Intensity Transformations

Image Processing. CSCI 420 Computer Graphics Lecture 22

Biomedical Image Analysis. Point, Edge and Line Detection

Line, edge, blob and corner detection

Digital Image Processing. Prof. P. K. Biswas. Department of Electronic & Electrical Communication Engineering

Image Processing. Alpha Channel. Blending. Image Compositing. Blending Errors. Blending in OpenGL

Digital Image Processing

Computer Vision 2. SS 18 Dr. Benjamin Guthier Professur für Bildverarbeitung. Computer Vision 2 Dr. Benjamin Guthier

Digital Image Processing COSC 6380/4393

EXAM SOLUTIONS. Image Processing and Computer Vision Course 2D1421 Monday, 13 th of March 2006,

Digital Image Processing. Image Enhancement in the Spatial Domain (Chapter 4)

Digital Image Processing

Vivekananda. Collegee of Engineering & Technology. Question and Answers on 10CS762 /10IS762 UNIT- 5 : IMAGE ENHANCEMENT.

Prof. Feng Liu. Winter /15/2019

Outlines. Medical Image Processing Using Transforms. 4. Transform in image space

Edge Detection. CMPUT 206: Introduction to Digital Image Processing. Nilanjan Ray. Source:

Announcements. Edge Detection. An Isotropic Gaussian. Filters are templates. Assignment 2 on tracking due this Friday Midterm: Tuesday, May 3.

Feature Detectors - Canny Edge Detector

convolution shift invariant linear system Fourier Transform Aliasing and sampling scale representation edge detection corner detection

the most common approach for detecting meaningful discontinuities in gray level. we discuss approaches for implementing

Lecture #13. Point (pixel) transformations. Neighborhood processing. Color segmentation

Image Analysis. Edge Detection

Digital Image Processing ERRATA. Wilhelm Burger Mark J. Burge. An algorithmic introduction using Java. Second Edition. Springer

EECS 556 Image Processing W 09. Image enhancement. Smoothing and noise removal Sharpening filters

CS4442/9542b Artificial Intelligence II prof. Olga Veksler

Image Analysis. Edge Detection

Computer and Machine Vision

Image gradients and edges April 11 th, 2017

Advanced Video Content Analysis and Video Compression (5LSH0), Module 4

Multimedia Computing: Algorithms, Systems, and Applications: Edge Detection

CS4442/9542b Artificial Intelligence II prof. Olga Veksler

Image gradients and edges April 10 th, 2018

Chapter 3: Intensity Transformations and Spatial Filtering

SYDE 575: Introduction to Image Processing

CHAPTER V IMPLEMENTATION AND TESTING

Keywords: Thresholding, Morphological operations, Image filtering, Adaptive histogram equalization, Ceramic tile.

Types of Edges. Why Edge Detection? Types of Edges. Edge Detection. Gradient. Edge Detection

PROCESS > SPATIAL FILTERS

Local Image preprocessing (cont d)

Computer Vision for HCI. Topics of This Lecture

Transcription:

CMPUT 206 Introduction to Digital Image Processing

Overview. What is a pixel in an image? 2. How does Photoshop, + human assistance, detect an edge in a picture/photograph? 3. Behind Photoshop - How does the computer do it?

Pixel as the basic unit An image is processed in memory as bytes (8bits/bytes) Grey scale image [0 255] byte pixel Color image [RGB of values 0-255] 3 bytes pixel

0, 0) X Pixel as the basic unit R 80 6 228 234 G 84 8 87 93 B 09 0 59 65 (256, 256)

Definition of Edges What are edges in an image? Locations where there is a sudden variation in the grey or color scale. Which image does not contain edges? a b c d e f g h i

Definition of Edges Use Photoshop Find Edges tool: a b c d e f g h i

Sharpen edges in images Photoshop Demo Sharp Blur High contrast Low contrast Increase contrast and sharpen edges Filter sharper sharpen edges/sharpen more

Sharpen edges in images Photoshop Demo Bright Low luminosity Sharpen and image-adjustcurves Discover features Filter sharper sharpen edges/sharpen more

Region growing + Edge detection The Magic Wand Tool in Photoshop

Can Computer do as well as human? Computer applies edge detection technique based on numeric computation, not based on human perception and cognitive skill

A Simple Edge Detector - gradient Based on grey scale gradient at a pixel g x ( x, y) f ( x+, y) f ( x, y) x g y ( x, y) f ( x, y+ ) f ( x, y ) y 98 98 98 06 0 03 0 6 5 38 60 0 95 68 60 29 0 6 95 65 03 0 6 20 00 3 9 72-35 39-5 5-60 -38-35 -50 78 35 42 56 Assuming threshold T = 50, a pixel is selected if >= T What is 2 2 x g y g + Answer: 7 40 36 87 85 52 44 76

Gradient detection (continued) Red squares represent selected pixels Detected edge 98 98 98 06 0 03 0 6 5 38 60 0 95 68 60 29 0 6 95 65 03 0 6 20 g 2 + 2 x g y = 7 40 36 87 85 52 44 76 Assuming threshold = 50

Gradient detection (continued) The two gradients g x and g y computed at each pixel are regarded as the x and y components of a gradient vector, which has gradient magnitude and direction given by: 2 2 = g x g y = g y θ tan g x g + where the orientation θ is measured relative to x axis. Gradient magnitude is sometimes approximated by: g = g x + g y

Find edges in images Photoshop Demo (Try R, G, B in lab) Extract Intensity values Stylize find edges Apply Edge Detection

Find edges in images Find Edges applying different thresholds T, the results are ferent: - sign value 255 if < T sign value 0 if >= T increasing threshold (Assume Gradient Approach) T T2 T3

Apply edge detection kernels. Suppose a nxn (n is an odd number) kernel is used and the centre position of the kernel is denoted by kc. 2. Slide the kernel across the image, one pixel at a time. 3. Compute the new value of each pixel, which is under kc, and repeat for all pixels in the image. 4. Note that the process is not in-place (new values are stored in a new image of same dimension. 5. Computation: For each pixel inside the kernel, multiply the pixel value with the kernel value. Take the sum of the products. 6. (a) The border pixel can be duplicated, or (b) take the mirror values of the border pixels, to fill up the kernel. C Image border R Image (RxC pixels) Kernel (nxn pixels) 6 (a) 23 23 23 20 8 6 (b) 8 20 23 20 8

Edge detection kernels Noise reduction or elimination Examples of Image pixels 0 0 0 0 99 0 0 0 0 0 0 0 0 0 0 0 0 0 Edge enhancement Concept of filtering An example of Low Pass Filtering: Edge localization 9 An example of High Pass Filtering: 8

Convolution operation Based on convolution operations compute weighted averages over a 3x3 neighborhood ), ( ), ( y x f h y x g x x = ), ( ), ( y x f h y x g y y = where the (Prewitt) kernels are: = 0 0 0 h x = 0 0 0 h y Note: high order convolution kernels ike 5x5, etc. can also be used, but they are more computational expensive

Convolution operation (continued) 0 = 0 h y = 0 0 suming threshold = ±50 0 0 () Is 98 an edge? 98 99 97 99 98 97 99 98 97 (2) What are the detected pixels? 98 98 98 06 0 03 0 6 5 38 60 0 95 68 60 29 0 6 95 65 03 0 6 20 09 93 74 46-4 -8-37 -80-45 -94 0-72 72 68 06 89 (3) What will happen if the threshold is ±00? ±50?

Simple Edge Detectors One edge but thick Result from gradient Result from Prewitt kernels Threshold=±50 Threshold=±00 or ±50

An Example Gradient magnitudes [Reference ] Apply threshold T: If < T, value If >= T, value 2 p Left) Original p Right) Apply gradient magnitudes and scale to 0-255 range tom Left) Apply threshold of 50 op Right tom Right) Apply threshold 50 to Top Right

Scaling grey values onto another range Let O range, O min and O max be the original range, minimum value and maximum value, i.e. O range = O max O min The N range, N min and N max be the original range, minimum value and maximum value, i.e. N range = N max N min To map a pixel P from the original range to P in the new range: P' = P O O min range N range + N min

Advantage of a bigger grey value range before processing Threshold 50 Map from 0-00 To 0-255 Find edges Threshold 28

Sobel kernels Sobel kernels, which give more weights to onaxis pixels h x 0 = 2 0 2 h y = 0 0 2 0 2 0 ross from grey white +ve value (assign pixel value 0 if <0) rom white o grey -ve value Original image convoluation with hx with hy

Noise in an image Problem with edge localization High threshold may suppress meaningful edges Low threshold may include unwanted edges Noise may have high magnitude With noise Without noise x Gradient magnitude Gradient magnitude is very sensitive to noise

Blurred edges The detected edge can be rather broad in the case of diffuse edges, resulting in a thick band of pixels instead of a single point of maximum gradient. Sharp edge Grey values Slightly blurred Heavily blurred x

Sharp & Blurred Edges Grey values 255 Sharp edge Blurred edge

Rank or order statistic filtering Non-linear In image processing it is usually necessary to perform high degree of noise reduction in an image before performing higher-level processing steps, such as edge detection. A non-linear digital filtering technique is often used to remove noise from images or other signals.

Rank or order statistic filtering (continued) Compile a list of grey scales in the neighborhood of a given pixel, sort them in ascending order and select a value as the new value Median filter; any structure that occupies less than half of the filter s neighborhood will be eliminated Minimum filter and Maximum filter Range filter: output the difference between the maximum and minimum

Rank or order statistic filtering (continued) Hybrids of linear and non-linear filters, e.g. α-trimmed mean filter: sorts the neighborhood into ascending order, discards a number of them and outputs the mean of the remaining (α is the number of values removed, in the range [0, (n 2 )/2] from each end of the list) when α = 0: mean filter when α = (n 2 )/2: median filter n 2 2α 2 n α f i i= α+

Median filter Non-linear technique Consider all pixels inside the filter. Compile a list of grey values and sort them in ascending order. select a value as the new value Median filter; any structure that occupies less than half of the filter s neighborhood will be eliminated Have the advantage of non kernel-based; no problem to filter a smaller neighborhood at the corners or sides of the image The shape of the filter applied at the corner can give different results, e.g. square vs. cross-shaped

Rank filtering examples 8 3 23 20 5 2 8 8 0 What is the filtered value of the centre pixel after applying a:. median filter 2 2. mean filter 3 3. maximum filter 23 4. minimum filter 5 5. range filter 8 6. 4-trim filter 2 7. 0-trim filter 3 8. 2-trim filter 2

Median filtering example The square and the cross are both median filters p P (a) (b) What is the filtered value of P in (a)? What is the filtered value of P in (b)?

References. Digital Image Processing a practical introduction using Java Nick Efford, Pearson Education 2000.