Camera Image Processing Pipeline: Part II

Similar documents
Camera Image Processing Pipeline: Part II

Camera Image Processing Pipeline

Image acquisition. In both cases, the digital sensing element is one of the following: Line array Area array. Single sensor

Focusing and Metering

Digital Media. Lecture 4: Bitmapped images: Compression & Convolution Georgia Gwinnett College School of Science and Technology Dr.

It should also be noted that with modern cameras users can choose for either

Focusing & metering. CS 448A, Winter Marc Levoy Computer Science Department Stanford University

Aperture. The lens opening that allows more, or less light onto the sensor formed by a diaphragm inside the actual lens.

Digital photography , , Computational Photography Fall 2017, Lecture 2

OFFSET AND NOISE COMPENSATION

Noise and ISO. CS 178, Spring Marc Levoy Computer Science Department Stanford University

Color , , Computational Photography Fall 2018, Lecture 7

Wireless Communication

Dynamic Range. H. David Stein

Digital Cameras The Imaging Capture Path

Color , , Computational Photography Fall 2017, Lecture 11

Images and Displays. Lecture Steve Marschner 1

Compression and Image Formats

Digital photography , , Computational Photography Fall 2018, Lecture 2

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

Chapter 9 Image Compression Standards

Assistant Lecturer Sama S. Samaan

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

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

Lecture 30: Image Sensors (Cont) Computer Graphics and Imaging UC Berkeley CS184/284A

Camera Requirements For Precision Agriculture

Introduction to Color Science (Cont)

Images and Colour COSC342. Lecture 2 2 March 2015

Camera Requirements For Precision Agriculture

IMAGE RESTORATION WITH NEURAL NETWORKS. Orazio Gallo Work with Hang Zhao, Iuri Frosio, Jan Kautz

Film Cameras Digital SLR Cameras Point and Shoot Bridge Compact Mirror less

CS 565 Computer Vision. Nazar Khan PUCIT Lecture 4: Colour

HIGH DYNAMIC RANGE IMAGING Nancy Clements Beasley, March 22, 2011

What will be on the midterm?

15110 Principles of Computing, Carnegie Mellon University

Analysis on Color Filter Array Image Compression Methods

Introduction to Multimedia Computing

Ch. 3: Image Compression Multimedia Systems

CS148: Introduction to Computer Graphics and Imaging. Displays. Topics. Spatial resolution Temporal resolution Tone mapping. Display technologies

Color and perception Christian Miller CS Fall 2011

Color image processing

High Dynamic Range Imaging

Templates and Image Pyramids

Prof. Feng Liu. Fall /02/2018

MY ASTROPHOTOGRAPHY WORKFLOW Scott J. Davis June 21, 2012

Graphics and Image Processing Basics

Setting Up Your Camera Overview

Huffman Coding For Digital Photography

Computational Photography: Interactive Imaging and Graphics

Hybrid Coding (JPEG) Image Color Transform Preparation

One Week to Better Photography

Tonemapping and bilateral filtering

CS 89.15/189.5, Fall 2015 ASPECTS OF DIGITAL PHOTOGRAPHY COMPUTATIONAL. Image Processing Basics. Wojciech Jarosz

Improvements of Demosaicking and Compression for Single Sensor Digital Cameras

Processing Time Lapse Astro Images with RawTherapee

High dynamic range imaging and tonemapping

Camera Post-Processing Pipeline

Color images C1 C2 C3

Lecture Notes 11 Introduction to Color Imaging

A Novel Approach of Compressing Images and Assessment on Quality with Scaling Factor

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

Introduction to Image Processing and Computer Vision -- Noise, Dynamic Range and Color --

L I F E L O N G L E A R N I N G C O L L A B O R AT I V E - FA L L S N A P I X : P H O T O G R A P H Y

or, How do I get this thing to do what I want? Copyright 2016 Paul Fisher

Subjective evaluation of image color damage based on JPEG compression

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

Module 6 STILL IMAGE COMPRESSION STANDARDS

Introduction to Digital Photography

Lenses, exposure, and (de)focus

