Digital Image Processing COSC 6380/4393

Similar documents
Digital Image Processing COSC 6380/4393

Lecture 3 Complex Exponential Signals

Thinking in Frequency

Signals A Preliminary Discussion EE442 Analog & Digital Communication Systems Lecture 2

Frequency Division Multiplexing Spring 2011 Lecture #14. Sinusoids and LTI Systems. Periodic Sequences. x[n] = x[n + N]

Lecture 2: SIGNALS. 1 st semester By: Elham Sunbu

Digital Image Processing. Image Enhancement: Filtering in the Frequency Domain

IMAGE ENHANCEMENT IN SPATIAL DOMAIN

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

Topic 6. The Digital Fourier Transform. (Based, in part, on The Scientist and Engineer's Guide to Digital Signal Processing by Steven Smith)

The Sine Function. Precalculus: Graphs of Sine and Cosine

Lecture 12: Image Processing and 2D Transforms

DFT: Discrete Fourier Transform & Linear Signal Processing

Transforms and Frequency Filtering

Graph of the Sine Function

Introduction to signals and systems

Spectrum Analysis: The FFT Display

G(f ) = g(t) dt. e i2πft. = cos(2πf t) + i sin(2πf t)

Trigonometric Equations

The Discrete Fourier Transform. Claudia Feregrino-Uribe, Alicia Morales-Reyes Original material: Dr. René Cumplido

Lecture 7 Frequency Modulation

2.1 BASIC CONCEPTS Basic Operations on Signals Time Shifting. Figure 2.2 Time shifting of a signal. Time Reversal.

Graphing Sine and Cosine

Laboratory Assignment 4. Fourier Sound Synthesis

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

Discrete Fourier Transform (DFT)

System analysis and signal processing

Algebra and Trig. I. The graph of

A slope of a line is the ratio between the change in a vertical distance (rise) to the change in a horizontal

1. Measure angle in degrees and radians 2. Find coterminal angles 3. Determine the arc length of a circle

Understanding Digital Signal Processing

Signal Characteristics

Lecture #2. EE 313 Linear Systems and Signals

Problem Set 1 (Solutions are due Mon )

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

SECTION I - CHAPTER 2 DIGITAL IMAGING PROCESSING CONCEPTS

Practice Test 3 (longer than the actual test will be) 1. Solve the following inequalities. Give solutions in interval notation. (Expect 1 or 2.

Modulation. Digital Data Transmission. COMP476 Networked Computer Systems. Analog and Digital Signals. Analog and Digital Examples.

Biomedical Signals. Signals and Images in Medicine Dr Nabeel Anwar

New York City College of Technology. Applied Analysis Laboratory CET 3625L-Sec D479 Fall Final Project: Fourier Series

ECE 201: Introduction to Signal Analysis

Copyright 2009 Pearson Education, Inc. Slide Section 8.2 and 8.3-1

Continuous time and Discrete time Signals and Systems

Analog-Digital Interface

Digital Image Processing

10. Introduction and Chapter Objectives

Section 5.2 Graphs of the Sine and Cosine Functions

Basic Signals and Systems

Linear Time-Invariant Systems

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

Digital Video and Audio Processing. Winter term 2002/ 2003 Computer-based exercises

Wavelet Transform. From C. Valens article, A Really Friendly Guide to Wavelets, 1999

Midterm 1. Total. Name of Student on Your Left: Name of Student on Your Right: EE 20N: Structure and Interpretation of Signals and Systems

Chapter 6: Periodic Functions

Midterm Review. Image Processing CSE 166 Lecture 10

Frequency-Domain Sharing and Fourier Series

DISCRETE FOURIER TRANSFORM AND FILTER DESIGN

Introduction. Chapter Time-Varying Signals

Multirate Digital Signal Processing

6.02 Practice Problems: Modulation & Demodulation

5.3 Trigonometric Graphs. Copyright Cengage Learning. All rights reserved.

Section 7.6 Graphs of the Sine and Cosine Functions

CSC475 Music Information Retrieval

TDI2131 Digital Image Processing

Fourier and Wavelets

Multirate Signal Processing Lecture 7, Sampling Gerald Schuller, TU Ilmenau

ME 365 EXPERIMENT 8 FREQUENCY ANALYSIS

Reference Manual SPECTRUM. Signal Processing for Experimental Chemistry Teaching and Research / University of Maryland

Sinusoids and Phasors (Chapter 9 - Lecture #1) Dr. Shahrel A. Suandi Room 2.20, PPKEE

5.3-The Graphs of the Sine and Cosine Functions

Analysis and design of filters for differentiation

Frequency Domain Enhancement

Connected Mathematics 2, 6th Grade Units (c) 2006 Correlated to: Utah Core Curriculum for Math (Grade 6)

Lecture 3 Digital image processing.

SAMPLING THEORY. Representing continuous signals with discrete numbers

Discrete Fourier Transform

Interference in stimuli employed to assess masking by substitution. Bernt Christian Skottun. Ullevaalsalleen 4C Oslo. Norway

Signals and Systems EE235. Leo Lam

Communication Engineering Prof. Surendra Prasad Department of Electrical Engineering Indian Institute of Technology, Delhi

Image Enhancement in Spatial Domain

Communication Engineering Prof. Surendra Prasad Department of Electrical Engineering Indian Institute of Technology, Delhi

Introduction to Digital Signal Processing (Discrete-time Signal Processing)

ECE 201: Introduction to Signal Analysis. Dr. B.-P. Paris Dept. Electrical and Comp. Engineering George Mason University

Image Filtering. Median Filtering

CS4495/6495 Introduction to Computer Vision. 2C-L3 Aliasing

Lecture 17 z-transforms 2

Lab 9 Fourier Synthesis and Analysis

Chapter Three. The Discrete Fourier Transform

Sampling and Signal Processing

Trigonometric identities

Chapter 3 Data Transmission COSC 3213 Summer 2003

ECE 201: Introduction to Signal Analysis

Chapter 3, Part 4: Intro to the Trigonometric Functions

MA10103: Foundation Mathematics I. Lecture Notes Week 3

Signal Processing. Naureen Ghani. December 9, 2017

LOCAL MULTISCALE FREQUENCY AND BANDWIDTH ESTIMATION. Hans Knutsson Carl-Fredrik Westin Gösta Granlund

The quality of the transmission signal The characteristics of the transmission medium. Some type of transmission medium is required for transmission:

4.4 Graphs of Sine and Cosine: Sinusoids

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

2.4 Translating Sine and Cosine Functions

Transcription:

Digital Image Processing COSC 638/4393 Lecture 9 Sept 26 th, 217 Pranav Mantini Slides from Dr. Shishir K Shah and Frank (Qingzhong) Liu, S. Narasimhan

HISTOGRAM SHAPING We now describe methods for histogram shaping. Accomplished by point operations: object shape and location are unchanged. 2

EXAMPLE Given a 4 x 4 image I with gray-level range {,..., 15} (K-1 = 15): It's histogram is 3

EXAMPLE The normalized histogram is k 1 2 3 4 5 6 7 8 9 1 11 12 13 14 15 3 16 3 16 3 16 2 16 2 16 p(k) From which we can compute the intermediate image J1 and finally the "flattened" image J: 2 16 1 16 4

EXAMPLE The new, flattened histogram looks like this: The heights H(k) cannot be reduced, just moved - or stacked, so: Digital histogram flattening doesn't really "flatten" the histogram - it just makes it "flatter" by spreading out the histogram. The spaces that appear are highly characteristic of a "flattened" histogram - especially when the original histogram is highly compressed. 5

Histogram Shaping Consider the same image as in the last example. We had Fit this to the following (triangular) histogram: 6

EXAMPLE Here's the cumulative (summed) probabilities associated with it: n 1 2 3 4 5 6 7 8 9 1 11 12 13 14 15 P (n) J 1 16 1 16 3 16 3 16 6 16 6 16 1 16 1 16 13 16 13 16 15 16 15 16 16 16 16 16 Careful visual inspection of J 1 let's us form the new image: 7

EXAMPLE Here's the new histogram: 8

BASIC ALGEBRAIC IMAGE OPERATIONS Algebraic image operations (between images) are quite simple Suppose we have two N x N images I 1 and I 2. The four basic algebraic operations (like the ones on your calculator) are: Pointwise Matrix Addition J = I 1 + I 2 if J(i, j) = I 1 (i, j) + I 2 (i, j) for <= i, j <= N-1 Pointwise Matrix Subtraction J = I 1 - I 2 if J(i, j) = I 1 (i, j) - I 2 (i, j) for <= i, j <= N-1 Pointwise Matrix Multiplication J = I 1.* I 2 if J(i, j) = I 1 (i, j) x I 2 (i, j) for <= i, j <= N-1 Pointwise Matrix Division J = I 1./ I 2 if J(i, j) = I 1 (i, j) / I 2 (i, j) for <= i, j <= N-1 9

Frame Averaging However, since I 1 = I 2 = = I M = I, then and from before Hence we can expect that J ~= I + ~= I if enough frames (M) are averaged together 1

Motion Detection Often it is of interest to detect object motion between frames Applications: video compression, target recognition and tracking, security cameras, surveillance, automated inspection, etc. Here is a simple approach: Let I 1, I 2 be consecutive frames taken in close time proximity, e.g., from a video camera Form the absolute difference image J = I 1 - I 2 Applying a full-scale contrast stretch to J will give a more visually dramatic result 11

The Basic Geometric Transformations The most basic geometric transformations are - Translation - Rotation - Zooming Translation Translation is the simplest geometric operation and requires no interpolation Let a(i, j) = i - i, b(i, j) = j - j where (i, j ) are constants In this case J(i, j) = I(i - i, j - j ); a shift or translation of the image by an amount i in the vertical (row) direction and an amount j in the horizontal direction 12

Frequency domain analysis and Periodic Function Fourier Transform What are the frequencies in the function? Is a certain frequency more common or dominant than other????

Jean Baptiste Joseph Fourier (1768-183) Had crazy idea (187): Any periodic function can be rewritten as a weighted sum of Sines and Cosines of different frequencies. Don t believe it? Neither did Lagrange, Laplace, Poisson and other big wigs Not translated into English until 1878! But it s true! called Fourier Series Possibly the greatest tool used in Engineering

Time and Frequency example : g(t) = sin( f t) + (1/3)sin( (3f) t)

Time and Frequency example : g(t) = sin(2pi f t) + (1/3)sin(2pi (3f) t) = +

Frequency Spectra example : g(t) = sin(2pi f t) + (1/3)sin(2pi (3f) t) = +

Periodic Function 4π 6π Sum of sine and cosine waves:

Periodic Function 4π 6π Sum of sine and cosine waves: f t = a + a 1 cos t + a 2 cos 2t + b 1 sin t + b 2 sin 2t +

Recap න sin mt dt=? cos mt dt=? sin mt cos nt dt =? sin mt sin nt dt =? ( m! = n) sin mt sin nt dt =? (m = n) cos mt cos nt dt =? ( m! = n) cos mt cos nt dt =? (m = n)

Recap sin mt dt= cos mt dt= න sin mt cos nt dt = sin mt sin nt dt =? ( m! = n) sin mt sin nt dt =? (m = n) cos mt cos nt dt =? ( m! = n) cos mt cos nt dt =? (m = n)

Recap sin mt dt= cos mt dt= න sin mt cos nt dt = න sin mt sin nt dt = m! = n න sin mt sin nt dt = π (m = n) න cos mt cos nt dt = ( m! = n) න cos mt cos nt dt = π(m = n)

Periodic Function 4π 6π Sum of sine and cosine waves: f t = a + a 1 cos t + a 2 cos 2t + b 1 sin t + b 2 sin 2t +

Periodic Function Sum of sine and cosine waves: න f(t)dt = න න a dt 4π 6π + න b 1 sin(t)dt a 1 cos t dt + න + න b 2 sin(2t)dt a 2 cos 2t dt + +

Periodic Function Sum of sine and cosine waves: න 4π 6π f(t)dt = න a dt = a a = 1 f(t)dt

Periodic Function 4π 6π Sum of sine and cosine waves: f t cos(nt) = a cos(nt) + a 1 cos t cos(nt) + a 2 cos 2t cos(nt) + b 1 sin t cos(nt) + b 2 sin 2t cos(nt) +

Periodic Function Sum of sine and cosine waves: න = න f t cos nt dt a cos nt dt + න න 4π 6π a 1 cos t cos nt dt + න b 1 sin t cos nt dt + න a 2 cos 2t cos nt dt + b 2 sin 2t cos nt dt +

Periodic Function Sum of sine and cosine waves: න = න + න න f t cos nt dt a cos nt dt + න 4π 6π a 2 cos 2t cos nt dt + න b 1 sin t cos nt dt + න a 1 cos t cos nt dt a n cos nt cos nt dt + b 2 sin 2t cos nt dt +

Periodic Function 4π 6π Sum of sine and cosine waves: න f t cos nt dt = a n = 1 π න න a n cos nt cos nt dt f t cos nt dt Similarly, b n = 1 π න f t sin nt dt

Periodic Function 4π 6π Sum of sine and cosine waves: a = 1 න a n = 1 π න f(t)dt f t cos nt dt b n = 1 π න f t sin nt dt

Periodic Function Sum of sine and cosine waves: b n = 1 π a = 1 a n = 1 π 4π 6π f(t)dt = 1/2 f t cos nt dt = if n is even f t sin nt dt = 2 if n is odd nπ

Frequency Spectra

Frequency Spectra = + =

Frequency Spectra = + =

Frequency Spectra = + =

Frequency Spectra = + =

Frequency Spectra = + =

Frequency Spectra = A k 1 1 sin(2 kt ) k

Complex number trick For every frequency n, there are two components a n andb n (cos component and sine component) Represented using complex numbers. A F( ) R( ) ii ( ) R I 2 2 ( ) ( ) tan 1 I( ) R( )

Fourier Transform We want to understand the frequency u of our signal. So, let s reparametrize the signal by n instead of x: f(x) Fourier Transform F(u) Represent the signal as an infinite weighted sum of an infinite number of sinusoids F u = න e ik f x = න cos k cos ux dx j න f x isin k Spatial Domain (x) f x cos ux j sin ux dx i 1 sin ux dx Note: F u f x iux dx Frequency Domain (u) (Frequency Spectrum F(u)) e

Inverse Fourier Transform (IFT) Frequency Domain (u) Spatial Domain (x) f x 1 2 F u e iux dx

Sinusoidal Images We shall make frequent discussion in this module of the frequency content of an image. First consider images having the simplest frequency content. A digital sine image I is an image having elements and a digital cosine image has elements where u and v are integer frequencies in the i- and j- directions (measured in cycles/image; notice division by N). 43

Sinusoidal Images sin(i + j) sin(i +.5j) sin(.5i +.5j) Waveform Contour plots From Wolframalpha

Sinusoidal Images sin(i + j) sin(i +.5j) sin(.5i +.5j) Waveform Contour plots From Wolframalpha

Sinusoidal Images sin(i + j) sin(i +.5j) sin(.5i +.5j) Waveform Contour plots From Wolframalpha

Sinusoidal Images sin(i + j) sin(i +.5j) sin(.5i +.5j) Waveform Contour plots From Wolframalpha

Sinusoidal Images The radial frequency (how fast the image oscillates in its direction of propagation) is The angle of the wave (relative to the i-axis) is 48

Complex Exponential Images We will need to use complex exponential functions to later define the Fourier Transform of a digital image. We define the 2-D complex exponential function to be The complex exponential allows convenient representation and manipulation of frequencies, as we will see. 49

Complex Numbers Review of Notation A number of the form X = A + B is a complex number. Complex numbers have a magnitude and a phase -1 Complex numbers conveniently represent magnitude and phase: The complex conjugate of X is: X* = A - -1 B Observe that 5

Properties of Complex Exponential We will use the abbreviation for the complex exponential image, where N = size of the image. Hence the complex exponential From Euler's identity: 51

Properties of Complex Exponential Indexing the powers of the component sinusoids. (ui vj) W + N indexes the frequencies of 52

Magnitude and Phase of Complex Exponential The magnitude and phase of (ui vj) W + N Comments It is possible to develop Fourier transform (frequency domain) concepts without complex numbers - but the mathematics becomes much lengthier. (ui vj) Using W + N to represent a frequency component oscillating at u (cy/im) and v (cy/im) in the i- and j-directions simplifies things considerably. (ui vj) Thus, it is useful to think of W + N in that way: a representation of a direction and frequency of oscillation. 53

Values of Complex Exponential The complex exponential is a representation of frequency indexed by exponent ui. The minimum physical frequency periodically occurs at index u = kn (including u = ): The maximum physical frequency periodically occurs at index u = kn + N/2 (N is even): This will be important when we consider the meaning of the Fourier Transform. 54

Discrete Fourier Transform Abbreviated as DFT. Discrete Fourier Expansion of an Image Any N x N image I can be expressed as the weighted sum of a finite number of complex exponential images: A unique representation of an image as a finite weighted sum of complex exponentials of different frequencies. The weights are unique. Given only the elements (the DFT coefficients) one can compute I(i, j) from them. Remember that (i, j) are space coordinates while (u, v) are frequency coordinates. We can obtain the DFT coefficients from I: 55