Prof. Vidya Manian Dept. of Electrical and Comptuer Engineering

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

Digital Image Processing

Filtering in the spatial domain (Spatial Filtering)

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

Image Enhancement in the Spatial Domain (Part 1)

Digital Image Processing

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

Image Enhancement using Histogram Equalization and Spatial Filtering

TDI2131 Digital Image Processing

IMAGE ENHANCEMENT IN SPATIAL DOMAIN

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

Non Linear Image Enhancement

What is image enhancement? Point operation

Digital Image Processing. Lecture # 3 Image Enhancement

Computer Vision. Intensity transformations

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

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

Image Enhancement in Spatial Domain

Practical Image and Video Processing Using MATLAB

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

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

To process an image so that the result is more suitable than the original image for a specific application.

EE482: Digital Signal Processing Applications

Spatial Domain Processing and Image Enhancement

Digital Image Processing Chapter 3: Image Enhancement in the Spatial Domain

IMAGE PROCESSING: AREA OPERATIONS (FILTERING)

Computer Graphics Fundamentals

Enhancement Techniques for True Color Images in Spatial Domain

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

Digital Image Processing

Image Filtering. Median Filtering

Image Enhancement in the Spatial Domain

Frequency Domain Enhancement

VU Signal and Image Processing. Image Enhancement. Torsten Möller + Hrvoje Bogunović + Raphael Sahann

Midterm Review. Image Processing CSE 166 Lecture 10

Chapter 2 Image Enhancement in the Spatial Domain

INSTITUTE OF AERONAUTICAL ENGINEERING Dundigal, Hyderabad

Computer Vision, Lecture 3

Digital Image Processing Chapter 6: Color Image Processing ( )

CS 445 HW#2 Solutions

DIGITAL IMAGE DE-NOISING FILTERS A COMPREHENSIVE STUDY

Image Processing. 2. Point Processes. Computer Engineering, Sejong University Dongil Han. Spatial domain processing

Introduction to DSP ECE-S352 Fall Quarter 2000 Matlab Project 1

Image preprocessing in spatial domain

CSE 564: Scientific Visualization

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

Prof. Feng Liu. Winter /10/2019

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

from: Point Operations (Single Operands)

Lecture 4: Spatial Domain Processing and Image Enhancement

IMAGE ENHANCEMENT - POINT PROCESSING

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

Image Filtering. Reading Today s Lecture. Reading for Next Time. What would be the result? Some Questions from Last Lecture

Step 5) Split the red data using the Multi Scale Decomposition tool into a detail and residual background image.

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

Digital Image Processing

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

Image filtering, image operations. Jana Kosecka

Images and Filters. EE/CSE 576 Linda Shapiro

Lecture No Image Filtering (course: Computer Vision)

Filtering. Image Enhancement Spatial and Frequency Based

Fourier Transform. Any signal can be expressed as a linear combination of a bunch of sine gratings of different frequency Amplitude Phase

SYLLABUS CHAPTER - 2 : INTENSITY TRANSFORMATIONS. Some Basic Intensity Transformation Functions, Histogram Processing.

Chapter 17. Shape-Based Operations

CS/ECE 545 (Digital Image Processing) Midterm Review

Examples of image processing

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

Filip Malmberg 1TD396 fall 2018 Today s lecture

ECC419 IMAGE PROCESSING

TIRF, geometric operators

Image Processing for feature extraction

DIGITAL IMAGE PROCESSING Quiz exercises preparation for the midterm exam

Digital Image Processing

BBM 413! Fundamentals of! Image Processing!

Vision Review: Image Processing. Course web page:

BBM 413 Fundamentals of Image Processing. Erkut Erdem Dept. of Computer Engineering Hacettepe University. Point Operations Histogram Processing

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

BBM 413 Fundamentals of Image Processing. Erkut Erdem Dept. of Computer Engineering Hacettepe University. Point Operations Histogram Processing

