Image Processing COS 426

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

Image Processing. Image Processing. What is an Image? Image Resolution. Overview. Sources of Error. Filtering Blur Detect edges

קורס גרפיקה ממוחשבת 2008 סמסטר ב' Image Processing 1 חלק מהשקפים מעובדים משקפים של פרדו דוראנד, טומס פנקהאוסר ודניאל כהן-אור

Image Processing. What is an image? קורס גרפיקה ממוחשבת 2008 סמסטר ב' Converting to digital form. Sampling and Reconstruction.

Image Processing. Michael Kazhdan ( /657) HB Ch FvDFH Ch. 13.1

Human Vision, Color and Basic Image Processing

Prof. Feng Liu. Fall /04/2018

Graphics and Image Processing Basics

Image Processing. Adrien Treuille

Lecture 2: Digital Image Fundamentals -- Sampling & Quantization

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

Digital Image Processing

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

IMAGES AND COLOR. N. C. State University. CSC557 Multimedia Computing and Networking. Fall Lecture # 10

Sampling and Reconstruction. Today: Color Theory. Color Theory COMP575

IMAGE PROCESSING: AREA OPERATIONS (FILTERING)

Image Processing for feature extraction

Image Filtering. Median Filtering

Image Enhancement contd. An example of low pass filters is:

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

Image processing. Image formation. Brightness images. Pre-digitization image. Subhransu Maji. CMPSCI 670: Computer Vision. September 22, 2016

Prof. Vidya Manian Dept. of Electrical and Comptuer Engineering

Image Capture and Problems

Filtering. Image Enhancement Spatial and Frequency Based

Images and Displays. CS4620 Lecture 15

Digital Imaging and Multimedia Point Operations in Digital Images. Ahmed Elgammal Dept. of Computer Science Rutgers University

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

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

ENEE408G Multimedia Signal Processing

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

Image and Video Processing

Image Manipulation: Filters and Convolutions

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

Study guide for Graduate Computer Vision

Understand brightness, intensity, eye characteristics, and gamma correction, halftone technology, Understand general usage of color

Problems. How do cameras measure light and color? How do humans perceive light and color?

Image Enhancement in the Spatial Domain

Images and Displays. Lecture Steve Marschner 1

CSE 564: Scientific Visualization

Computer Graphics Fundamentals

BBM 413! Fundamentals of! Image Processing!

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

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

Vision Review: Image Processing. Course web page:

EE482: Digital Signal Processing Applications

Antialiasing and Related Issues

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

What is an image? Bernd Girod: EE368 Digital Image Processing Pixel Operations no. 1. A digital image can be written as a matrix

Multimedia Systems Image II (Image Enhancement) Mahdi Amiri April 2012 Sharif University of Technology

What is an image? Images and Displays. Representative display technologies. An image is:

Realistic Image Synthesis

Image Filtering Josef Pelikán & Alexander Wilkie CGG MFF UK Praha

ENGG1015 Digital Images

Camera Post-Processing Pipeline

Computer Graphics. Si Lu. Fall er_graphics.htm 10/02/2015

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

Spatial Domain Processing and Image Enhancement

Last Lecture. photomatix.com

Image Processing (EA C443)

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

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

Images and Filters. EE/CSE 576 Linda Shapiro

Computer and Machine Vision

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

Mahdi Amiri. March Sharif University of Technology

Acquisition and representation of images

Image Formation and Capture. Acknowledgment: some figures by B. Curless, E. Hecht, W.J. Smith, B.K.P. Horn, and A. Theuwissen

Camera Image Processing Pipeline: Part II

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

High dynamic range and tone mapping Advanced Graphics

Acquisition and representation of images

Midterm Examination CS 534: Computational Photography

image Scanner, digital camera, media, brushes,

Monochrome Image Reproduction

Digital Image Fundamentals and Image Enhancement in the Spatial Domain

Last Lecture. photomatix.com

Enhancement Techniques for True Color Images in Spatial Domain

Image Formation and Capture

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

OFFSET AND NOISE COMPENSATION

Chapter 2: Digital Image Fundamentals. Digital image processing is based on. Mathematical and probabilistic models Human intuition and analysis

Methods for Generating Blue-Noise Dither Matrices for Digital Halftoning

Digital Halftoning. Sasan Gooran. PhD Course May 2013

Image Distortion Maps 1

Digital Images. Back to top-level. Digital Images. Back to top-level Representing Images. Dr. Hayden Kwok-Hay So ENGG st semester, 2010

Filters. Materials from Prof. Klaus Mueller

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

PRACTICAL IMAGE AND VIDEO PROCESSING USING MATLAB

ABSTRACT. Keywords: Color image differences, image appearance, image quality, vision modeling 1. INTRODUCTION

