Image Processing Point Processing Filters Dithering Image Compositing

Slides:



Advertisements
Similar presentations
Data Compression CS 147 Minh Nguyen.
Advertisements

CS Spring 2009 CS 414 – Multimedia Systems Design Lecture 4 – Digital Image Representation Klara Nahrstedt Spring 2009.
Topic 6 - Image Filtering - I DIGITAL IMAGE PROCESSING Course 3624 Department of Physics and Astronomy Professor Bob Warwick.
Digital Image Processing
Spatial and Temporal Data Mining
1 Data Compression Engineering Math Physics (EMP) Steve Lyon Electrical Engineering.
1 Image Filtering Readings: Ch 5: 5.4, 5.5, 5.6,5.7.3, 5.8 (This lecture does not follow the book.) Images by Pawan SinhaPawan Sinha formal terminology.
Losslessy Compression of Multimedia Data Hao Jiang Computer Science Department Sept. 25, 2007.
1 Image filtering Images by Pawan SinhaPawan Sinha.
Lecture 2: Image filtering
T.Sharon-A.Frank 1 Multimedia Image Compression 2 T.Sharon-A.Frank Coding Techniques – Hybrid.
5. 1 JPEG “ JPEG ” is Joint Photographic Experts Group. compresses pictures which don't have sharp changes e.g. landscape pictures. May lose some of the.
Why Compress? To reduce the volume of data to be transmitted (text, fax, images) To reduce the bandwidth required for transmission and to reduce storage.
Roger Cheng (JPEG slides courtesy of Brian Bailey) Spring 2007
02/14/02(c) University of Wisconsin 2002, CS 559 Last Time Filtering Image size reduction –Take the pixel you need in the output –Map it to the input –Place.
01/31/02 (C) 2002, UNiversity of Wisconsin, CS 559 Last Time Color and Color Spaces.
Image Compression - JPEG. Video Compression MPEG –Audio compression Lossy / perceptually lossless / lossless 3 layers Models based on speech generation.
Software Research Image Compression Mohamed N. Ahmed, Ph.D.
Trevor McCasland Arch Kelley.  Goal: reduce the size of stored files and data while retaining all necessary perceptual information  Used to create an.
CS559-Computer Graphics Copyright Stephen Chenney Image File Formats How big is the image? –All files in some way store width and height How is the image.
Entropy and some applications in image processing Neucimar J. Leite Institute of Computing
Page 18/30/2015 CSE 40373/60373: Multimedia Systems 4.2 Color Models in Images  Colors models and spaces used for stored, displayed, and printed images.
CS 376b Introduction to Computer Vision 02 / 26 / 2008 Instructor: Michael Eckmann.
CS Spring 2012 CS 414 – Multimedia Systems Design Lecture 8 – JPEG Compression (Part 3) Klara Nahrstedt Spring 2012.
ECE472/572 - Lecture 12 Image Compression – Lossy Compression Techniques 11/10/11.
1 Image Compression. 2 GIF: Graphics Interchange Format Basic mode Dynamic mode A LZW method.
Lab #5-6 Follow-Up: More Python; Images Images ● A signal (e.g. sound, temperature infrared sensor reading) is a single (one- dimensional) quantity that.
2/3/04© University of Wisconsin, CS559 Spring 2004 Last Time Color –Transforming between two color spaces –A gamut is the set of displayable colors in.
Chapter 2 Getting Started: Drawing Figures. The Framebuffer Lecture 2 Fri, Aug 29, 2003.
Image Processing and Computer Vision: 91. Image and Video Coding Compressing data to a smaller volume without losing (too much) information.
1 Lecture 1 1 Image Processing Eng. Ahmed H. Abo absa
CIS679: Multimedia Basics r Multimedia data type r Basic compression techniques.
Image Compression Supervised By: Mr.Nael Alian Student: Anwaar Ahmed Abu-AlQomboz ID: IT College “Multimedia”
8. 1 MPEG MPEG is Moving Picture Experts Group On 1992 MPEG-1 was the standard, but was replaced only a year after by MPEG-2. Nowadays, MPEG-2 is gradually.
Addressing Image Compression Techniques on current Internet Technologies By: Eduardo J. Moreira & Onyeka Ezenwoye CIS-6931 Term Paper.
Digital Image Processing Image Compression
Image Compression – Fundamentals and Lossless Compression Techniques
Image Compression Fasih ur Rehman. Goal of Compression Reduce the amount of data required to represent a given quantity of information Reduce relative.
Advances in digital image compression techniques Guojun Lu, Computer Communications, Vol. 16, No. 4, Apr, 1993, pp
09/17/02 (C) 2002, University of Wisconsin, CS 559 Last Time Color Spaces File formats.
DIGITAL IMAGE. Basic Image Concepts An image is a spatial representation of an object An image can be thought of as a function with resulting values of.
CS654: Digital Image Analysis
Autonomous Robots Vision © Manfred Huber 2014.
02/05/2002 (C) University of Wisconsin 2002, CS 559 Last Time Color Quantization Mach Banding –Humans exaggerate sharp boundaries, but not fuzzy ones.
Visual Computing Computer Vision 2 INFO410 & INFO350 S2 2015
Introduction to JPEG m Akram Ben Ahmed
CS Spring 2010 CS 414 – Multimedia Systems Design Lecture 4 – Audio and Digital Image Representation Klara Nahrstedt Spring 2010.
Instructor: Mircea Nicolescu Lecture 5 CS 485 / 685 Computer Vision.
IS502:M ULTIMEDIA D ESIGN FOR I NFORMATION S YSTEM M ULTIMEDIA OF D ATA C OMPRESSION Presenter Name: Mahmood A.Moneim Supervised By: Prof. Hesham A.Hefny.
Masaki Hayashi 2015, Autumn Visualization with 3D CG Digital 2D Image Basic.
JPEG Compression What is JPEG? Motivation
Data Compression.
Algorithms in the Real World
Kyoungju Park Computer Graphics Kyoungju Park
Images, Display, Perception
Digital 2D Image Basic Masaki Hayashi
Data Compression.
Image filtering Hybrid Images, Oliva et al.,
Why Compress? To reduce the volume of data to be transmitted (text, fax, images) To reduce the bandwidth required for transmission and to reduce storage.
Image filtering Images by Pawan Sinha.
© University of Wisconsin, CS559 Spring 2004
Image filtering Images by Pawan Sinha.
Image filtering Images by Pawan Sinha.
Image filtering Images by Pawan Sinha.
Image filtering
Image filtering
Lecture 2: Image filtering
Image Filtering Readings: Ch 5: 5. 4, 5. 5, 5. 6, , 5
REDUKSI NOISE Pertemuan-8 John Adler
Presentation transcript:

