A Tutorial On Ip 1


Published on

Published in: Technology, Art & Photos
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • A Tutorial On Ip 1

    1. 1. February 1st – 4th ,2007
    2. 2. What is Image Processing <ul><li>Image Processing is a tool for analyzing image data in all areas of natural science. </li></ul><ul><li>It is concerned with extracting data from real-world images. </li></ul><ul><li>Differences from computer graphics is that computer graphics makes extensive use of primitives like lines, triangles & points. However no such primitives exist in a real world images. </li></ul>
    3. 3. Typical Applications of IP <ul><li>Automated visual inspection system. Checking of objects for defects visually. </li></ul><ul><li>Satellite Image Processing. </li></ul><ul><li>Classification (OCR), identification (Handwriting, finger prints) etc. </li></ul>
    4. 4. Components of IP system <ul><li>Camera, Scanner, other image acquisition software. </li></ul><ul><li>PC or workstation or DSP kit. </li></ul><ul><li>Software to run on the hardware platform. </li></ul><ul><li>To process an image, a representation or model is necessary. </li></ul><ul><li>An image is a spatial distribution of irradiance in a plane. </li></ul>
    5. 5. Possible representation of Images <ul><li>Matrix </li></ul><ul><li>Quadtrees </li></ul><ul><li>Chains </li></ul><ul><li>Pyramid </li></ul><ul><li>Of the four, matrix is the most general. The other three are used for special purposes. All these representations must provide for spatial relationships. </li></ul>
    6. 6. Matrix Representation <ul><li>Computers cannot handle continuous images but only arrays of digital numbers. </li></ul><ul><li>So images are represented as 2-D arrays of points (2-D matrix) </li></ul><ul><li>A point on this 2-D grid (corresponding to the image matrix element) is called PIXEL (picture element) </li></ul><ul><li>It represents the average irradiance over the area of the pixel. </li></ul>
    7. 7. Types of Images <ul><li>Color Images : </li></ul><ul><li>Each pixel value has three components. Red, Green, Blue. Each component can take a value of 0-255. In computer memory it is stored as a 32 bit value with bits 0-7 storing Blue, 8-15 storing Green, 16-23 storing Red, 24-31 storing alpha or left blank. </li></ul>
    8. 8. Types of Images(contd..1) <ul><li>Grey Scale Images : </li></ul><ul><li>Each Pixel value has only one component, Grayscale value. This represents the brightness on a 0-255 scale. It is also stored in memory as 32 bit with </li></ul><ul><li>R=G=B. But for our purposes we can use a single uchar and convert it to ulong on the fly. </li></ul>
    9. 9. Types of Images(contd..2) <ul><li>Binary Images : </li></ul><ul><li>Each pixel can take one of the two values 0 and 1. so a pixel is either ON or OFF. Images which are easiest to work with </li></ul><ul><li>We recommend using these Images. </li></ul>
    10. 10. Concept of Neighbourhoods <ul><li>A Neighbourhood N of a pixel is a subset of the image which satisfies some distance relation with the pixel. </li></ul><ul><li>Euclidean distance </li></ul><ul><li>L euclidean = √(x 1 -y 1 ) 2 +(x 2 -y 2 ) 2 </li></ul><ul><li>City Block distance </li></ul><ul><li>L city = |(x 1 -y 1 )|+|(x 2 -y 2 )| </li></ul><ul><li>Chess board distance </li></ul><ul><li>L chessboard = min (|x 1 -y 1 |, |x 2 -y 2 |) </li></ul>
    11. 11. Concept of Neighbourhoods(contd…) <ul><li>Von Neumann Neighbourhood </li></ul><ul><li>Nvon(x) = { y : Lcity (y,x) =1) </li></ul><ul><li>Moore Neighbourhood </li></ul><ul><li>Nmoore(x) = {y : Lchess(y,x) =1 ) </li></ul>
    12. 12. Image Preprocessing <ul><li>First step in most IP applications. </li></ul><ul><li>Used to remove noise in the input image </li></ul><ul><li>Examples are median filtering, averaging, contrast enhancement etc. </li></ul>
    13. 13. Image Preprocessing(contd…) <ul><li>Median Filtering </li></ul><ul><li>F is an image. </li></ul><ul><li>F’ is an blank image. </li></ul><ul><li>F’(x) = Median {F(y)| y € N(x) } </li></ul><ul><li>x=(x1,x2) , y= (y1,y2) </li></ul><ul><li>F’(x) = Median(F(x,y+1),F(x,y-1),F(x-1,y),F(x,y-1)) </li></ul><ul><li>Mean Filtering </li></ul><ul><li>F’(x) = Mean {F(y)| y € N(x) } </li></ul><ul><li>F’(x) = ¼ (F(x,y+1),F(x,y-1),F(x-1,y),F(x,y-1)) </li></ul>
    14. 14. Image Preprocessing(contd…) <ul><li>Edge Detection </li></ul><ul><li>Almost all edge detection algorithms are based on some form of differentiation. </li></ul><ul><li>Simplest Algorithm: </li></ul><ul><li>F(x 1 ,x 2 ) = F(x 1 +1,x 2 ) – F(x 1 ,x 2 ) Horizontal Gradient </li></ul>
    15. 15. Image Preprocessing(contd…) <ul><li>F(x 1 ,x 2 ) = F(x 1 ,x 2 +1) – F(x 1 ,x 2 ) Vertical Gradient </li></ul><ul><li>F(x 1 ,x 2 ) = |F(x 1 +1,x 2 ) –F(x 1 ,x 2 )|+ </li></ul><ul><li>|F(x 1 ,x 2 +1) – F(x 1 ,x 2 )| </li></ul><ul><li>Other Possible algorithms: Sobel, canny, Frei-Chen, Crack, Roberts, Prewitt etc. </li></ul>
    16. 16. Segmentation: <ul><li>The process of checking each individual pixel to see whether it belongs to an object of interest or not. </li></ul><ul><li>After segmentation, it is known which pixel belongs to which object. </li></ul><ul><li>The next step is image analysis & recognition, using the shape of the image. </li></ul>
    17. 17. Segmentation(contd…) <ul><li>Simplest Segmentation: Pixel Based </li></ul><ul><li>if (F(x)>T) </li></ul><ul><li>F’(x)=1 else </li></ul><ul><li>F’(x)=0. </li></ul><ul><li>Where F(x) is a gray scale image and F’(x) is a binary image of same dimensions. </li></ul>
    18. 18. Segmentation(contd…) <ul><li>Connected Components segmentation. </li></ul><ul><li>Let a be a binary image of mxn. </li></ul><ul><li>Let b, c, d be normal real valued images. </li></ul><ul><li>Algo: Let d (i, j) = i*n+j 0 ≤ I ≤ m-1, 0 ≤ j ≤ n </li></ul><ul><li>Let b=0 </li></ul><ul><li>c=d.a </li></ul><ul><li>While b!=c </li></ul><ul><li>b=c </li></ul><ul><li>c=(b ^ N).a </li></ul><ul><li>end </li></ul>
    19. 19. Segmentation(contd…) <ul><li>Selecting the threshold </li></ul><ul><li>Usually selected interactively. </li></ul><ul><li>If is the mean & σ is the variance of all the pixel values. </li></ul><ul><li>Then μ +k σ (1 ≤ k ≤ 3) gives good results. Where the background is much larger than the object. </li></ul><ul><li>Other methods of dynamic thresholding exist. </li></ul>
    20. 20. Morphology <ul><li>Operations on the size and shape of the object. </li></ul><ul><li>Performed on binary images </li></ul>
    21. 21. Basic Operations <ul><li>Erosion </li></ul><ul><li>G-M ={ p: M p c= G } </li></ul><ul><li>G: Set of all pixels of the matrix which are non zero. </li></ul><ul><li>M p : Neighbourhood operator centered at point P (here called a structuring element) </li></ul>
    22. 22. Basic Operations(contd…) <ul><li>Dilation </li></ul><ul><li>G+M ={ p: M p ∩G ≠ Φ } </li></ul><ul><li>Elementary operators from which other more complex operators can be built. </li></ul><ul><li>Although they belong to the family of the image analysis operators, it can also be used as low operator to remove noise. </li></ul>
    23. 23. Basic Operations(contd…) <ul><li>Composite Morphological Operators </li></ul><ul><li>Opening </li></ul><ul><li>G ° M = (G – M ) + M </li></ul><ul><li>Closing </li></ul><ul><li>G • M = (G + M) – M </li></ul><ul><li>Salt and Pepper Noise Removal </li></ul><ul><li>(G ° M) • M. </li></ul>
    24. 24. <ul><li>Opening removes all objects which at no point completely enclose the structure element, but it does not shrink the objects which are larger than the dia of the structuring element. </li></ul><ul><li>Ideal for removing thin lines. </li></ul><ul><li>Closing operator closes small holes and cracks without general enlargement. </li></ul>Basic Operations(contd…)
    25. 25. <ul><li>Thank you… </li></ul>