Computer Graphics (Fall 2011) Outline. CS 184 Guest Lecture: Sampling and Reconstruction Ravi Ramamoorthi

Image filtering, image operations. Jana Kosecka

Image Processing: An Overview

Understanding Matrices to Perform Basic Image Processing on Digital Images

Error Diffusion and Delta-Sigma Modulation for Digital Image Halftoning

Images. CS 4620 Lecture Kavita Bala w/ prior instructor Steve Marschner. Cornell CS4620 Fall 2015 Lecture 38

ECC419 IMAGE PROCESSING

Color Image Processing

LECTURE III: COLOR IN IMAGE & VIDEO DR. OUIEM BCHIR

Camera Image Processing Pipeline: Part II

Overview. Neighborhood Filters. Dithering

Transcription:

Image Processing COS 426

What is a Digital Image? A digital image is a discrete array of samples representing a continuous 2D function Continuous function Discrete samples

Limitations on Digital Images Spatial discretization Quantized intensity Approximate color (RGB) (Temporally discretized frames for digital video)

Image Processing Changing intensity/color Linear: scale, offset, etc. Nonlinear: gamma, saturation, etc. Add random noise Filtering over neighborhoods Blur Detect edges Sharpen Emboss Median Moving image locations Scale Rotate Warp Combining images Composite Morph

Similar to Analog / Continuous Changing intensity/color Linear: scale, offset, etc. Nonlinear: gamma, saturation, etc. Add random noise Filtering over neighborhoods Blur Detect edges Sharpen Emboss Median Moving image locations Scale Rotate Warp Combining images Composite Morph

Account for Limitations of Digital Changing intensity/color Linear: scale, offset, etc. Nonlinear: gamma, saturation, etc. Add random noise Filtering over neighborhoods Blur Detect edges Sharpen Emboss Median Moving image locations Scale Rotate Warp Combining images Composite Morph

Inherently New Digital Operations Changing intensity/color Linear: scale, offset, etc. Nonlinear: gamma, saturation, etc. Add random noise Filtering over neighborhoods Blur Detect edges Sharpen Emboss Median Moving image locations Scale Rotate Warp Combining images Composite Morph Quantization Spatial / intensity tradeoff Dithering

Digital Image Processing Changing intensity/color Linear: scale, offset, etc. Nonlinear: gamma, saturation, etc. Add random noise Filtering over neighborhoods Blur Detect edges Sharpen Emboss Median Moving image locations Scale Rotate Warp Combining images Composite Morph Quantization Spatial / intensity tradeoff Dithering

Adjusting Brightness Simply scale pixel components o Must clamp to range, e.g. [0..1] or [0..255] Original Brighter Note: this is contrast on your monitor! Brightness adjusts black level (offset)

Adjusting Contrast Compute mean luminance L for all pixels o luminance = 0.30*r + 0.59*g + 0.11*b Scale deviation from L for each pixel component o Must clamp to range (e.g., 0 to 1) L Original More Contrast

Digression: Perception of Intensity Perception of intensity is nonlinear Perceived brightness Amount of light

Modeling Nonlinear Intensity Response Brightness (B) usually modeled as a logarithm or power law of intensity (I) B B = = k I log 1/3 Exact curve varies with ambient light, adaptation of eye I B I

Cameras Original cameras based on Vidicon obey power law for Voltage (V) vs. Intensity (I): V = I γ γ 0.45

CRT Response Power law for Intensity (I) vs. applied voltage (V) I = V γ γ 2.5 Vidicon + CRT = almost linear! Other displays (e.g. LCDs) contain electronics to emulate this law

CCD Cameras Camera gamma codified in NTSC standard CCDs have linear response to incident light Electronics to apply required power law So, pictures from most cameras (including digital still cameras) will have γ = 0.45 srgb standard: partly-linear, partly power-law curve well approximated by γ = 1 / 2.2

Digital Image Processing Changing intensity/color Linear: scale, offset, etc. Nonlinear: gamma, saturation, etc. Add random noise Filtering over neighborhoods Blur Detect edges Sharpen Emboss Median Moving image locations Scale Rotate Warp Combining images Composite Morph Quantization Spatial / intensity tradeoff Dithering

Basic Operation: Convolution Output value is weighted sum of values in neighborhood of input image Pattern of weights is the filter or kernel Filter Input Output

Convolution with a Triangle Filter 0.25 0.5 0.25 Filter Input Output

Convolution with a Triangle Filter 0.25 0.5 0.25 Filter Input Output

Convolution with a Triangle Filter What if the filter runs off the end? 0.5 0.25 0.25 Filter Input Output

Convolution with a Triangle Filter Common option: normalize the filter 0.33 0.67 Modified Filter Input Output