Image Processing Point Processing Filters Dithering Image Compositing Image Compression Videos to show: Titanic (to match end scenes) Roger Rabbit and Casper for compositing Rhythm and Hues of bubbles and dolphin Gabe’s layering Gabe’s motion blur for stop motion

Images Image stored in memory as 2D pixel array Value of each pixel controls color Depth of image is information per pixel 1 bit: black and white display 8 bit: 256 colors at any given time via colormap 16 bit: 5, 6, 5 bits (R,G,B), 216 = 65,536 colors 24 bit: 8, 8, 8 bits (R,G,B), 224 = 16,777,216 colors

Fewer Bits: Colormaps Colormaps typical for 8 bit framebuffer depth With screen 1024 * 768 = 786432 = 0.75 MB Each pixel value is index into colormap Colormap is array of RGB values, 8 bits each Only 28 = 256 at a time Poor approximation of full color R G B R 1 G B i 2 255 R 255 G B

Image Processing 2D generalization of signal processing Image as a two-dimensional signal Point processing: modify pixels independently Filtering: modify based on neighborhood Compositing: combine several images Image compression: space-efficient formats Related topics (not in this lecture or this course) Image enhancement and restoration Computer vision

Point Processing Filters Dithering Image Compositing Image Compression Outline Point Processing Filters Dithering Image Compositing Image Compression