Digital Image Processing COSC 6380/4393. Lecture 20 Oct 25 th, 2018 Pranav Mantini

What will be on the final exam?

Color Reproduction. Chapter 6

Waitlist. We ll let you know as soon as we can. Biggest issue is TAs

>--- UnSorted Tag Reference [ExifTool -a -m -u -G -sort ] ExifTool Ver: 10.07

IMAGES OF MOVING SUBJECTS

DSLR Essentials: Class Notes

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

Take Control of Your Camera

Additive Color Synthesis

Human Vision, Color and Basic Image Processing

Image Processing Architectures (and their future requirements)

E-520. Built-in image stabiliser for all lenses. Comfortable Live View thanks to high speed contrast AF** 100% D-SLR quality

Images and Displays. CS4620 Lecture 15

IMAGE PROCESSING >COLOR SPACES UTRECHT UNIVERSITY RONALD POPPE

Templates and Image Pyramids

Introduction to 2-D Copy Work

Image Perception & 2D Images

Resolution, DPI NOTICE WE HAVE NOT YET EVEN DOUBLED LINEAR RESOLUTION, DESPITE ALMOST QUADRUPLING THE MEGAPIXELS. Don t get caught up with resolution

Sunderland, NE England

Realistic HDR Histograms Camera Raw

Dr. Shahanawaj Ahamad. Dr. S.Ahamad, SWE-423, Unit-06

Understanding and Using Dynamic Range. Eagle River Camera Club October 2, 2014

Jeffrey's Image Metadata Viewer

Figures from Embedded System Design: A Unified Hardware/Software Introduction, Frank Vahid and Tony Givargis, New York, John Wiley, 2002

Anna University, Chennai B.E./B.TECH DEGREE EXAMINATION, MAY/JUNE 2013 Seventh Semester

TAKING GREAT PICTURES. A Modest Introduction

Photo Editing Workflow

Perceptual Rendering Intent Use Case Issues

15110 Principles of Computing, Carnegie Mellon University

JPEG Encoder Using Digital Image Processing

Transcription:

Lecture 13: Camera Image Processing Pipeline: Part II Visual Computing Systems

Today Finish image processing pipeline Auto-focus / auto-exposure Camera processing elements Smart phone processing elements

Simplified image processing pipeline Correct for sensor bias (using measurements of optically black pixels) Correct pixel defects Vignetting compensation Dark frame subtract (optional) White balance Demosaic Denoise / sharpen, etc. Color Space Conversion Gamma Correction Color Space Conversion (Y CbCr) 4:4:4 to 4:2:2 chroma subsampling JPEG compress (lossy) lossless compression RAW file Last time JPEG file

Measurements recorded by sensor depend on the sensor s spectral response R = * Red pixel spectral sensitivity Radiance (energy spectrum from scene) G = * Green pixel spectral sensitivity Radiance (energy spectrum from scene) Image credit: maxmax.com https://www.maxmax.com/camera_technical.htm B = Blue pixel spectral sensitivity * Radiance (energy spectrum from scene)

Spectral response of human eye Eye Spectral Response (S, M, L cones) Avg. eye spectral sensitivity (daytime-adapted) Uneven distribution of cone types ~64% of cones are L cones, ~ 32% M cones Image credit: Wikipedia

Aside: web links on color matching

Color-space conversion Measurements of sensor depend on sensor s spectral response - Response depends on bandwidths filtered by color filter array Convert representation to sensor-independent basis: e.g., srgb - 3 x 3 matrix multiplication output_rgb_pixel = COLOR_CONVERSION_MATRIX * input_rgb_pixel Represented in standard color space (e.g., srgb) Represented in sensor-specific basis

Aside: web links on human visual system

Lightness (perceived brightness) Perceived Physical Response Lightness (L*)? Luminance (L) = * Eye spectral sensitivity Radiance (energy spectrum from scene) Dark adapted eye: L* L 0.4 Bright adapted eye: L* L 0.5 So what does a pixel s value mean?