Convolution with a Gaussian Filter Filter Input Output Figure 2.4 Wolberg

Linear Filtering 2D Convolution o Each output pixel is a linear combination of input pixels in neighborhood with weights prescribed by a filter Filter Input Image Output Image

Linear Filtering 2D Convolution o Each output pixel is a linear combination of input pixels in neighborhood with weights prescribed by a filter Filter Input Image Output Image

Linear Filtering 2D Convolution o Each output pixel is a linear combination of input pixels in neighborhood with weights prescribed by a filter Filter Input Image Output Image

Linear Filtering 2D Convolution o Each output pixel is a linear combination of input pixels in neighborhood with weights prescribed by a filter Filter Input Image Output Image

Linear Filtering 2D Convolution o Each output pixel is a linear combination of input pixels in neighborhood with weights prescribed by a filter Filter Input Image Output Image

Blur Convolve with a filter whose entries sum to one o Each pixel becomes a weighted average of its neighbors Original Blur Filter =

Edge Detection Convolve with a filter that finds differences between neighbor pixels Original Detect edges Filter =

Sharpen Sum detected edges with original image Original Sharpened Filter =

Emboss Convolve with a filter that highlights gradients in particular directions Original Embossed Filter =

Non-Linear Filtering Each output pixel is a non-linear function of input pixels in neighborhood (filter depends on input) Original Oil Stained Glass

Digital Image Processing Changing intensity/color Linear: scale, offset, etc. Nonlinear: gamma, saturation, etc. Add random noise Filtering over neighborhoods Blur Detect edges Sharpen Emboss Median Moving image locations Scale Rotate Warp Combining images Composite Morph Quantization Spatial / intensity tradeoff Dithering

Quantization Reduce intensity resolution o Frame buffers have limited number of bits per pixel o Physical devices have limited dynamic range

Uniform Quantization P(x, y) = round( I(x, y) ) where round() chooses nearest value that can be represented. I(x,y) P(x,y) I(x,y) P(x,y) (2 bits per pixel)

Uniform Quantization Images with decreasing bits per pixel: 8 bits 4 bits 2 bits 1 bit Notice contouring.

Reducing Effects of Quantization Intensity resolution / spatial resolution tradeoff Dithering o Random dither o Ordered dither o Error diffusion dither Halftoning o Classical halftoning

Dithering Distribute errors among pixels o Exploit spatial integration in our eye o Display greater range of perceptible intensities Original (8 bits) Uniform Quantization (1 bit) Floyd-Steinberg Dither (1 bit)

Random Dither Randomize quantization errors o Errors appear as noise P(x,y) P(x,y) I(x,y) I(x,y) P(x, y) = round(i(x, y) + noise(x,y))

Random Dither Original (8 bits) Uniform Quantization (1 bit) Random Dither (1 bit)

Ordered Dither Pseudo-random quantization errors o Matrix stores pattern of threshholds i = x mod n j = y mod n e = I(x,y) - trunc(i(x,y)) threshold = (D(i,j)+1)/(n 2 +1) if (e > threshold) P(x,y) = ceil(i(x, y)) else P(x,y) = floor(i(x,y)) 0 1/5 2/5 3/5 4/5 1 thresholds

Ordered Dither Bayer s ordered dither matrices

Ordered Dither Original (8 bits) Random Dither (1 bit) Ordered Dither (1 bit)

Error Diffusion Dither Spread quantization error over neighbor pixels o Error dispersed to pixels right and below o Floyd-Steinberg weights: 3/16 + 5/16 + 1/16 + 7/16 = 1.0 Figure 14.42 from H&B

Error Diffusion Dither Original (8 bits) Random Dither (1 bit) Ordered Dither (1 bit) Floyd-Steinberg Dither (1 bit)

Reducing Effects of Quantization Dithering o Random dither o Ordered dither o Error diffusion dither Halftoning o Classical halftoning

Classical Halftoning Use dots of varying size to represent intensities o Area of dots proportional to intensity in image I(x,y) P(x,y)

Classical Halftoning From Town Topics, Princeton

Digital Halftone Patterns Use cluster of pixels to represent intensity Q: In this case, would we use four halftoned pixels in place of one original pixel? Figure 14.37 from H&B

Summary Image filtering o Compute new values for image pixels based on function of old values Halftoning and dithering o Reduce visual artifacts due to quantization o Distribute errors among pixels» Exploit spatial integration in our eye

Next Time Changing intensity/color Linear: scale, offset, etc. Nonlinear: gamma, saturation, etc. Add random noise Filtering over neighborhoods Blur Detect edges Sharpen Emboss Median Moving image locations Scale Rotate Warp Combining images Composite Morph Quantization Spatial / intensity tradeoff Dithering