Image Processing & Antialiasing

Slides:



Advertisements
Similar presentations
Image Processing & Antialiasing
Advertisements

Advanced Imaging Techniques Lumberton High Sci Vis II V
V Material obtained from a July, 2014 summer workshop in Guildford County.
Digital Image Processing
Course Objectives… In this course, you will learn how to:  Capture pictures from many sources  Enhance your pictures with graphics software (Photoshop.
Week 7 - Monday.  What did we talk about last time?  Specular shading  Aliasing and antialiasing.
Adobe Photoshop CS5 – Illustrated Unit G: Creating Special Effects
Digital Imaging and Image Analysis
Adobe Photoshop CS5 – Illustrated Unit B: Selecting Pixels
Advanced Computer Graphics CSE 190 [Spring 2015], Lecture 5 Ravi Ramamoorthi
Color Image Processing
Adobe Photoshop CS4 – Illustrated Unit G: Creating Special Effects
Multimedia for the Web: Creating Digital Excitement Multimedia Element -- Graphics.
CS248 Midterm Review. CS248 Midterm Mon, November 4, 7-9 pm, Terman Aud Mostly “short answer” questions – Keep your answers short and sweet! Covers lectures.
CS248 Midterm Review Szymon Rusinkiewicz. CS248 Midterm Monday, November 1, 7-9 pm Gates B01 and B03 Designed to be 1-hour exam Mostly “short answer”
Processing Digital Images. Filtering Analysis –Recognition Transmission.
CS248 Midterm Review. CS248 Midterm Mon, November 3, 7-9 pm, Gates B01 Mostly “short answer” questions – Keep your answers short and sweet! Covers lectures.
Image Forgery Detection by Gamma Correction Differences.
1Notes. 2Atop  The simplest (useful) and most common form of compositing: put one image “atop” another  Image 1 (RGB) on top of image 2 (RGB)  For.
Advanced Computer Graphics (Spring 2005) COMS 4162, Lecture 6: Image Compositing, Morphing Ravi Ramamoorthi
Graphics File Formats. 2 Graphics Data n Vector data –Lines –Polygons –Curves n Bitmap data –Array of pixels –Numerical values corresponding to gray-
Graphics and Still Images John H. Krantz Hanover College.
CS248 Midterm Review Michael Green and Sean Walker (based on the work of previous TAs)
Introduction to Computer Graphics
Digital Images The nature and acquisition of a digital image.
Vector vs. Bitmap SciVis V
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.
V Obtained from a summer workshop in Guildford County July, 2014
My Research Experience Cheng Qian. Outline 3D Reconstruction Based on Range Images Color Engineering Thermal Image Restoration.
INF1090 Part Deux Photography- Photomanipulation.
Digital Images The digital representation of visual information.
DIGITAL GRAPHICS & ANIMATION Complete LESSON 5 CREATING SPECIAL EFFECTS.
Lecture 3. Fundamentals of Computer Graphics. Computer Graphics, a very broad term Fields Related to Computer Graphics Bitmap/Vector graphics, 2D/3D graphics,
I-1 Steps of Image Generation –Create a model of the objects –Create a model for the illumination of the objects –Create an image (render) the result I.
Vector vs. Bitmap
CS559: Computer Graphics Lecture 6: Edge Detection, Image Compositing, and Warping Li Zhang Spring 2010.
 In electrical engineering and computer science image processing is any form of signal processing for which the input is an image, such as a photograph.
Filtering and Color To filter a color image, simply filter each of R,G and B separately Re-scaling and truncating are more difficult to implement: –Adjusting.
Multimedia Software Tools. 3-D Modeling and Animation Tools 3-D modeling gives images a 3-dimensional look. It can be used along with animation, for instance,
Photoshop I I450 Technology Seminar. Adobe Photoshop Illustrator Acrobat InDesign ImageReady.
Digital Photography Mr. Brown Gering High School Graphic & Web Design Class.
CS5-Ms. Hamler Conventional Camera Light is focused from the lens onto film Stored on film Negative image on film Digital Camera Light is focused from.
1 Chapter 1: Introduction 1.1 Images and Pictures Human have evolved very precise visual skills: We can identify a face in an instant We can differentiate.
Why is computer vision difficult?
Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels.
Lecture 7: Intro to Computer Graphics. Remember…… DIGITAL - Digital means discrete. DIGITAL - Digital means discrete. Digital representation is comprised.
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.
Introduction to Computer Graphics
Autonomous Robots Vision © Manfred Huber 2014.
Lecture 6 Rasterisation, Antialiasing, Texture Mapping,
Visual Computing Computer Vision 2 INFO410 & INFO350 S2 2015
UniS CS297 Graphics with Java and OpenGL Blending.
HOW SCANNERS WORK A scanner is a device that uses a light source to electronically convert an image into binary data (0s and 1s). This binary data can.
9/28/04© University of Wisconsin, CS559 Fall 2004 Last Time Filtering –Box –Bartlett –Gaussian –Edge Detect (High-Pass) –Edge Enhance –How to apply filters.
Guilford County SciVis V104.03
Advanced Imaging Techniques V Guilford County Sci Vis.
An Introduction to Digital Image Processing Dr.Amnach Khawne Department of Computer Engineering, KMITL.
Processing Images and Video for An Impressionist Effect Automatic production of “painterly” animations from video clips. Extending existing algorithms.
3D Animation 1. Introduction Dr. Ashraf Y. Maghari Information Technology Islamic University of Gaza Ref. Book: The Art of Maya.
Visual Information Processing. Human Perception V.S. Machine Perception  Human perception: pictorial information improvement for human interpretation.
Vector vs. Bitmap. Vector Images Vector images (also called outline images) are images made with lines, text, and shapes. Test type is considered to be.
Color Image Processing
Color Image Processing
Vector vs. Bitmap.
Advanced Computer Graphics
Color Image Processing
Color Image Processing
© University of Wisconsin, CS559 Spring 2004
VISUAL COMMUNICATION USING ADOBE PHOTOSHOP CREATIVE SUITE 5
Computer Graphics Image processing 紀明德
Presentation transcript:

Image Processing & Antialiasing Part I (Overview and Examples) Image from http://www.gadgetell.com/tech/comment/apple-officially-announces-iphone-4/

Image Processing IP is fundamental to both computer graphics and computer vision Has its own publications and conferences IEEE Transactions on Image Processing (TIP) Image and Vision Computing Journal of Electronic Imaging IEEE International Conference on Image Processing (ICIP) IEEE International Conference on Computational Photography (ICCP) Once was closer to signal theory and audio processing than to graphics Image Synthesis in CG model -> image Image Processing image -> image measurements model recognition understanding … DSPs and GPUs used in both CG and IP Source for Image Processing Pubs/Confs: http://www.imageprocessingplace.com/root_files_V3/publications.htm#journals http://iris.usc.edu/Information/Iris-Conferences.html 8/4/15

Outline Overview Example Applications Jaggies & Aliasing Sampling & Duals Convolution Filtering Scaling Reconstruction Scaling, continued Implementation 8/4/15

What does “image” mean for us? A 2D domain with samples at regular points (almost always a rectilinear grid) Can have multiple values sampled per point Meaning of samples depend on the application (red, green, blue, opacity, depth, etc.) Units also depend on the application e.g., a computed int or float to be mapped to voltage needed for display of a pixel on a screen e.g., as a physical measurement of incoming light (e.g., a camera pixel sensor) Introduction to sampling demo 8/4/15

What is a channel? RGB is a common format for image channels Original RGB image 3 samples per pixel Red channel 1 sample per pixel Blue channel Green channel A channel is all the samples of a particular type RGB is a common format for image channels Easy to implement in h/w Corresponds approximately to human visual system anatomy (specialized “R, G, and B” cones) Samples represent the intensity of the light at a point for a given wavelength (red, green, or blue) The R channel of an image is an image containing just the red samples 8/4/15

The alpha channel In addition to the R, G, and B channels of an image, add a fourth channel called α (transparency/opacity/translucency) Alpha varies between 0 and 1 Value of 1 represents a completely opaque pixel, one you cannot see through Value of 0 is a completely transparent pixel Value between 0< α < 1 determines translucency Useful for blending images Images with higher alpha values are less transparent Linear interpolation (αX + (1- α)Y) or full Porter-Duff compositing algebra The orange box is drawn on top of the purple box using  = 0.8 8/4/15

Modeling an image Model a one-channel m×n image as the function 𝑢 𝑖,𝑗 Maps pairs of integers (pixel coordinates) to real numbers 𝑖 and 𝑗 are integers such that 0≤𝑖<m and 0≤𝑗<n Associate each pixel value 𝑢 𝑖,𝑗 to small area around display location with coordinates 𝑖,𝑗 A pixel here looks like a square centered over the sample point, but it’s just a scalar value and the actual geometry of its screen appearance varies by device Roughly circular spot on CRT Rectangular on LCD panel 8/4/15

Close-up of an LCD screen Pixels Pixels are point samples, not “squares” or “dots” Point samples reconstructed for display (often using multiple subpixels for primary colors) Close-up of a CRT screen Close-up of an LCD screen 8/4/15

Discrete Images vs. Continuous Images Two kinds of images Discrete Continuous Discrete image Function from ℤ 2 to ℝ How images are stored in memory The kind of images we generally deal with as computer scientists Discrete image 𝑢 𝑖,𝑗 𝑚 𝑛 Images by Evan Wallace 8/4/15

Discrete Images vs. Continuous Images Function from ℝ 2 to ℝ Images in the real world “Continuous” refers to the domain, not the values (discontinuities could still exist) Example: Gaussian distribution 𝑖 0 and 𝑗 0 are the center of the Gaussian 𝑢: ℤ 2 →ℝ, 𝑢 𝑖,𝑗 = 𝑒 − 𝑖− 𝑖 0 2 − (𝑗− 𝑗 0 ) 2 𝑣: ℝ 2 →ℝ, 𝑣 𝑖,𝑗 = 𝑒 − 𝑖− 𝑖 0 2 − 𝑗− 𝑗 0 2 𝑖 0 = 𝑛−1 /2 and 𝑗 0 = 𝑘−1 /2 (n odd) Here 𝑛=11 and 𝑚=11 Continuous image 𝑣(𝑖,𝑗) 𝑚 𝑛 Images by Evan Wallace 8/4/15

Idealized Five Stage Pipeline of Image Processing The stages are Image acquisition – how we obtain images in the first place Preprocessing – any effects applied before mapping (e.g., crop, mask, filter) Mapping – catch-all stage involving image transformations or image composition Post processing – any effects applied after mapping (e.g., texturizing, color remapping) Output – printing or displaying on a screen In practice, stages may be skipped Middle stages are often interlaced 8/4/15

Stage 1: Image Acquisition Image Synthesis Images created by a computer Painted in 2D Corel Painter (website) Photoshop (website) Rendered from 3D geometry Pixar’s RenderMan (website) Autodesk’s Maya (website) Your CS123 projects Procedurally textured Generated images intended to mimic their natural counterparts e.g., procedural wood grain, marble Image Capture Images from the “real world” Information must be digitized from an analog signal Common capture methods: Digital camera Satellite data from sensors (optical, thermal, radiation,…) Drum scanner Flatbed photo scanner Frames from video 8/4/15

Adjusted grayscale curve Stage 2: Preprocessing Original Each source image is adjusted to fit a given tone, size, shape, etc., to match a desired quality or to match other images Can make a set of dissimilar images appear similar (if they are to be composited later), or make similar parts of an image appear dissimilar (such as contrast enhancement) Adjusted grayscale curve Images from http://en.wikipedia.org/wiki/Histogram_equalization 8/4/15

Stage 2: Preprocessing (continued) Preprocessing techniques include: Adjusting color or grayscale curve Cropping Masking (cutting out part of an image) Blurring and sharpening Edge detection/enhancement Filtering and antialiasing Scaling up (super sampling) or scaling down (sub sampling) 8/4/15

Stage 2: Preprocessing (continued) Notes: Blurring, sharpening, and edge detection can also be postprocessing techniques Some preprocessing algorithms are not followed by mapping, others that involve resampling the image may be interlaced with mapping: filtering is done this way 8/4/15

Poisson Image Blending Image Warping Stage 3: Mapping Mapping is a catch-all stage where several images are combined, or geometric transformations are applied Transformations include: Rotating Scaling Shearing Warping Feature-based morphing Compositing: Basic image overlay Smooth blending with alpha channels Poisson image blending Seamlessly transfers “details” (like edges) from part of one image to another Poisson Image Blending Image credit: © Evan Wallace 2010 Images by Evan Wallace 8/4/15

Stage 4: Postprocessing Creates global effects across an entire image or selected area Art effects Posterizing Faked “aging” of an image Faked “out-of-focus” “Impressionist” pixel remapping Texturizing Technical effects Color remapping for contrast enhancement Color to B&W conversion Color separation for printing (RGB to CMYK) Scan retouching and color/contrast balancing Posterizing Aging Impressionist 8/4/15

Stage 5: Output (Archive/Display) Choice of display/archive method may affect earlier processing stages Color printing accentuates certain colors more than others Colors on the monitor have different gamuts and HSV values than the colors printed out Need a mapping HSV = hue, saturation, value, a cylindrical coordinate system for the RGB color model Gamut = set of colors that can be represented by output device/printer Display Technologies Monitor (CRT → LCD/LED/OLED/Plasma panel) Color printer Film/DVD Disk file Texture map for 3D renderer Image from http://commons.wikimedia.org/wiki/File:LCD_RGB.jpg 8/4/15

Outline Overview Example Applications Jaggies & Aliasing Sampling & Duals Convolution Filtering Scaling Reconstruction Scaling, continued Implementation 8/4/15

Example 1: Edge Detection Filtering Edge detection filters measure the difference between adjacent pixels A greater difference means a stronger edge A threshold is sometimes used to remove weak edges Sobel edge detection filter 8/4/15

Example 1: Edge Detection Filtering (Continued) Used with MRI scans to reveal boundaries between different types of tissues MRI scan is image where gray level represents tissue density Used same filter as previous slide Original MRI image of a dog heart Image after edge detection 8/4/15

Example 2: Image Enhancement for Forensics Extract evidence from seemingly incomprehensible images Normally, image enhancement uses many filtering steps, and often no mapping at all Former Prof. Michael Black and his class, CS296-4, received a commendation for helping Virginia police in a homicide case Before enhancement After enhancement Information on Michael Black’s Commendation: http://www.cs.brown.edu/news/2007/0423.commendation.html Images from http://www.ivimg.com/products/vcnvr.htm 8/4/15

Example 2: Image Enhancement for Forensics We have a security camera video of the back of a car that was used in a robbery The image is too dark and noisy for the police to pull a license number Though humans can often discern an image of poor quality, filtering can make it easier for a pattern-recognition algorithm to decipher embedded symbols Optical Character Recognition Step 1: Get the frame from the videotape digitized with a frame-grabber 8/4/15

Example 2: Image Enhancement for Forensics Step 2: Crop out stuff that appears to be uninteresting (outside plate edges) This step can speed process by doing image processing steps on fewer pixels Can’t always be done, may not be able to tell which sections are interesting without some processing 8/4/15

Example 2: Image Enhancement for Forensics Step 3: Use edge-sharpening filter to add contrast to plate number This step enhances edges by raising discontinuities at brightness gaps in image 8/4/15

Example 2: Image Enhancement for Forensics Step 4: Remap colors to enhance contrast between numbers and plate itself Now, can make a printout for records, or just copy plate number down: YNN-707! Note that final colors do not even resemble real colors of license plate—enhancement techniques have seriously distorted the colors! 8/4/15

Multipart Composition Image composition is popular in the art world, as well as in tabloid news Takes parts of several images and creates single image Hard part is making all images fit together naturally Artists can use it to create amazing collages and multi-layered effects Tabloid newspaper artists can use it to create “News Photos” of things that never happened – “Fauxtography”. There is no visual truth in media! 8/4/15

Chinese press photo of Tibet railway Famous Faked Photos Chinese press photo of Tibet railway Tom Hanks and JFK 8/4/15

Example image composition (1/5) Image of Boris (from Internet) Lars Bishop, former CS123 Head TA, created a news photo of himself “meeting” with former Russian President Boris Yeltsin post-Gorbachev and Perestroika. He served 10 July 1991 – 31 December 1999, resigned in favor of Putin) Needless to say, Lars Bishop never met Mr. Yeltsin Had to get the images, cut out the parts he wanted, touch them up, paste them together, and retouch the end result Image of Lars (from video camera) 8/4/15