Point Processing f(v) = v identity; no change Input: a[x,y], Output b[x,y] = f(a[x,y]) f transforms each pixel value separately Useful for contrast adjustment Suppose our picture is grayscale (a.k.a. monochrome). Let v denote pixel value, suppose it’s in the range [0,1]. f(v) = v identity; no change f(v) = 1-v negate an image (black to white, white to black) f(v) = vp, p<1 brighten f(v) = vp, p>1 darken f(v) v

Point Processing f(v) = v identity; no change f(v) = 1-v negate an image (black to white, white to black) f(v) = vp, p<1 brighten f(v) = vp, p>1 darken f(v) v

Gamma correction compensates for different monitors Monitors have a intensity to voltage response curve which is roughly a 2.5 power function Send v  actually display a pixel which has intensity equal to v2.5 G = 1.0; f(v) = v G = 2.5; f(v) = v1/2.5 = v0.4

Point Processing Filters Dithering Image Compositing Image Compression Outline Point Processing Filters Dithering Image Compositing Image Compression

Audio recording is 1D signal: amplitude(t) Signals and Filtering Audio recording is 1D signal: amplitude(t) Image is a 2D signal: color(x,y) Signals can be continuous or discrete Raster images are discrete In space: sampled in x, y In color: quantized in value Filtering: a mapping from signal to signal

Convolution Used for filtering, sampling and reconstruction Convolution in 1D Chalkboard

Convolve box and step

Convolution filters box gaussian tent

Convolution filters Convolution in 1D Convolution in 2D a(t) is input signal b(s) is output signal h(u) is filter Convolution in 2D

Filters with Finite Support Filter h(u,v) is 0 except in given region Represent h in form of a matrix Example: 3 x 3 blurring filter As function In matrix form

Blurring Filters A simple blurring effect can be achieved with a 3x3 filter centered around a pixel, More blurring is achieved with a wider nn filter: Original Image Blur 3x3 mask Blur 7x7 mask

Image Filtering: Blurring original, 64x64 pixels 3x3 blur 5x5 blur

Blurring Filters Average values of surrounding pixels Can be used for anti-aliasing What do we do at the edges and corners? For noise reduction, use median, not average Eliminates intensity spikes Non-linear filter

Example: Noise Reduction Image with noise Median filter (5x5)

Example: Noise Reduction Original image Image with noise Median filter (5x5)

Edge Filters Discover edges in image Characterized by large gradient Approximate square root Approximate partial derivatives, e.g. Filter =

Sobel Filter Edge detection filter, with some smoothing Approximate Sobel filter is non-linear Square and square root (more exact computation) Absolute value (faster computation)

Sample Filter Computation Part of Sobel filter, detects vertical edges 25 25 25 25 25 b 25 -1 -2 1 2 h a

Example of Edge Filter Original image Edge filter, then brightened

Image Filtering: Edge Detection

Outline Display Color Models Filters Dithering Image Compositing Image Compression

Dithering Compensates for lack of color resolution Eye does spatial averaging Black/white dithering to achieve gray scale Each pixel is black or white From far away, color determined by fraction of white For 3x3 block, 10 levels of gray scale

Dithering Dithering takes advantage of the human eye's tendency to "mix" two colors in close proximity to one another.

Dithering Dithering takes advantage of the human eye's tendency to "mix" two colors in close proximity to one another. original no dithering with dithering Colors = 224 Colors = 28 Colors = 28

Ordered Dithering How do we select a good set of patterns? Regular patterns create some artifacts Example of good 3x3 dithering matrix

Floyd-Steinberg Error Diffusion Diffuse the quantization error of a pixel to its neighboring pixels Scan in raster order At each pixel, draw least error output value Add the error fractions into adjacent, unwritten pixels If a number of pixels have been rounded downwards, it becomes more likely that the next pixel is rounded upwards 7/16 3/16 5/16 1/16