Computing for Engineers in Python

GE 113 REMOTE SENSING. Topic 7. Image Enhancement

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

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

Image Processing. Chapter(3) Part 2:Intensity Transformation and spatial filters. Prepared by: Hanan Hardan. Hanan Hardan 1

Design of Various Image Enhancement Techniques - A Critical Review

DIGITAL IMAGE PROCESSING ASSIGNMENT

Image Enhancement. Image Enhancement

Image Processing COS 426

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

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

Image restoration and color image processing

June 30 th, 2008 Lesson notes taken from professor Hongmei Zhu class.

More image filtering , , Computational Photography Fall 2017, Lecture 4

Lecture Topic: Image, Imaging, Image Capturing

Image Processing Lecture 4

PRACTICAL IMAGE AND VIDEO PROCESSING USING MATLAB

Midterm Examination CS 534: Computational Photography

Transforms and Frequency Filtering

Digital Image Fundamentals and Image Enhancement in the Spatial Domain

Digital Image Processing 3/e

IMAGE PROCESSING: POINT PROCESSES

Transcription:

Image Processing Intensity Transformations Chapter 3 Prof. Vidya Manian Dept. of Electrical and Comptuer Engineering INEL 5327 ECE, UPRM Intensity Transformations 1

Overview Background Basic intensity transformation functions Histogram processing INEL 5327 ECE, UPRM 2

3x3 neighborhood of a point (x,y) INEL 5327 ECE, UPRM 3

Intensity or gray level or mapping S=T(r) transformation function Resulting image has higher contrast by darkening the intensity levels below k and brightening the levels above k Contrast stretching values of r lower than k are compressed by the transformation function into a narrow range of s, toward black, vice versa for values of r higher than k INEL 5327 ECE, UPRM 4

Contrast stretching and thresholding functions INEL 5327 ECE, UPRM 5

Thresholding function T(r) produces a two level (binary) image limiting case Intensity transformations are used for image enhancement Also for image segmentation Two types: point processing and neighborhood processing INEL 5327 ECE, UPRM 6

S=T(r) Basic intensity transformation functions Mapping from r to s are implemented via a lookup table For 8 bits, lookup table has 256 entries. Types of functions: linear (negative and identity transformations) Power law (nth power and nth root transformations) INEL 5327 ECE, UPRM 7

Basic intensity transformation functions INEL 5327 ECE, UPRM 8

Image negatives Negative transformation s=l 1 r Log transformation: s=c log (1+r) c is a constant, r 0 Maps range of low intensity values in the input to wider range of output levels Expands dark pixels in an image and compresses the higher level values (white pixels) Usefulfor for Fourier spectrum: spectra values range from 0 to 10^6 or higher. Detail lost in the display of Fourier spectrum INEL 5327 ECE, UPRM 9

Original image and negative image obtained using the negative transormation INEL 5327 ECE, UPRM 10

Fourier spectrum and log transformation INEL 5327 ECE, UPRM 11

Fourier spectrum with values in range of 0 to 1.5 x 10^6 (Fig. 3.5 a) only few pixels are white. First use log transformation with c=1, range of values become 0 to 6.2 62 Fig 3.5b has better scaling and shows more detail. INEL 5327 ECE, UPRM 12

Power law (Gamma) transformations s=cr Where c and are positive constants. s=c(r+ ) to account for an offset due to display calibration power law curves with fractional values of map a narrow range of dark input values to a wider range of output tvalues, and opposite for higher h values of input levels >1 has opposite effect of <1. Also called Gamma correction Device dependent, CRT displays, image capture, printing INEL 5327 ECE, UPRM 13

INEL 5327 ECE, UPRM 14

Preprocess image before input to monitor by s=r^(1/2.5)=r^(0.4) Gamma corrected output has appearance close to original Applicable to scanners, printers Use of digital images for commercial purpose over Internet has increased Solution display image after gamma correction to value that represents average of the types of monitors and computer systems to be used to display the image. INEL 5327 ECE, UPRM 15