Example image composition (2/5) Cut the pictures we want out of the original images Paint a region around important parts of images (outline of people) using Photoshop Continue touching up this outline until no background at edge of people Use a smart lasso tool that grows until it hit the white background, thus selecting subject. (“Magic Wand” tool in photoshop can accomplish this) 8/4/15

Example image composition (3/5) Filter the images to make them appear similar, and paste them together Boris is blurred and brightened to get rid of the halftoning lines (must have been a magazine photo) Lars is blurred and noise is added to match image quality to that of Boris Images are resized so Boris and Lars are at similar scales 8/4/15

Example image composition (4/5) Finalize image Created a simple, two-color background and added noise so it fit with the rest of the image, placed cutout of the two subjects on top of background This left a thin white halo around the subjects, so used a “Rubber Stamp” tool to stamp background noise patterns over halo, making seams appear less obvious 8/4/15

Example image composition (5/5) Final Image (with retouching at edges) BISHOP AND YELTSIN TALK PEACE BISHOP: “I couldn’t understand a single word he said!” 8/4/15

Image Composition – Frankenface Aseem Agarwala, Mira Dontcheva, Maneesh Agrawala, Steven Drucker, Alex Colburn, Brian Curless, David Salesin, Michael Cohen. Interactive Digital Photomontage. ACM Transactions on Graphics (Proceedings of SIGGRAPH 2004), 2004. http://grail.cs.washington.edu/projects/photomontage/ 8/4/15