Gamma (old motivation) Old CRT display: 1. Frame buffer contains value X 2. CRT display converts digital signal to voltage V(x) (linear relationship) 3. Beam voltage converted to light: (non-linear relationship) L V Where ~ 2.5 So if pixels store L, what happens? Observed image Desired Image Image credit: http://creativebits.org/mac_os_x/windows_vs_mac_monitor_gamma

Gamma correction Goal: want viewer to perceive luminance differences as if they were present in the environment where a picture is taken (keep in mind: reproducing the absolute values of L is not practical) Can set TV camera to record L, but store L 1/2.5 = L 0.4 to compensate for CRT effect Outdoor Scene L (from scene) Camera CRT Display viewer L 0.4 L 0.4*2.5 =L Result: luminance emitted by monitor is same as that measured But scene is bright (viewer bright adapted) and living room is dark (TV viewer dark adapted) So TV viewer perceives L 0.4 in the living room instead of L 0.5 (not the same as if viewer was there ) Outdoor Scene L (from scene) Solution: TV cameras record L, store L 0.5 Camera CRT Display viewer L 0.5 L 0.5*2.5 = L 1.25 L 1.25 * 0.4 = L 0.5 Credit: Marc Levoy, Stanford CS178

Power law 12 bit sensor pixel: Can represent 4096 luminance values Values are ~ linear in luminance Perceived brightness: L* Normalized Luminance (L)

Problem: quantization error Insufficient (perceived) precision in darker regions of image 12 bit sensor pixel: 4096 representable luminance values Values are ~ linear in luminance Perceived brightness Most images are not RAW files 8 bits per channel (256 unique values) Risks quantization dark areas of image High bit depth pixels Normalized Luminance (L) 5 bits/pixel (32 grays) Pixel stores L

Store values linear in brightness, not luminance Evenly distribute values over perceptible range (Make better use of available bits) Rule of thumb: human eye cannot differentiate differences in luminance less than 1% Perceived brightness High bit depth pixels 5 bits/pixel (32 grays) Pixel stores L 5 bits/pixel (32 grays) Pixel stores L 0.45 Must compute (pixel_value) 2.2 prior to display Normalized Luminance (L) Take caution with subsequent pixel processing operations: should blending images average brightness or luminance?

Y CbCr color space Y = luma: perceived (gamma corrected) luminance Cb = blue-yellow deviation from gray Cr = red-cyan deviation from gray Y Cb Gamma corrected RGB (primed notation indicates perceptual (non-linear) space) Conversion from R G B to Y CbCr: Cr Image credit: Wikipedia

Chroma subsampling Y CbCr is an efficient storage (and transmission) representation because Y can be stored at higher resolution than CbCr without much loss in perceived visual quality 4:2:2 representation: Store Y at full resolution Store Cb, Cr at full vertical resolution, but half horizontal resolution Y 00 Y 10 Y 20 Y 30 Cb 00 Cb 20 Cr 00 Cr 20 Y 01 Y 11 Y 21 Y 31 Cb 01 Cb 21 Cr 01 Cr 21

JPG Compression

JPG compression observations Low-frequency content is predominant in images of the real world The human visual system is less sensitive to high frequency sources of error Slide credit: Pat Hanrahan

Discrete cosine transform (DCT) for 8x8 block of pixels Project image from pixel basis into cosine basis basis[i, j] = 0 Visualization of 64 basis functions for an i 8x8 pixel block: (basis[i, j]) 7 Slide credit: Wikipedia, Pat Hanrahan j 7

Quantization Quantization produces small values for coefficients (only few bits per coefficient) Quantization zeros out many coefficients Application s JPEG quality setting scales quantization matrix Slide credit: Wikipedia, Pat Hanrahan

JPEG compression artifacts 8x8 pixel block boundaries Low quality Medium quality

Lossless compression of quantized DCT values Quantized DCT Values Entropy encoding: (lossless) Reorder values Reordering RLE encode 0 s Huffman encode non-zero values Image credit: Wikipedia

JPG compression summary For each image channel For each 8x8 image block Compute DCT Quantize results (lossy) Reorder values RLE encode 0-spans Huffman encode non-zero values