INEL 5327 ECE, UPRM 16

INEL 5327 ECE, UPRM 17

Contrast stretching INEL 5327 ECE, UPRM 18

INEL 5327 ECE, UPRM 19

INEL 5327 ECE, UPRM 20

Bit plane representation of an 8 bit image INEL 5327 ECE, UPRM 21

INEL 5327 ECE, UPRM 22

INEL 5327 ECE, UPRM 23

Four basic image types INEL 5327 ECE, UPRM 24

Histogram equalization INEL 5327 ECE, UPRM 25

Transformation functions for Histogram equalization in Fig. 3. 20 INEL 5327 ECE, UPRM 26

Example of histogram equalization INEL 5327 ECE, UPRM 27

Histogram INEL 5327 ECE, UPRM 28

Histogram equalized image INEL 5327 ECE, UPRM 29

Specified Histogram INEL 5327 ECE, UPRM 30

Steps for Histogram Matching Obtain Pr(r) from input image and obtain values of s Use specified pdf to obtain the transformation function G(z) Obtain the inverse transformation z=g 1 (s); (); mapping from s to z Obtain output image by first equalizing input image. For each pixel with value s, perform inverse mapping z=g 1 (s) to obtain corresponding output pixel When all pixels are processed the pdf of output image is equal to specified pdf INEL 5327 ECE, UPRM 31

Local Histogram equalization INEL 5327 ECE, UPRM 32

Global and local histogram equalization INEL 5327 ECE, UPRM 33

Fundamentals of spatial filtering Filter: accepting(passing) or rejecting certain frequency components Spatial filter consists of (1) a neighborhood (a small rectangle) and (2) predefined operation performed on the image pixels encompassed by the neighborhood Linear and non linear filters INEL 5327 ECE, UPRM 34

Basics of Spatial Filtering Neighborhood subimage filter, mask, kernel, template, or window Values in mask coefficients Response R of linear filtering with the filter mask at a point (x,y) in the image is: R=w( 1, 1)f(x 1,y 1)+w( 1,0)f(x 1,y)+ +w(0,0)f(x,y)+ +w(1,0)f(x+1,y)+w(1,1)f(x+1,y+ 0)f(x +w(1 0)f(x+1 y)+w(1 1)f(x+1 y+ 1) INEL 5327 ECE, UPRM 35

Mechanics of spatial filtering W(0,0) 0) center coefficient of the filter Mask of size mxm, m=2a+1 and n=2b+1, where a and b are positive integers Smallest size 3x3 INEL 5327 ECE, UPRM 36

Spatial correlation and convolution Correlation o is the epocesso process of moving ga filter mask over the image and computing the sum of products at each location. Convolution is the same except that the filter is rotated by 180 degrees. Rotation is equivalent to horizontal flipping In 2Drotation is equivalent to flipping the mask along one axis and then the other Fig. 3.29 shows 1 D convolution and correlation INEL 5327 ECE, UPRM 38

INEL 5327 ECE, UPRM 39

Correlation and convolution INEL 5327 ECE, UPRM 40

Smoothing spatial filters

Smoothing linear filters An mxn mask would have a normalizing constant equal to 1/mn. A spatial averaging filter in which all coefficients are equal is called a box filter The diagonal terms are further away from center and hence are weighted less than the immediate neighbors Sum of coefficients =16 is useful for easy computer implementation ( a power of 2) INEL 5327 ECE, UPRM 42

Effect of smoothing as a function of fl filter size Average filters of sizes m=3,5,9,15 and 35 pixels Larger size windows for blurring removes smaller objects from image A gross representation of objects of interest is obtained Intensity of smaller objects blends with background and larger objects become bloblike INEL 5327 ECE, UPRM 43

INEL 5327 ECE, UPRM 44