Image Composition – Frankenface Aseem Agarwala, Mira Dontcheva, Maneesh Agrawala, Steven Drucker, Alex Colburn, Brian Curless, David Salesin, Michael Cohen. Interactive Digital Photomontage. ACM Transactions on Graphics (Proceedings of SIGGRAPH 2004), 2004. http://grail.cs.washington.edu/projects/photomontage/ 8/4/15

3D Image Processing: (1/3) 3D images 3D image volumes from MRI scans need image processing 2D image processing techniques often have 3D analogs Display becomes more difficult: voxels replace pixels (volumetric rendering) Increases time and space complexity: 4 channel 1024x1024 image = 4 megs 4 channel 1024x1024x1024 image = 4 gigs! 𝑁 2 processing algorithms become 𝑁 3 Illustration: Erlend Nagelhus and Gunnar Lothe. 3D MRI: Kyrre Eeg Emblem, Rikshospitalet, and Inge Rasmussen, Nidelven Hjerneforskningslaboratorium. University of Oslo, 1999 8/4/15

Computer Vision (1/2) Computer graphics is the business of using models to create images; computer vision solves the opposite problem—deriving models from images Computer must do all the processing without human intervention Often, processing techniques must be fast Slow processing will add to camera-to-reaction latency (lag) in system Common preprocessing techniques for computer vision: Edge enhancement Region detection Contrast enhancement Feature point detection Virtual Air Guitar project: http://airguitar.tml.hut.fi/photos.html 8/4/15

