1 / 97

Introduction to Computer Vision

Lecture 3 Dr. Roger S. Gaborski. Introduction to Computer Vision. Image Models. Task: “ Look for an object in an image ” Assume the task is to find rectangle and washer objects. Image models, continued. Image Models. Task: “ Look for an object in an image ”

uzuri
Télécharger la présentation

Introduction to Computer Vision

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. Lecture 3 Dr. Roger S. Gaborski Introduction to Computer Vision Roger S. Gaborski

  2. Image Models • Task: “Look for an object in an image” • Assume the task is to find rectangle and washer objects RS Gaborski

  3. Image models, continued RS Gaborski

  4. Image Models • Task: “Look for an object in an image” • Assume the task is to find rectangle and washer objects • Find edge pixels and group • Find outlines of objects in the image • Create a model of the object • Rectangle: Four straight lines, Opposite lines equal in length, 90 degree angles, lines connected • Washer: Two concentric circles RS Gaborski

  5. Image models, edges RS Gaborski

  6. Matlab Example Roger S. Gaborski

  7. Image models, continued One object partially overlaps another RS Gaborski

  8. Objects are 3 Dimensional Rotating Disk Frame 1 Frame 2 Frame 3 RS Gaborski

  9. License Plate Model • Rectangular (depending on viewpoint) • Aspect ratio 2:1 • Textures (characters on license plate) RS Gaborski

  10. RS Gaborski

  11. Face Model http://www.faceresearch.org/ RS Gaborski

  12. Face Model http://www.faceresearch.org/ RS Gaborski

  13. Face Model Features: eyes, nose, mouth, shape of face (oval) Spatial orientation of features Issues to investigate: how do we detect features? Normalize for different faces? Scale? Orientation? Cluttered background? RS Gaborski

  14. Finding Cars in ImagesTraining – Modeling Parts RS Gaborski

  15. Testing RS Gaborski

  16. What’s Missing? • perceptual organization • similarity between semantic concepts “The semantic gap” RS Gaborski

  17. Examples of “semantic” similarity From: http://web.cecs.pdx.edu/~mm/ RS Gaborski

  18. From: http://web.cecs.pdx.edu/~mm/ RS Gaborski

  19. SUMMARY: Digital Images • Matrix of numbers • Each number represents a picture element – ‘pixel’ • Pixels are parameterized by • x – y position • intensity (color or monochrome) • time • MATLAB is designed for processing matrices (Matrix Laboratory) RS Gaborski

  20. Overview • Image displaying • Image types • Image adjustment • Gamma transformation • Logarithmic transformation • Component segmentation • Histogram distribution Roger S. Gaborski

  21. A Few Typical Operationswith Images >> ls *jpg OrangeFlower.jpgPatternOne.jpg >> I = imread('OrangeFlower.jpg'); >> whos I Name Size Bytes Class Attributes I 1880x2816x3 15882240 uint8 Roger S. Gaborski

  22. What are maximum and minimum pixel values of I? >> mx = max(I(:)) mx = 255 >> mn = min(I(:)) mn = 0 Roger S. Gaborski

  23. Displaying Images [0, 255] • Consider we would like to display a gray level image that has a possible range of values 0-255 • When we display the image we can arrange for each gray level value to be displayed as a different light level on the display • Black would map to the gray level 0, white would map to the gray level 255. • Gray level values between 0 and 255 would map to shades of gray. Roger S. Gaborski

  24. figure, imshow(I,'InitialMagnification' ,'fit') Roger S. Gaborski

  25. RECALL: Displaying Images [0,1] • The gray level of images can also be represented by real value numbers between 0 and 1. • 0 represents pixels that are black, 1 represents pixels that are white. • Values between 0 and 1 represent gray level values. Roger S. Gaborski

  26. im = uint8([0 50 100; 100 125 200; 200 250 275]) im is of type uint8. What values are min and max values contained in im ? What is the ‘shape’ of variable im? Roger S. Gaborski

  27. im = uint8([0 50 100; 100 125 200; 200 250 275]) im is of type uint8. What values are contained in im ? >> im im = 0 50 100 100 125 200 200 250 255 im is a 3x3 matrix Roger S. Gaborski

  28. Displaying Images >> figure, imshow(im, 'InitialMagnification' ,'fit') >> title('im') What is contrast? Roger S. Gaborski

  29. Range of Gray Level Values • The maximum range of values is [0,1] or [0,255] (for 8 bit images) • It is possible for images to use the maximum range of gray level values, or a subset of possible values • An image may only contain values between 0 and 0.6, or 0.3 and 0.9 • Is the contrast the same? How does the appearance differ? Roger S. Gaborski

  30. Describe the displayed image A >> A = [.14 .15 ; .16 .17] A = 0.1400 0.1500 0.1600 0.1700 >> figure, imshow(A, 'InitialMagnification' ,'fit') Roger S. Gaborski

  31. WHY? Roger S. Gaborski

  32. figure, imshow(A, [ ],'InitialMagnification' ,'fit') The data in A didn’t change, only the display Roger S. Gaborski

  33. mat2gray Change Actual Data Values: mat2gray Convert matrix to intensity image. I = mat2gray(A,[AMIN AMAX]) converts the matrix A to the intensity image I. The returned matrix I contains values in the range 0.0 (black) to 1.0 (full intensity or white). AMIN and AMAX are the values in A that correspond to 0.0 and 1.0 in I. Values less than AMIN become 0.0, and values greater than AMAX become 1.0. I = mat2gray(A) sets the values of AMIN and AMAX to the minimum and maximum values in A. Roger S. Gaborski

  34. >> A A = 0.1400 0.1500 0.1600 0.1700 >> A1 = mat2gray(A) A1 = 0 0.3333 0.6667 1.0000 (Range is [0,1]) Roger S. Gaborski

  35. B = 0.2800 0.3000 0.3200 0.3400 >> B = 2*A B = 0.2800 0.3000 0.3200 0.3400 >> B1 = mat2gray(B) B1 = 0 0.3333 0.6667 1.0000 Recall B = 2*A BUT B1 = A1 Roger S. Gaborski

  36. B = 0 0.5000 5.0000 10.0000 >> B1 = mat2gray(B) B1 = 0 0.0500 0.5000 1.0000 (Range is [0,1]) Roger S. Gaborski

  37. C = -10.0000 0.5000 5.0000 10.0000 >> C1 = mat2gray(B) C1 = 0 0.5250 0.7500 1.0000 The original range is -10 to +10 mat2gray converts the range to 0 to +1 Roger S. Gaborski

  38. double and im2double >> Q=uint8([55, 100, 22]) Q = 55 100 22 >> whos Q Name Size Bytes Class Attributes Q 1x3 3 uint8 >> Qd = double(Q) What is the value of Qd? Roger S. Gaborski

  39. >>> Qd = double(Q) Qd = 55 100 22 >> whos Q Qd Name Size Bytes Class Attributes Q 1x3 3 uint8 Qd 1x3 24 double >> Qid = im2double(Q) What is the value of Qid? Roger S. Gaborski

  40. >> Qid = im2double(Q) Qid = 0.2157 0.3922 0.0863 >> whos Name Size Bytes Class Attributes Q 1x1 1 uint8 Qd 1x1 8 double Qid 1x1 8 double Roger S. Gaborski

  41. >>> Qd = double(Q) Qd = 55 100 22 >> im2double(Qd) = ?????? Roger S. Gaborski

  42. im2double(Qd) (Qd is already type double, no change) ans = 55 100 22 Roger S. Gaborski

  43. Image Types • Intensity images • When elements are class uint8 or uint16 they have integer values in the range [0 255] or [0 65535] • When elements are class double values are floating point numbers. Values are scaled in the range [0 1] by convention • Pixels with value 0.0 are displayed as black • Pixels with value 1.0 are displayed as white • Binary images • RGB images • Indexed images Roger S. Gaborski

  44. Intensity Image >> Im = imread('Flag.jpg'); >> whos I Name Size Bytes Class Attributes Im 320x240 76800 uint8 % Image is of class uint8, >> >> max(Im(:)) ans = 255 >> min(Im(:)) ans = 0 Range 0 to 255 (uint8) >> Im1 = im2double(Im); % Convert to class double >> max(Im1(:)) ans = 1 >> min(Im1(:)) ans = 0 Range now 0 to 1 (im2double) which is default format of images read from disk Roger S. Gaborski

  45. Display Image >> Flag= im2double(imread(‘flag.jpg’)); >> figure, imshow(Flag), title(‘flag’);

  46. Extract a Region of the Image >> imRegion = imcrop(Flag); >> figure, imshow(imRegion), title('imRegion') >> size(imRegion) ans = 321 321 3

  47. R, G, B planes >> imshow(imRegion(:, :, 1)), title(‘RED’); >> imshow(imRegion(:, :, 2)), title(‘GREEN’); >> imshow(imRegion(:, :, 3)), title(‘BLUE’);

  48. Row of Data (red, green and blue)

  49. Display images imshow(Im) imshow(Im) uint8 im2double(I) Roger S. Gaborski

More Related