Order statistics (nonlinear) filters Response of nonlinear filters based on ordering(ranking) the pixels contained in the image area encompassed by the filter Median filter to remove impulse noise (salt and pepper noise) Sort the pixel values in the window (say 3x3 ) and assign the median value to the center pixel Forces pixels with distinct intensity levels to be more like its neighbors ihb Max, min filters INEL 5327 ECE, UPRM 45

Image filtered with a 15x15 averaging mask INEL 5327 ECE, UPRM 46

INEL 5327 ECE, UPRM 47

Sharpening spatial filters Highlights transition in intensities Blurring by pixel averaging Sharpening by spatial ildifferentiationi i Enhances edges and other discontinuities such as noise Based on first and second order derivatives INEL 5327 ECE, UPRM 48

First and second derivatives of a 1D signal INEL 5327 ECE, UPRM 49

Sharpening spatial filters f f f( x 1) f( x) x 2 f f ( x 1) f( x 1) 2 f( x) 2 x x Change between adjacent pixels First and second derivative (1) Must be zero in flat areas; (2) Non zero at the onset of gray level step or ramp (3) First derivative non zero along ramps; second derivative Zero along ramps of cnstant slope INEL 5327 ECE, UPRM 50

The Laplacian for enhancement (the second derivative) i f x f y 2 2 2 f 2 2 In the x direction 2 f f( x 1, y) f( x 1, y) 2 f( x, y) 2 x In the y direction 2 f f( x, y 1) f( x, y 1) 2 f( x, y) 2 x Sum min g f [ f( x, y 1) f( x, y 1) f( x 1, y) f( x 1, y)] 4 f( x, y) 2 INEL 5327 ECE, UPRM 51

INEL 5327 ECE, UPRM 52

Second derivative the the Laplacian INEL 5327 ECE, UPRM 53

Blurring using Gaussian filter INEL 5327 ECE, UPRM 54

INEL 5327 ECE, UPRM 55

The Gradient for enhancement (the first derivative) i f Gx x f G y f y f mag ( f ) [ G G ] 2 2 1/2 x y 2 f f x y 2 1/2 f ( z 2 z z ) ( z 2 z z ) ( z 2 z z ) ( z 2 z z ) 7 8 9 1 1 3 3 6 9 1 4 7 INEL 5327 ECE, UPRM 56

INEL 5327 ECE, UPRM 57

Composite Laplacian mask

Sobel gradient INEL 5327 ECE, UPRM 59

INEL 5327 ECE, UPRM 60

INEL 5327 ECE, UPRM 61

Exercise in group Propose a set of intensity slicing slicing transformations capable of producing all the individual bit planes of an 8bit monochrome image. T(r)=0 in range [0,127] and T(r)=255 for r in range [128,255] produces an image of the 8 th bit plane in an 8 bit image. Given the Gaussian pdf what is the transformation function you would use for histogram equalization. INEL 5327 ECE, UPRM 62

Exercises on spatial filtering 313234 3.1,3.2,3.4, 35 3.5, 36 3.6, 37 3.7, 38to 3.8 311 3.11, 3.13 313 3.15, 3.17, 3.19, 3.21, 3.23, 3.24, 3.25, 3.27, 3.28, 3.29 INEL 5327 ECE, UPRM 63

31)Givea 3.1)Give single intensity transformation function for spreading the intensities of an image so the lowest intensity is 0 and highest is L 1. 35)What 3.5) effect would setting to zero the lower order bit planes have on the histogram of an image in general. INEL 5327 ECE, UPRM 64

3.6) 6)Explain why discrete histogram equalization does not in general yield a flat histogram. Answer: To get a flat histogram, pixel intensities should be redistributed so that there are L groups of n/l pixels with same intensity and n=mn. INEL 5327 ECE, UPRM 65

37)Suppose 3.7) that a digital image is subjected to histogram equalization. Show that a second pass of histogram equalization (on the histogram equalized image) will produce exactly the same result as the first pass. INEL 5327 ECE, UPRM 66