Floyd-Steinberg Error Diffusion

Floyd-Steinberg Error Diffusion Enhances edges Retains high frequency Some checkerboarding From http://www.cs.rit.edu/~pga/pics2000/node1.html

Color Dithering Example: 8 bit framebuffer Dither RGB separately Set color map by dividing 8 bits into 3,3,2 for RGB Blue is deemphasized because we see it less well Dither RGB separately Works well with Floyd-Steinberg Generally looks good

Outline Display Color Models Filters Dithering Image Compositing Image Compression

Image Compositing Represent an image as layers that are composited (matted) together

Image Compositing To support this, give image an extra alpha channel in addition to R, G, B Alpha is opacity: 0 if totally transparent, 1 if totally opaque Alpha is often stored as an 8 bit quantity; usually not displayed. Mathematically, to composite a2 over a1 according to matte  b(x,y) = (1-(x,y))•a1(x,y)+ (x,y)•a2(x,y)  = 0 or 1 -- a hard matte,  = between 0 and 1 -- a soft matte Compositing is useful for photo retouching and special effects.

Special Effects: Compositing Lighting match Proper layering Contact with the real world Realism (perhaps) Applications Cel animation Blue-screen matting

Roger Rabbit http://members.tripod.com/~Willy_Wonka/Theatr.jpg

Special Effects: Green Screen Second green screen shot Compositing of everything Digital Domain (from http://www.vfxhq.com/1997/titanic-picssink.html )

Special Effects: Green Screen Compositing of people with ship model, sky and digital water Digital Domain (from http://www.vfxhq.com/1997/titanic-picssink.html )

Outline Display Color Models Filters Dithering Image Compositing Image Compression

Distinguish lossy and lossless methods Image Compression Exploit redundancy Coding: some pixel values more common Interpixel: adjacent pixels often similar Psychovisual: some color differences imperceptible Distinguish lossy and lossless methods

Image Sizes 1024*1024 at 24 bits uses 3 MB Encyclopedia Britannica at 300 pixels/inch and 1 bit/pixes requires 25 gigabytes (25K pages) 90 minute movie at 640x480, 24 bits per pixels, 24 frames per second requires 120 gigabytes Applications: HDTV, DVD, satellite image transmission, medial image processing, fax, ...

Exploiting Coding Redundancy Not limited to images (text, other digital info) Exploit nonuniform probabilities of symbols Entropy as measure of information content H = -Si Prob(si) log2 (Prob(si)) Low entropy  non uniform probability High entropy  uniform probability If source is independent random variable need H bits

Exploiting Coding Redundancy Idea: More frequent symbols get shorter code strings Best with high redundancy (= low entropy) Common algorithms Huffman coding LZW coding (gzip)

Codebook is precomputed and static Huffman Coding Codebook is precomputed and static Use probability of each symbol to assign code Map symbol to code Store codebook and code sequence Precomputation is expensive What is “symbol” for image compression? lossless

Exploiting Interpixel Redundancy Neighboring pixels are correlated Spatial methods for low-noise image Run-length coding: Alternate values and run-length Good if horizontal neighbors are same Can be 1D or 2D (e.g. used in fax standard) WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW 12W 1B 12W 3B 24W 1B 14W Quadtrees: Recursively subdivide until cells are constant color Region encoding: Represent boundary curves of color-constant regions lossless

Improving Noise Tolerance Predictive coding: Predict next pixel based on prior ones Output difference to actual Transform coding Exploit frequency domain Example: discrete cosine transform (DCT) Used in JPEG lossy compression

Discrete Cosine Transform Used for lossy compression (as in JPEG) Subdivide image into n x n blocks (n = 8) Apply discrete cosine transform for each block Each tile is converted to frequency space

Discrete Cosine Transform Quantize Human eye good at seeing variations over large area Not good at seeing the exact strength of a high frequency Greatly reducing the amount of information in the high frequency components Use variable length coding (e.g. Huffman)