Computer Vision - Carleton University

Computer Vision - Carleton University

Filtering (I) Dr. Chang Shu COMP 4900C Winter 2008 Agenda Getting to know images. Image noise. Image filters. Digital Images An image - rectangular array of integers Each integer - the brightness or darkness of the

image at that point N: # of rows, M: # of columns, Q: # of gray levels Q = 2q (q is the # of bits/pixel) Storage requirements: NxMxq (e.g., for N=M=1024 and q=8 storage = 1MB) f (0,0) f (1,0) ... f ( N 1,0) f (0,1)

f (1,1) ... f ( N 1,1) ... f (0, M 1) ... f (1, M 1) ... ... ... f ( N 1, M 1) Image File Formats

Header usually contains width, height, bit depth. Magic number identify file format. Image data stores pixel values line by line without breaks. Common Image File Formats GIF (Graphic Interchange Format, .gif) PNG (Portable Network Graphics, .png) JPEG (Joint Photographic Experts Group, .jpeg) TIFF (Tagged Image File Format, tiff) PGM (Portable Gray Map, .pgm) FITS (Flexible Image Transport System, .fits)

Image Manipulation Tools Linux: xv, gimp Windows: Photoshop, Paint Shop Pro OpenCV + Ch read and display images #ifdef _CH_ #pragma package #endif #include "cv.h"

#include "highgui.h" // Load the source image. HighGUI use. IplImage *image = 0, *gray = 0; int main( int argc, char** argv ) { char* filename = argc == 2 ? argv[1] : (char*)"fruits.jpg"; if( (image = cvLoadImage( filename, 1)) == 0 ) return -1; // Convert to grayscale gray = cvCreateImage(cvSize(image->width,image->height), IPL_DEPTH_8U, 1); cvCvtColor(image, gray, CV_BGR2GRAY); // Create windows. cvNamedWindow("Source", 1);

cvNamedWindow("Result", 1); // Show the images. cvShowImage("Source", image); cvShowImage("Result", gray); // Wait for a key stroke cvWaitKey(0); cvReleaseImage(&image); cvReleaseImage(&gray); cvDestroyWindow("Source"); cvDestroyWindow("Result"); return 0; }

Noise Noise in Computer Vision: Any entity (in images, data, or intermediate results) that is not interesting for the main computation Can think of noise in several contexts: Spurious pixel fluctuations, introduced by image acquisition Numerical inaccuracies, introduced by the computers limited precision, round-offs or truncations, etc Entities that do not belong to any meaningful region (edges that do not correspond to actual object contours) Image Noise

Image Noise Additive and random noise: I x, y I x, y n x, y I(x,y) : the true pixel values n(x,y) : the (random) noise at pixel (x,y) Random Variables A random variable is a variable whose values are determined by the outcome of a random experiment.

A random variable can be discrete or continuous. Examples 1. A coin is tossed ten times. The random variable X is the number of tails that are noted. X can only take the values 0, 1, ..., 10, so X is a discrete random variable. 2. A light bulb is burned until it burns out. The random variable Y is its lifetime in hours. Y can take any positive real value, so Y is a continuous random variable. Mean, Variance of Random Variable Mean (Expected Value)

E ( X ) xi p( xi ) (discrete) i E ( X ) xp( x)dx Variance

2 E (( X ) 2 ) 2 is called standard deviation (continuous) Gaussian Distribution Single variable 1 ( x ) 2 / 2 2 p( x) e

2 Gaussian Distribution 2 Bivariate with zero-means and variance x2 y2 1 G x, y exp

2 2 2 2 Gaussian Noise Is used to model additive random noise

n2 2 The probability of n(x,y) is e 2 Each has zero mean The noise at each pixel is independent Impulsive Noise Alters random pixels Makes their values very different from the true ones Salt-and-Pepper Noise: Is used to model impulsive noise

I h, k I sp h, k imin y imax imin x, y are uniformly distributed random variables l , imin,imax are constants x l x l

Recently Viewed Presentations

  • ภาพนิ่ง 1 - Sukhothai Thammathirat Open University

    ภาพนิ่ง 1 - Sukhothai Thammathirat Open University

    Ezy Other titles: Arial Angsana New Calibri Cordia New FreesiaUPC Symbol Euclid Symbol AngsanaUPC การออกแบบเริ่มต้น Slide 1 Slide 2 Slide 3 Slide 4 Slide 5 Slide 6 Slide 7 Slide 8 Slide 9 Slide 10 Slide 11 Slide 12 Slide...
  • Drag&Drop Macro: Easter Eggs

    Drag&Drop Macro: Easter Eggs

    UK Furniture Chain The rainforest is the Jaguar's home. Without it, they will become extinct! Conservationist Click here to find out what the President of Guyana decided to do in 2007… He offered to preserve the country's entire 50 million...
  • Rapid Construction of Bridges In Seismic Regions

    Rapid Construction of Bridges In Seismic Regions

    A concrete reaction collar block and a 300-kip hydraulic center hole ram was used to pull on the #18 bars. From these tests we learned that: * These tests confirmed that: * This is a plot of embedment length normalized...
  • Drag&Drop Macro: Electronic Jungle

    Drag&Drop Macro: Electronic Jungle

    cuisine séjour salle de bains jardin terrasse salle à manger Word Escape - guess the word to help them escape! www.souffler.co.uk * *
  • National School Lunch Week October 13-17, 2014 {Insert

    National School Lunch Week October 13-17, 2014 {Insert

    Host a special challenge, presentation, or event in the cafeteria. Use special menus during NSLW to highlight all of the healthy options. Rename your menu staples for the week of NSLW to make them more fun. Decorate the cafeteria with...
  • Ann ual July 1 2013- June 30 2014

    Ann ual July 1 2013- June 30 2014

    William R. Watts Foundation, Inc. Zale Foundation. Gateway recognizes the following Corporations, Foundations and Organizations that have contributed to the success of Gateway in 2013- 2014. We apologize for any omissions. A Warm Thanks To Our Donors
  • Apostrophes - HODGE'S CLASSES

    Apostrophes - HODGE'S CLASSES

    Apostrophes. 2. to show ownership. A. for singular nouns and indefinite pronouns: add an apostrophe plus s. the student's essay Judy's sister somebody's book B. for plural nouns already ending in "s": add only an apostrophe.
  • URANS Approach for Open-Channel Bifurcation Flows Modelling

    URANS Approach for Open-Channel Bifurcation Flows Modelling

    3D CFD modelling based on RANS equations to understand complex 3D flows. However strong dependence on: Parameters (mesh, boundary conditions) Numerical options (turbulence models, wall functions, discretization schemes, etc.) Friday the 30th of August - 10.40 am - 11.00 am...