Computer Science 121 Scientific Computing Winter 2014 Chapter 14 Images.

Slides:



Advertisements
Similar presentations
Pixels and Digital Images Yrd. Doc. Dr. Ahmet Sayar Kocaeli Universitesi Bilgisayar Muhendisligi Ileri Bilgisayar Grafikleri.
Advertisements

L.Ghadah R. Hadba CT1514-L1.  Computer Graphics :refers to processing of creating a new image from Geometry, Lighting parameters, Materials and Textures.Using.
A Digital Imaging Primer Nick Dvoracek Instructional Resources Center University of Wisconsin Oshkosh.
Dale & Lewis Chapter 3 Data Representation. Representing color Similarly to how color is perceived in the human eye, color information is encoded in combinations.
Bit Depth and Spatial Resolution SIMG-201 Survey of Imaging Science © 2002 CIS/RIT.
School of Computing Science Simon Fraser University
Digital Audio, Image and Video Hao Jiang Computer Science Department Sept. 6, 2007.
Images.
Graphics in the web Digital Media: Communication and Design
Digital Photography What do you need to Know?. Advantages of Digital Camera over Film Cameras Speed: Images recorded by the camera can be transmitted.
Graphics and Animation Chapter 8. 8 Graphics in Multimedia Graphics are an element that virtually all multimedia applications include.
Manipulating Images Image A visual representation of something that is seen in real life. It can be two-dimensional or three-dimensional A visual representation.
Digital Images. Scanned or digitally captured image Image created on computer using graphics software.
Department of Physics and Astronomy DIGITAL IMAGE PROCESSING
Images and the Web web graphics. web graphics: constraints Due to the constraints imposed by varying degrees of Internet bandwidth, designing images for.
Image processing Second lecture. Image Image Representation We have seen that the human visual system (HVS) receives an input image as a collection of.
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.
TOPIC 4 INTRODUCTION TO MEDIA COMPUTATION: DIGITAL PICTURES Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach.
Image Storage Bitmapped Graphics – in which an image is represented as a collection of dots Vector Graphics – in which an image is represented as a set.
The Digital Image Dr. John Ryan.
© 1999 Rochester Institute of Technology Introduction to Digital Imaging.
Graphics and Animation Multimedia Projects Part 2.
Images The Science of Images What is an Image on the computer? The Psychology of Images What do we use images for? What effect color has on our mood and.
Digital Cameras And Digital Information. How a Camera works Light passes through the lens Shutter opens for an instant Film is exposed to light Film is.
Intelligent Vision Systems Image Geometry and Acquisition ENT 496 Ms. HEMA C.R. Lecture 2.
Raster Graphics. An image is considered to be made up of small picture elements (pixels). Constructing a raster image requires setting the color of each.
GRAPHICS. Topic Outline What is graphic. Resolution. Types of graphics. Using graphic in multimedia applications.
Chapter 1. Introduction. Goals of Image Processing “One picture is worth more than a thousand words” 1.Improvement of pictorial information for human.
Computer Images Can store color info about each pixel, but makes file BIG Compression for Web 15.
CS- 375 Graphics and Human Computer Interaction Lecture 1: 12/4/1435 Fundamental Techniques in Graphics Lecturer: Kawther Abas.
CS112 Scientific Computation Department of Computer Science Wellesley College Numb3rs Number and image types.
Graphics workshop Library and Information Services University of St Andrews.
Image Representation. Digital Cameras Scanned Film & Photographs Digitized TV Signals Computer Graphics Radar & Sonar Medical Imaging Devices (X-Ray,
Multimedia. What is a graphic?  A graphic can be a: Chart Drawing Painting Photograph Logo Navigation button Diagram.
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.
Images. Digital Images Rectangular arrays of pixel data Pixel - picture element, smallest addressable part of the frame buffer. Color depth - the depth.
 By Bob “The Bird” Fiske & Anita “The Snail” Cost.
Image File Formats. What is an Image File Format? Image file formats are standard way of organizing and storing of image files. Image files are composed.
Graphics Concepts Presentation
CS 101 – Sept. 14 Review Huffman code Image representation –B/W and color schemes –File size issues.
Digital Image Editing Presented by John Hohn. File Formats JPEG – Joint Photographic Experts Group PNP – Portable Network Graphics GIF – Graphic Interchange.
8 Graphics Digital Media I. What is a graphic? A graphic can be a:  Chart  Drawing  Painting  Photograph  Logo  Navigation button  Diagram.
Intelligent Vision Systems Image Geometry and Acquisition ENT 496 Ms. HEMA C.R. Lecture 2.
Lesson 2: Introduction to Digital Imaging Digital Photography MITSAA IAP 2003 Rob Zehner.
Image File Formats By Dr. Rajeev Srivastava 1. Image File Formats Header and Image data. A typical image file format contains two fields namely Dr. Rajeev.
TOPIC 4 INTRODUCTION TO MEDIA COMPUTATION: DIGITAL PICTURES Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach.
Image Representation Last update st March Heejune Ahn, SeoulTech.
Image Editing Vocabulary Words Pioneer Library System Norman Public Library Nancy Rimassa, Trainer Thanks to Wikipedia ( help.
Chapter 1 Definitions & Basics of Digital Image 1.Image 2.Digital Image 3.Raster 4. Vector 5.Image Editing 1.
Scanner Scanner Introduction: Scanner is an input device. It reads the graphical images or line art or text from the source and converts.
Graphics and Image Data Representations 1. Q1 How images are represented in a computer system? 2.
MA/CS375 Fall MA/CS 375 Fall 2002 Lecture 5.
infinity-project.org Engineering education for today’s classroom Outline Images Then and Now Digitizing Images Design Choices in Digital Images Better.
1 of 32 Computer Graphics Color. 2 of 32 Basics Of Color elements of color:
Image Processing F34IMP lecture 1
DIGITAL MEDIA FOUNDATIONS
Sampling, Quantization, Color Models & Indexed Color
Binary Representation in Audio and Images
Pixel, Resolution, Image Size
Digital 2D Image Basic Masaki Hayashi
Graphics Basics Ellen Eyth.
"Digital Media Primer" Yue-Ling Wong, Copyright (c)2013 by Pearson Education, Inc. All rights reserved.
LET’S LEARN ABOUT GRAPHICS!
Graphics and Animation
Digital Image Fundamentals
Representing Images 2.6 – Data Representation.
Multimedia System Image
Visuals are analog signals...
"Digital Media Primer" Yue-Ling Wong, Copyright (c)2013 by Pearson Education, Inc. All rights reserved.
Graphics and Animation
Presentation transcript:

Computer Science 121 Scientific Computing Winter 2014 Chapter 14 Images

Background: Images ● Signal (sound, last chapter) is a single (one- dimensional) quantity that varies over time. ● Image (picture) can be thought of as a two- dimensional quantity that varies over space. ● Otherwise, the computations for sounds and images are about the same!

14.1 Black-and-White Images

● Eventually we get down to a single point (pixel, “picture element”) whose color we need to represent. ● For black-and-white images, two basic options –Halftone: Black (0) or white (1); having lots of points makes a region look gray –Grayscale: Some set of values (2 N, N typically = 8) representing shades of gray.

14.1 Black-and-White Images ● To turn a b/w image into a grid of pixels, imagine running a stylus horizontally along the image:

14.1 Black-and-White Images ● This gives us a one-dimensional function showing gray level at each point along the horizontal axis:

14.1 Black-and-White Images ● Doing this repeatedly with lots of evenly-spaced scan lines gives us a grayscale map of the image: ● Height = grayscale value ● Spacing between lines = spacing within line

14.2 Color ● Light comes in difference wavelengths (frequencies):

14.2 Color ● Like a sound, energy from a given light source (e.g., star) can be described by its wavelength (frequency) spectrum : the amount of each wavelength present in the source. Spectrum of vowel “ee” Frequency (Hz) Energy (dB) Spectrum of star ICR3287 Wavelength (nm) Intensity

14.2 Color ● Light striking our eyes is focused by a lens and projected onto the retina. ● The retina contains photoreceptors (sensors) called cones that respond to different wavelengths of light: red, green, and blue. ● So retina can be thought of as a transducer that inputs light and outputs a three-dimensional value for each point in the image: [R, G, B], where R, G, and B each fall in the interval (0,1). ● So we can represent any color image as three “grayscale” images:

14.2 Color =, R, G B

14.3 Digital Sampling of Images ● Same questions arise for sampling images as for sound: –Sampling Frequency (how often to sample) –Quantization (# of bits per sample) ● With images, “how often” means “how many times per linear unit (inch, cm) – a.k.a. resolution ● Focus on quantization –Each sample is an index into a color map –With too few bits, we lose gradual shading

Color Maps ● With 8 bits per color, 3 colors per pixel, we get 24 bits per pixel: 2 24 ≈ 100,000,000 distinct colors ● We can actually get away with far fewer, using color maps ● Each pixel has a value that tells us what row in the color map to use ● Color map rows are R, G, B values:

Color Maps >> colormap ans = >> size(colormap) ans = 64 3

Color Maps Matlab provides us with some default color maps: >> drawMandelbrot([ ], [-2 2])

Color Maps >> colormap(hot)

Color Maps >> colormap(flag)

Quantization Problems With too few bits, we lose gradual shading: 5 bits 1 bit 2 bits 3 bits 4 bits 6 bits 7 bits 8 bits

14.4 Sampling and Storing Images in Files Scanners usually output images in one of several formats –JP(E)G (Joint Photographic Experts Group) –GIF (Graphics Interchange Format) –PNG (Portable Network Graphics) –TI(F)F (Tagged Image File Format) As with sound formats, main issues in image formats are compression scheme (how images are stored and transmitted to save space/time) and copyright We'll focus on Matlab and mathematical issues....

14.4 Sampling and Storing Images in Files Matlab imread commands lets us read in files in several formats (automagically figures out which): >> a = imread('sakidehli.png'); % b/w >> size(a) ans = >> b = imread('monaLisaLouvre.jpg'); % color >> size(b) ans =

14.4 Sampling and Storing Images in Files Then use image to display image: >> image(b)

14.4 Sampling and Storing Images in Files

Then use image to display image: >> image(b) imwrite writes it back out: >> imwrite(b, 'monaLisaCopy.jpg')

14.4 Sampling and Storing Images in Files Recall formula for sound signal: P(t) = Σ i A i sin(2πf i t + φ i ) For images, we just add another dimension: P(x, y) = Σ j,k A j,k sin(2π( f j x + f k y + φ j,k )) This means that the issues/algorithms for images are similar to those for sounds Aliasing Frequency transforms, filters (next lecture)

Spatial Frequency: Intuitive Version x : ~18 color changes y : ~6 color changes

14.4 Sampling and Storing Images in Files As with sound, aliasing becomes an issue if sampling frequency is inadequate:

14.4 Sampling and Storing Images in Files As with sound, aliasing becomes an issue if sampling frequency is inadequate:

14.4 Sampling and Storing Images in Files As with sound, aliasing becomes an issue if sampling frequency is inadequate:

14.4 Sampling and Storing Images in Files As with sound, aliasing becomes an issue if sampling frequency is inadequate: 0.04 mm samples

14.4 Sampling and Storing Images in Files As with sound, aliasing becomes an issue if sampling frequency is inadequate: 0.04 mm samples 0.25 mm samples

14.5 Manipulating and Synthesizing Images Probably want to use PhotoShop or another image-processing package instead of Matlab. But Matlab allows us to see the math behind the processing: >> b = imread('monaLisaLouvre.jpg'); >> red = b(:,:,1); >> green = b(:,:,2); >> blue = b(:,:,3); >> image(red) >> colormap(gray) % just show intensity

14.5 Manipulating and Synthesizing Images >> image(red)

14.5 Manipulating and Synthesizing Images >> image(green)

14.5 Manipulating and Synthesizing Images >> image(blue)

14.5 Manipulating and Synthesizing Images Put them back together with cat : >> image(cat(3, red, green, blue))

14.5 Manipulating and Synthesizing Images Put them back together with cat : >> image(cat(3, red, green, blue))

14.5 Manipulating and Synthesizing Images >> max(max(a/3)) ans = 68 >> image(68-a/3), colormap(gray) Make a negative:

14.5 Manipulating and Synthesizing Images >> max(max(a/3)) ans = 68 >> image(68-a/3), colormap(gray) Make a negative:

14.6 Example: Image Restoration Mona Lisa has faded and yellowed over 500 years. Can we get an idea of what it looked like originally? Basic idea: Balance out R, G, B

>> a = imread('monaLisaLouvre.jpg'); >> mona = image2double(a); % kaplan >> min(min(min(mona))) ans = 0 >> max(max(max(mona))) ans = 1 >> r = mona(:,:,1); >> hist(r(:), 50) % histogram

>> a = imread('monaLisaLouvre.jpg'); >> mona = image2double(a); % kaplan >> min(min(min(mona))) ans = 0 >> max(max(max(mona))) ans = 1 >> r = mona(:,:,1); >> hist(r(:), 50) % histogram

>> newr = equalize(r); % kaplan >> hist(newr(:), 50)

>> newr = equalize(r); % kaplan >> hist(newr(:), 50)

>> newr = equalize(r); >> newg = equalize(g); >> newb = equalize(b); >> newmona = cat(3, newr, newg, newb); >> image(newmona)

>> newr = equalize(r); >> newg = equalize(g); >> newb = equalize(b); >> newmona = cat(3, newr, newg, newb); >> image(newmona)

>> image(newmona*.5 + mona*.5);