Graphics III Image Processing II.

Slides:



Advertisements
Similar presentations
5th Intensive Course on Soil Micromorphology Naples th - 14th September Image Analysis Lecture 5 Thresholding/Segmentation.
Advertisements

5th Intensive Course on Soil Micromorphology Naples th - 14th September Image Analysis Lecture 5 Thresholding/Segmentation.
CS Spring 2009 CS 414 – Multimedia Systems Design Lecture 4 – Digital Image Representation Klara Nahrstedt Spring 2009.
Grey Level Enhancement Contrast stretching Linear mapping Non-linear mapping Efficient implementation of mapping algorithms Design of classes to support.
Computational Biology, Part 23 Biological Imaging II Robert F. Murphy Copyright  1996, 1999, All rights reserved.
Image Processing Lecture 4
From Images to Answers A Basic Understanding of Digital Imaging and Analysis.
Point Processing Image Arithmetic. Arithmetic Image Operations (blending) 2  Two source images can be added, multiplied, one subtracted from the other.
Digital Imaging and Image Analysis
Advanced Computer Graphics CSE 190 [Spring 2015], Lecture 5 Ravi Ramamoorthi
Image Compositing and Matting. Introduction Matting and compositing are important operations in the production of special effects. These techniques enable.
EEE 498/591- Real-Time DSP1 What is image processing? x(t 1,t 2 ) : ANALOG SIGNAL x : real value (t 1,t 2 ) : pair of real continuous space (time) variables.
6/9/2015Digital Image Processing1. 2 Example Histogram.
Multimedia Data Introduction to Image Processing Dr Mike Spann Electronic, Electrical and Computer.
Text Detection in Video Min Cai Background  Video OCR: Text detection, extraction and recognition  Detection Target: Artificial text  Text.
Image Analysis Preprocessing Image Quantization Binary Image Analysis
Processing Digital Images. Filtering Analysis –Recognition Transmission.
Course Website: Digital Image Processing Morphological Image Processing.
Image Enhancement.
Computer Vision Basics Image Terminology Binary Operations Filtering Edge Operators.
Image Analysis Preprocessing Arithmetic and Logic Operations Spatial Filters Image Quantization.
E.G.M. PetrakisBinary Image Processing1 Binary Image Analysis Segmentation produces homogenous regions –each region has uniform gray-level –each region.
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.
The Digital Image.
Machine Vision ENT 273 Image Filters Hema C.R. Lecture 5.
Digital Image Processing Image Enhancement Part IV.
Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals.
S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014.
CS 6825: Binary Image Processing – binary blob metrics
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.
September 23, 2014Computer Vision Lecture 5: Binary Image Processing 1 Binary Images Binary images are grayscale images with only two possible levels of.
Multimedia Data Introduction to Image Processing Dr Sandra I. Woolley Electronic, Electrical.
Morphological Image Processing
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.
AdeptSight Image Processing Tools Lee Haney January 21, 2010.
From Images to Answers A Basic Understanding of Digital Imaging and Analysis.
Lecture 3 The Digital Image – Part I - Single Channel Data 12 September
Introduction to Image processing using processing.
Computer Vision Introduction to Digital Images.
11/29/ Image Processing. 11/29/ Systems and Software Image file formats Image processing applications.
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities Prof. Charlene Tsai.
Visual Computing Computer Vision 2 INFO410 & INFO350 S2 2015
Lecture # 19 Image Processing II. 2 Classes of Digital Filters Global filters transform each pixel uniformly according to the function regardless of.
ISAN-DSP GROUP Digital Image Fundamentals ISAN-DSP GROUP What is Digital Image Processing ? Processing of a multidimensional pictures by a digital computer.
1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction.
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities May 2, 2005 Prof. Charlene Tsai.
CS Spring 2010 CS 414 – Multimedia Systems Design Lecture 4 – Audio and Digital Image Representation Klara Nahrstedt Spring 2010.
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.
Graphics II Image Processing I. Acknowledgement Most of this lecture note has been taken from the lecture note on Multimedia Technology course of University.
SUREILLANCE IN THE DEPARTMENT THROUGH IMAGE PROCESSING F.Y.P. PRESENTATION BY AHMAD IJAZ & UFUK INCE SUPERVISOR: ASSOC. PROF. ERHAN INCE.
Machine Vision ENT 273 Hema C.R. Binary Image Processing Lecture 3.
Instructor: Mircea Nicolescu Lecture 5 CS 485 / 685 Computer Vision.
Sharpening Spatial Filters ( high pass)  Previously we have looked at smoothing filters which remove fine detail  Sharpening spatial filters seek to.
Lecture(s) 3-4. Morphological Image Processing. 3/13/20162 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of.
Processing Images and Video for An Impressionist Effect Automatic production of “painterly” animations from video clips. Extending existing algorithms.
Green Screen Prof Oakes. Lecture Outline Intro Definition Terms History Process Lighting and Shooting Practice pulling Green Screen in FCP.
Masaki Hayashi 2015, Autumn Visualization with 3D CG Digital 2D Image Basic.
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities Prof. Charlene Tsai.
Digital 2D Image Basic Masaki Hayashi
Histogram Histogram is a graph that shows frequency of anything. Histograms usually have bars that represent frequency of occuring of data. Histogram has.
Binary Image Analysis used in a variety of applications:
© University of Wisconsin, CS559 Spring 2004
CSC 381/481 Quarter: Fall 03/04 Daniela Stan Raicu
CS Digital Image Processing Lecture 5
Spatial operations and transformations
Department of Computer Engineering
Lecture 2: Image filtering
Spatial operations and transformations
DIGITAL IMAGE PROCESSING Elective 3 (5th Sem.)
Binary Image Analysis used in a variety of applications:
Presentation transcript:

Graphics III Image Processing II

Acknowledgement Most of this lecture note has been taken from the lecture note on Multimedia Technology course of University of Louisiana at Lafayette. I’d like to thank Assoc. Prof. Dr. William Bares who create such a good work on these lecture notes.

Image Processing Applications Improve contrast, sharpen, remove noise, detect edges of features Detect motion in consecutive frames for motion detection in security systems Retouch scanned photographs Creative effects: warping, emboss, compositing

Contrast and Dynamic Range Contrast: distinction between light and dark shades Dynamic Range: span from minimum to maximum color intensity values Using histograms to analyze contrast and dynamic range

Histogram Graph of the number of pixels in an image having each possible pixel value Example, assume monochrome images 8-bit per pixel and allocate a histogram array of 256 integer values all initially zero. Loop over all image pixels p c = Monochrome intensity value of pixel p Histogram[c] = Histogram[c] + 1

Grayscale image and its histogram

Histograms for RGB color images For RGB color images, a separate histogram is generated for red, green, and blue components The horizontal axis is labeled with the RGB pixel values 0..255, and the vertical axis measures the number of pixels having a given pixel value

RGB histogram for a color image

Contrast Enhancement Improve the contrast and dynamic range of a dull and washed out image Low contrast grayscale image and its histogram

Contrast Enhancement Process Step 2: Scale histogram to expand dynamic range Scale highest intensity H into a value equal to or close to 255 Scale = 255 / H Loop over all pixels (x,y) ResultPixel2(x,y) = Scale * ResultPixel1(x,y) Step 1: Shift histogram Shift histogram so more pixels have values near zero. Loop over all pixels (x,y) ResultPixel1(x,y) = InputPixel(x,y) – L

Image Processing Filters Convolve pixels of input image using an HxV filter kernel Changing the filter kernel produces a variety of effects such as low pass filter (blur), emboss, edge detect

Filter kernel applied to 3x3 block of pixels For example, the 3x3 filter kernel is to be applied at a pixel (x,y) of an image. The following convolution step is applied for each pixel of an image. Loop over all pixels (x,y) ResultPisel(x,y) = K(1) * P(x-1,y+1) + K(2) * P(x,y+1) + K(3) * P(x+1,y+1) + K(4) * P(x-1,y) + K(5) * P(x,y) + K(6) * P(x+1,y) + K(7) * P(x-1,y-1) + K(8) * P(x,y-1) + K(9) * P(x+1,y-1) Clamp ResultPixel(x,y) to range 0..255

Image Processing Filter (ต่อ) Note: Assign pixel values of zero when the filter extends past the edge of the image. RGB color images: Each pixel is represented by 3 values (r,g,b), where 0 <= r,g,b <= 255 Consequently, the above generic 3x3 filter algorithm must be separately performed for the red, green, and blue componentes

Edge Dectection

Vertical Edge Detection Original row of pixels 0 0 0 1 1 1 Shifted by one 0 0 0 1 1 1 Subtract to get result 0 0 0 1 0 0 Vertical edge at boundary between 0 and 1 pixel values Result(x,y) = Pixel(x,y) – Pixel(x-1,y) Vertical Edge Detection Filter Kernel 0 0 0 -1 1 0

Horizontal Edge Detection Result(x,y) = Pixel(x,y) – Pixel(x,y-1) Horizontal Edge Detection Filter Kernel 0 0 0 0 1 0 0 -1 0

Combined Vertical and Horizontal Edge Detection Result(x,y) = Pixel(x,y) – Pixel(x-1,y) – Pixel(x,y-1) Combined V&H Edge Detection Filter Kernel 0 0 0 -1 1 0 0 -1 0

Emboss Creates the effect of an image punched out of gray metal. Similar to edge detect with the addition of a constant gray intensity to fill-in the flat areas Result(x,y) = source(x,y) – source(x-dx,y-dy) + 128 Where the integer values of dx, dy determine the direction of the emboss Typical values are dx = dy = 1 or dx = dy = -1

Emboss Example

Mosaic (Pixelate) Replace the RGB values of a rectangular block of pixels by the average of their RGB values

Mosaic Example For example, the below 2x2 block of pixels are all assigned the RGB color value of (50,30,70) found by taking the average RGB color value of the four pixels Compute 2x2 mosaic of pixels

Other Useful Filter Kernels Shadow mask -2 -1 0 -1 0 1 0 1 2 Enhancement mask: 3x3 smooth 1 2 1 2 4 2