Summary: exploiting characteristics of human perception to build efficient image processing systems Encode pixel values linearly in perceived brightness, not in luminance Y CrCb representation allows reduced resolution in color channels (4:2:2) JPEG compression reduces file size at cost of quantization errors in high spatial frequencies (human brain tolerates these high frequency errors more than low frequency ones)

Simplified image processing pipeline Correct for sensor bias (using measurements of optically black pixels) Correct pixel defects Vignetting compensation Dark-frame subtract (optional) 12-bits per pixel 1 intensity per pixel Pixel values linear in energy White balance Demosaic Denoise / sharpen, etc. Color Space Conversion Gamma Correction Color Space Conversion (Y CbCr) 4:4:4 to 4:2:2 chroma subsampling 3x12-bits per pixel RGB intensity per pixel Pixel values linear in energy 3x8-bits per pixel (until 4:2:2 subsampling) Pixel values perceptually linear JPEG compression

Nikon D7000 Sensor made by Sony - 16 MP - Pixel size 4.78 x 4.78 um - 14 bit ADC 6 full-resolution JPG compressed shots / sec Note: RAW to JPG conversation in Adobe Lightroom on my MacBook Pro: 6 sec / image (36 times slower)

Auto Focus / Auto Exposure

Autofocus demos Phase-detection auto focus - Common in SLRs Contrast-detection auto focus - Point-and-shoots, smart-phone cameras Demo credits: Marc Levoy and Stanford CS178 course staff

SLR Camera Pentaprism Image credits: Nikon, Marc Levoy

Nikon D7000 Auto-focus sensor: 39 regions Metering sensor: 2K pixels - Auto-exposure - Auto-white-balance - Subject tracking to aid focus (predicts movement) Shutter lag ~ 50ms

Auto exposure Low resolution metering sensor capture Metering sensor pixels are large (higher dynamic range than main sensor) How do we set exposure? What if a camera doesn t have a separate metering sensor? Image credits: Marc Levoy, Andrew Adams

AF/AE summary DSLRs have additional sensing/processing hardware to assist with the 3A s (auto-focus, auto-exposure, auto-white-balance) - Phase-detection AF: optical system directs light to AF sensor - Example: Nikon metering sensor: large pixels to avoid over-saturation Point-and-shoots/smartphone cameras make these measurements by performing image processing operations on data from the main sensor - Contrast-detection AF: search for lens position that produces large image gradients - Exposure metering: if pixels are saturating, meter again with lower exposure In general, implementing AF/AE/AWB is an image understanding problem ( computer vision ) - Understand the scene well enough to set the camera s image capture and image processing parameters to best approximate the image a human would perceive - As processing/sensing capability increases, algorithms are becoming more sophisticated

Smarter cameras Goal: help photographer capture the shot they want Image credit: Sony Face detection: camera finds faces: tunes AWB, AE, AF for these regions Another example: iphone burst mode best shot selection Image credit: Sony Sony s ill-fated smile shutter Camera detects smile and automatically takes picture.

Smarter cameras Future behaviors - Automatic photo framing/cropping? - Replace undesirable data with more desirable data acquired previously Face-swapping [Bitouk et al. 2008] Result: Composite image with everyone s eyes open Four source photos: in each shot, at least one child s eyes are closed

Smarter cameras Future behaviors - Automatic photo framing/cropping? Replace undesirable data with more desirable data acquired previously Original image Selected Bad region Scene Completion Using Millions of Photos [Hays and Efros 2007] Final Composite Top Replacement Candidates

Camera processing resources

Generic SLR camera Consider everything that happens from shutter press to image! Do designers care about latency or throughput? Move lens (from auto-focus) Main Sensor Gain (from exposure level) Application Processor (low-power CPU) White balance settings, filtering settings (based on metering, etc.) Metering Sensor Image Processing ASIC Point-wise operations Block-wise operations DRAM AF Sensor Orientation Sensor GPS JPG/MPEG Encode Histogram Generation Face-detect Display Compositing