Computer Vision (2/2) Image processing makes information easier to find Pattern detection and pattern recognition are separate fields in their own right Pattern detection: looking for features and describing the image’s content at a higher level Pattern recognition: classifying collections of features and matching them against library of stored patterns. (e.g., alphanumeric characters, types of abnormal cells, or human features in the case of biometrics) Pattern detection is one important component of pattern recognition Computer vision can be used to recreate 3d scenes from 2d color/depth images Computational photography combines computer vision and computer graphics (see next slide) For more on computer vision: CS143 (computer vision) CLPS 1520 (computational vision). Also courses in CLPS, ENGN 8/4/15

Example: Style transfer for headshot portraits Computational vision Matches points in the input image and the example image Keypoint detection and correspondence Image processing Match local statistics Local contrast Tone Detail Allow amateurs to easily produce great photos! Virtual Air Guitar project: http://airguitar.tml.hut.fi/photos.html 8/4/15

Example: Style transfer for general photos Input image Example image: Ansel Adams Output image Virtual Air Guitar project: http://airguitar.tml.hut.fi/photos.html 8/4/15

Joints of skeletons on top of depth map Microsoft Kinect Uses computer vision to “see” your body’s shape Extract multiple “skeletons” from depth image Body as a controller Gesture recognition Facial recognition Works with cheap hardware RGB camera CMOS depth sensor Projected infrared pattern to see in darkness Total cost around $100 Current research uses Kinects to construct 3D models DynamicFusion - Kinect Fusion DynamicFusion - using Kinect Images from http://xboxrepublic.top-forum.net/kinect-f26/is-this-how-microsoft-will-fix-kinect-s-couch-problem-t5510.htm and http://www.gamesradar.com/f/kinect-an-in-depth-look-at-how-it-works/a-20100819143229334005 http://images.gizmag.com/hero/kinect-fusion-5.jpg http://i.msdn.microsoft.com/dynimg/IC653131.png 8/4/15

3D Mapping and Augmented Reality Extensive research capturing 3d information from color and depth images Can be used for many purposes Paleontology/Archeology Performance capture (movies, games) Architects and interior design Augmented reality Engineering Augmented reality with Microsoft Hololens 8/4/15

Outline Overview Example Applications Jaggies & Aliasing (next class) Sampling & Duals Convolution Filtering Scaling Reconstruction Scaling, continued Implementation 8/4/15