Other Useful Filter Kernels (ต่อ) Enhancement mask: 5x5 smooth 1 1 1 1 1 1 4 4 4 1 1 4 12 4 1

Other Useful Filter Kernels (ต่อ) Enhancement mask: 3x3 sharpen -1 -1 -1 -1 9 -1

Other Useful Filter Kernels (ต่อ) Enhancement mask: 5x5 sharpen 0 -1 1 -1 0 -1 2 -4 2 -1 -1 -4 13 -4 -1

Morphological Image Processing Operations Morphological operations deal with the shape or structure of sets of pixels Applications Optical Character Recognition (OCR): identify characters from scanned text pages Segmentation: Identify the pixels forming the boundary of an object in an image

Cleaning up Digitized Images Useful to eliminate errors introduced by noise and limited sampling resolution before applying OCR or segmentation procedures. Erroneous: Extra noise pixels make two separate objects or characters spaced closely together Extra noise pixels may be scattered about the image Missing pixels cause breaks and gaps in objects causing one objectto be mistakenly identified as two separate objects

Typical Errors From Digitized Images Original Document Error Type (a) Error Type (b) Error Type (c)

Dilate and Erode Operators The dilate and erode operators can be employed to eliminate the typical errors found in digitized images These operators would be applied prior to OCR or segmentation In this example, consider only bilevel (black or white 1-bit per pixel) images

Binary Dilation Set all white pixels that are adjacent to a black pixel to black Before After Example of binary dilation (original pixels are marked in gray)

Binary Erosion Identify all black pixels that have at least one neighboring white pixel, and then setting all such pixels to white. Before After Example of binary erosion (eroded pixels are marked in light gray)

Opening and Closing Opening: application of an erosion followed by a dilation. This combination of operators is useful to eliminate extraneous pixels from a digitized images.

Examples of opening to remove erroneous pixels

Opening and Closing Closing: Application of a dilation followed by an erosion. This combination of operators is useful to fill-in missing pixels in a digitized image.

Example of closing to fill-in missing pixels

Digital Image Compositing Compositing creates a new image by combining multiple source images Television and motion picture special effects represent the major application of compositing

Optical Compositing Far before computers and digital image processing were available, early photographers and filmmakers developed optical compositing methods. In 1857 the swedish photgraphers Oscar Rejlander combined the images from 32 glass negatives to produce one massive print. This allowed the photographer to film several small groups of models in separate easier to manage shoots rather than assembling a large cast for a single shoot.

Optical Compositing (ต่อ) Many early movie special effect shots were filmed using the rear projection technique in which the special effects footage was projected onto a screen behind the live action In the frame from King Kong, stop motion footage of the miniature ape was projected onto a screen behind actress Fay Wray.

Digital Compositing Digital compositing methods compute the pixels of the resulting composite image by combining the pixels of multiple source images The pseudo-code to blend two equal-sized source images is as follows: Loop over all pixels (x,y) ResultPixel(x,y) = SourcePixelOne(x,y) * Scale1 + SourcePixelTwo(x,y) * Scale2

Digital Compositing (ต่อ) For RGB color images, the blending equation must be applied separately for each of the three color channels for each pixel. ResultPixelRed = SourcePixelOneRed * Scale1 + SourcePixelTwoRed * Scale2 ResultPixelGreen = SourcePixelOneGreen * Scale1 + SourcePixelTwoGreen * Scale2 ResultPixelBlue = SourcePixelOneBlue * Scale1 + SourcePixelTwoBlue * Scale2

Digital Compositing (ต่อ) For example, blend 50% of image one with 50% of image two. Since the two scale factors typically sum to 1.0, it’s only necessary to specify the scale factor to the first image and drive the second by subtracting the first scale factor from 1.0.

Alpha Channel Compositing More intricate compositing effects can be achieved by using an alpha channel mask or matte to specify the scale factors on a pixel-by-pixel basis.

Alpha Channel Compositing (ต่อ) The pseudo-code for the alpha channel compositing operation is as follows: Scale1 = AlphaChannel(x,y) //Assume values are normalized to range 0.0 to 1.0 Scale2 = 1.0 – Scale1 ResultPixel(x,y) = SourceImageOne(x,y) * Scle1 + SourceImageTwo(x,y) * Scale2 Another example of blending two images using a grdient alpha channel matte

Blue Screen Compositing Keying on a designated color can automatically create alpha channel mattes. For example, film action against a solid blue background and create a matte by assigning matte values of 0.0 for each blue pixel and 1.0 otherwise. The background color must be selected so that it does not appear in the people or objects being filmed. Green is also often used as the solid background color.

Blue Screen Compositing (ต่อ) Chroma key systems can replace areas of the background key color with a live video source. This technique is commonly used to composite weather casters over computer generated weather maps and radars displays.

Blue Screen Compositing (ต่อ) For example, lizard puppets are filmed against a blue background and composited over a swamp background in a popular television commercial.

Automatic matte extraction from blue screen image

Compositing and Computer-Generated (CG) Imagery

Live-action crowd. CG filled-in the distant crowds.