1 / 72

From Pixels to Features: Review of Part 1

From Pixels to Features: Review of Part 1. COMP 4900C Winter 2008. Topics in part 1 – from pixels to features. Introduction what is computer vision? It’s applications. Linear Algebra

archer
Télécharger la présentation

From Pixels to Features: Review of Part 1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. From Pixels to Features:Review of Part 1 COMP 4900C Winter 2008

  2. Topics in part 1 – from pixels to features • Introduction • what is computer vision? It’s applications. • Linear Algebra • vector, matrix, points, linear transformation, eigenvalue, eigenvector, least square methods, singular value decomposition. • Image Formation • camera lens, pinhole camera, perspective projection. • Camera Model • coordinate transformation, homogeneous coordinate, intrinsic and extrinsic parameters, projection matrix. • Image Processing • noise, convolution, filters (average, Gaussian, median). • Image Features • image derivatives, edge, corner, line (Hough transform), ellipse.

  3. General Methods • Mathematical formulation • Camera model, noise model • Treat images as functions • Model intensity changes as derivatives • Approximate derivative with finite difference. • First-order approximation • Parameter fitting – solving an optimization problem

  4. y v Q(x2,y2) P(x1,y1) x Vectors and Points We use vectors to represent points in 2 or 3 dimensions The distance between the two points:

  5. is an arbitrary non-zero scalar, usually we choose 1. Homogeneous Coordinates Go one dimensional higher: From homogeneous coordinates to Cartesian coordinates:

  6. 2D Transformation with Homogeneous Coordinates 2D coordinate transformation: 2D coordinate transformation using homogeneous coordinates:

  7. Eigenvalue and Eigenvector We say that x is an eigenvector of a square matrix A if  is called eigenvalue and is called eigenvector. The transformation defined by A changes only the magnitude of the vector Example: and and are eigenvectors. 5 and 2 are eigenvalues, and

  8. Properties of symmetric matrix: • has real eignvalues; • eigenvectors can be chosen to be orthonormal. • has positive eigenvalues. Symmetric Matrix We say matrix A is symmetric if Example: is symmetric for any B, because A symmetric matrix has to be a square matrix

  9. Orthogonal Matrix A matrix A is orthogonal if or The columns of A are orthogonal to each other. Example:

  10. Least Square has no solution. When m>n for an m-by-n matrix A, In this case, we look for an approximate solution. We look for vector such that is as small as possible. This is the least square solution.

  11. is square and symmetric Least Square Least square solution of linear system of equations Normal equation: The Least square solution minimal. makes

  12. SVD: Singular Value Decomposition An mn matrix A can be decomposed into: U is mm, V is nn, both of them have orthogonal columns: D is an mn diagonal matrix. Example:

  13. Pinhole Camera

  14. Why Lenses? Gather more light from each scene point

  15. Pw pixel frame xim Yw Zw yim Yc y Xw Xc world frame camera frame x image plane frame Zc optical center principal point Four Coordinate Frames Camera model:

  16. P p y x principal point principal axis optical center image plane Perspective Projection These are nonlinear. Using homogenous coordinate, we have a linear relation:

  17. R,T World to Camera Coordinate Transformation between the camera and world coordinates:

  18. xim y yim x (ox,oy) Image Coordinates to Pixel Coordinates pixel sizes

  19. Put All Together – World to Pixel

  20. There are five intrinsic parameters: • The pixel sizes in x and y directions • The focal length • The principal point (ox,oy), which is the point • where the optic axis intersects the image plane. Camera Intrinsic Parameters K is a 3x3 upper triangular matrix, called the Camera Calibration Matrix.

  21. Extrinsic Parameters [R|T] defines the extrinsic parameters. The 3x4 matrix M = K[R|T] is called the projection matrix.

  22. Image Noise • Additive and random noise: • I(x,y) : the true pixel values • n(x,y) : the (random) noise at pixel (x,y) 

  23. Gaussian Distribution Single variable

  24. Gaussian Distribution Bivariate with zero-means and variance

  25. Gaussian Noise Is used to model additive random noise • The probability of n(x,y) is • Each has zero mean • The noise at each pixel is independent

  26. Impulsive Noise • Alters random pixels • Makes their values very different from the true ones • Salt-and-Pepper Noise: • Is used to model impulsive noise • x, y are uniformly distributed random variables • are constants

  27. Image Filtering • Modifying the pixels in an image based on some function of a local neighbourhood of the pixels N(p) p

  28. Linear Filtering – convolution The output is the linear combination of the neighbourhood pixels The coefficients come from a constant matrix A, called kernel. This process, denoted by ‘*’, is called (discrete) convolution. = Kernel Filter Output Image

  29. Smoothing by Averaging Convolution can be understood as weighted averaging.

  30. Gaussian Filter Discrete Gaussian kernel:

  31. Gaussian Filter

  32. Gaussian Kernel is Separable since

  33. 9 18 9 1 1 1 9 18 9 1 The complexity increases linearly with instead of with . Gaussian Kernel is Separable Convolving rows and then columns with a 1-D Gaussian kernel. Ir I = = result Ir

  34. Gaussian vs. Average Smoothing by Averaging Gaussian Smoothing

  35. Nonlinear Filtering – median filter Replace each pixel value I(i, j) with the median of the values found in a local neighbourhood of (i, j).

  36. Median Filter After median filtering Salt-and-pepper noise

  37. Edges in Images • Definition of edges • Edges are significant local changes of intensity in an image. • Edges typically occur on the boundary between two different regions in an image.

  38. Images as Functions 2-D Red channel intensity

  39. Finite Difference – 2D Continuous function: Discrete approximation: Convolution kernels:

  40. Image Derivatives Image I

  41. 1-D image 1st derivative threshold Edge Detection using Derivatives Pixels that pass the threshold are edge pixels

  42. Image Gradient gradient magnitude direction

  43. Finite Difference for Gradient Discrete approximation: Convolution kernels: magnitude aprox. magnitude direction

  44. Edge Detection Using the Gradient • Properties of the gradient: • The magnitude of gradient provides information about the strength of the edge • The direction of gradient is always perpendicular to the direction of the edge • Main idea: • Compute derivatives in x and y directions • Find gradient magnitude • Threshold gradient magnitude

  45. Edge Detection Algorithm edges Threshold Image I

  46. Edge Detection Example

  47. Edge Detection Example

  48. Finite differences responding to noise Increasing noise -> (this is zero mean additive gaussian noise)

  49. Solution: smooth first • Where is the edge? • Look for peaks in

  50. Convolution kernel for Sobel Edge Detector Approximate derivatives with central difference Convolution kernel Smoothing by adding 3 column neighbouring differences and give more weight to the middle one

More Related