SlideShare ist ein Scribd-Unternehmen logo
1 von 60
Edges and Lines
Edge detection
 • Goal: Identify sudden
   changes (discontinuities) in an
   image
    – Intuitively, most semantic and
      shape information from the
      image can be encoded in the
      edges
    – More compact than pixels

 • Ideal: artist’s line drawing (but
   artist is also using object-level
   knowledge)
                                       Source: D. Lowe
Why do we care about edges?

• Extract information,
  recognize objects




                                     Vertical vanishing
                                           point
                                       (at infinity)
                         Vanishing

• Recover geometry and      line




  viewpoint              Vanishing        Vanishing
                           point            point
Origin of Edges

                                surface normal discontinuity


                                depth discontinuity


                                surface color discontinuity


                                illumination discontinuity




 • Edges are caused by a variety of factors


                                                  Source: Steve Seitz
Closeup of edges




                   Source: D. Hoiem
Closeup of edges




                   Source: D. Hoiem
Closeup of edges




                   Source: D. Hoiem
Closeup of edges




                   Source: D. Hoiem
Characterizing edges
• An edge is a place of rapid change in the image
  intensity function
                     intensity function
    image       (along horizontal scanline)     first derivative




                                              edges correspond to
                                              extrema of derivative
With a little Gaussian noise




                               Gradient

                                      Source: D. Hoiem
Effects of noise
 • Consider a single row or column of the image
    – Plotting intensity as a function of position gives a signal




 Where is the edge?
                                                            Source: S. Seitz
Effects of noise
• Difference filters respond strongly to noise
  – Image noise results in pixels that look very different
    from their neighbors
  – Generally, the larger the noise the stronger the
    response
• What can we do about it?




                                                  Source: D. Forsyth
Solution: smooth first

            f




            g



        f*g



   d
      ( f ∗ g)
   dx


                                   d
• To find edges, look for peaks in    ( f ∗ g)
                                   dx            Source: S. Seitz
Derivative theorem of convolution
• Differentiation is convolution, and convolution is
                       d                d
  associative:            ( f ∗ g) = f ∗ g
                       dx               dx
• This saves us one operation:

            f



           d
              g
           dx


           d
      f∗      g
           dx
                                                   Source: S. Seitz
Derivative of Gaussian filter



                * [1 -1] =
Tradeoff between smoothing and localization




    1 pixel             3 pixels              7 pixels



 • Smoothed derivative removes noise, but blurs
   edge. Also finds edges at different “scales”.
                                               Source: D. Forsyth
Designing an edge detector
• Criteria for a good edge detector:
   – Good detection: the optimal detector should find all real
     edges, ignoring noise or other artifacts
   – Good localization
      • the edges detected must be as close as possible to the
        true edges
      • the detector must return one point only for each true
        edge point
• Cues of edge detection
   – Differences in color, intensity, or texture across the
     boundary
   – Continuity and closure
   – High-level knowledge

                                                         Source: L. Fei-Fei
Canny edge detector
  • This is probably the most widely used edge
    detector in computer vision
  • Theoretical model: step-edges corrupted by
    additive Gaussian noise
  • Canny has shown that the first derivative of
    the Gaussian closely approximates the
    operator that optimizes the product of signal-
    to-noise ratio and localization

J. Canny, A Computational Approach To Edge Detection, IEEE
Trans. Pattern Analysis and Machine Intelligence, 8:679-714, 1986.

                                                             Source: L. Fei-Fei
Example




          original image (Lena)
Derivative of Gaussian filter




         x-direction       y-direction
Compute Gradients (DoG)




X-Derivative of Gaussian   Y-Derivative of Gaussian   Gradient Magnitude
Get Orientation at Each Pixel
• Threshold at minimum level
• Get orientation

                               theta = atan2(gy, gx)
Non-maximum suppression for each
    orientation
                             At q, we have a
                             maximum if the
                             value is larger than
                             those at both p and
                             at r. Interpolate to
                             get these values.




Source: D. Forsyth
Before Non-max Suppression
After non-max suppression
Hysteresis thresholding
• Threshold at low/high levels to get weak/strong edge pixels
• Do connected components, starting from strong edge pixels
Hysteresis thresholding
• Check that maximum value of gradient value
  is sufficiently large
  – drop-outs? use hysteresis
     • use a high threshold to start edge curves and a low
       threshold to continue them.




                                                       Source: S. Seitz
Final Canny Edges
Canny edge detector
1. Filter image with x, y derivatives of Gaussian
2. Find magnitude and orientation of gradient
3. Non-maximum suppression:
    – Thin multi-pixel wide “ridges” down to single pixel width
4. Thresholding and linking (hysteresis):
    – Define two thresholds: low and high
    – Use the high threshold to start edge curves and the low
      threshold to continue them



•   MATLAB: edge(image, ‘canny’)

                                                   Source: D. Lowe, L. Fei-Fei
Effect of σ (Gaussian kernel spread/size)




original             Canny with         Canny with


The choice of σ depends on desired behavior
  • large σ detects large scale edges
  • small σ detects fine features
                                                 Source: S. Seitz
Learning to detect boundaries
      image                    human segmentation              gradient magnitude




 • Berkeley segmentation database:
   http://www.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/segbench/
Finding straight lines

• One solution: try many possible lines and see
  how many points each line passes through



• Hough transform provides a fast way to do this
Hough transform
• An early type of voting scheme
• General outline:
  – Discretize parameter space into bins
  – For each feature point in the image, put a vote in
    every bin in the parameter space that could have
    generated this point
  – Find bins that have the most votes


         Image space                      Hough parameter space

    P.V.C. Hough, Machine Analysis of Bubble Chamber Pictures, Proc.
    Int. Conf. High Energy Accelerators and Instrumentation, 1959
Parameter space representation
• A line in the image corresponds to a point in
  Hough space

     Image space               Hough parameter space




                                             Source: S. Seitz
Parameter space representation
 • What does a point (x0, y0) in the image space
   map to in the Hough space?


    Image space                 Hough parameter space
Parameter space representation
 • What does a point (x0, y0) in the image space
   map to in the Hough space?
   – Answer: the solutions of b = –x0m + y0
   – This is a line in Hough space
    Image space                      Hough parameter space
Parameter space representation
 • Where is the line that contains both (x0, y0)
   and (x1, y1)?


     Image space                 Hough parameter space

                 (x1, y1)

      (x0, y0)


                                         b = –x1m + y1
Parameter space representation
 • Where is the line that contains both (x0, y0)
   and (x1, y1)?
    – It is the intersection of the lines b = –x0m + y0 and

     Image –x m +
      b = space             y1       Hough parameter space
                 1

                 (x1, y1)

      (x0, y0)


                                             b = –x1m + y1
Parameter space representation
• Problems with the (m,b) space:
  – Unbounded parameter domain
  – Vertical lines require infinite m
Parameter space representation
• Problems with the (m,b) space:
  – Unbounded parameter domain
  – Vertical lines require infinite m
• Alternative: polar representation


                       x cosθ + y sinθ = ρ




 Each point will add a sinusoid in the (θ,ρ) parameter space
Algorithm outline
 • Initialize accumulator H
   to all zeros
 • For each edge point (x,y)      ρ
   in the image
      For θ = 0 to 180
         ρ = x cos θ + y sin θ
         H(θ, ρ) = H(θ, ρ) + 1            θ

      end
   end
 • Find the value(s) of (θ, ρ) where H(θ, ρ) is a
   local maximum
   – The detected line in the image is given by
     ρ = x cos θ + y sin θ
Basic illustration




          features   votes
Other shapes
        Square   Circle
Several lines
A more complicated image




                       http://ostatic.com/files/images/ss_hough.jpg
Effect of noise




        features   votes
Effect of noise




          features                  votes

 • Peak gets fuzzy and hard to locate
Effect of noise
• Number of votes for a line of 20 points with
  increasing noise:
Random points




            features                   votes
• Uniform noise can lead to spurious peaks in the array
Random points
• As the level of uniform noise increases, the
  maximum number of votes increases too:
Dealing with noise
• Choose a good grid / discretization
  – Too coarse: large votes obtained when too many
    different lines correspond to a single bucket
  – Too fine: miss lines because some points that are not
    exactly collinear cast votes for different buckets
• Increment neighboring bins (smoothing in
  accumulator array)
• Try to get rid of irrelevant features
  – Take only edge points with significant gradient
    magnitude
Incorporating image gradients
• Recall: when we detect an
  edge point, we also know its
  gradient direction
• But this means that the line
  is uniquely determined!

• Modified Hough transform:

•     For each edge point (x,y)
        θ = gradient orientation at (x,y)
        ρ = x cos θ + y sin θ
        H(θ, ρ) = H(θ, ρ) + 1
    end
Hough transform for circles
• How many dimensions will the parameter space
  have?
• Given an oriented edge point, what are all
  possible bins that it can vote for?
Hough transform for circles

       image space                               Hough parameter space
y                                                        r


                ( x , y ) + r∇ I ( x , y )



                     (x,y)
                                                                     x
    ( x , y ) − r∇ I ( x , y )


                                             x
                                                  y
Hough transform for circles
 • Conceptually equivalent procedure: for each
   (x,y,r), draw the corresponding circle in the
   image and compute its “support”
            r




                       x

      y
Is this more or less efficient than voting with features?
Finding straight lines

• Another solution: get connected components of
  pixels and check for straightness
Finding line segments using connected
 components
1. Compute canny edges
      –      Compute: gx, gy (DoG in x,y directions)
      –      Compute: theta = atan(gy / gx)
2. Assign each edge to one of 8 directions
3. For each direction d, get edgelets:
      –      find connected components for edge pixels with directions in {d-1, d,
             d+1}
•      Compute straightness and theta of edgelets using eig of x,y 2nd
       moment matrix of their points

                               ∑ ( x − µ x ) ( y − µ y )
                                                                                            Larger eigenvector
   ∑( x − µx )2
M=                                                        [ v, λ] = eig(Μ )
  ∑ ( x − µ x ) ( y − µ y )       ∑( y − µ )                                   θ = atan 2( v(2,2), v(1,2))
                                                   2
                                              y       
                                                       
                                                                                    conf = λ2 / λ1

•      Threshold on straightness, store segment
                                                                                       Slides from Derek Hoiem
1. Image  Canny
2. Canny lines  … straight edges
Comparison




 Hough Transform Method   Connected Components Method

Weitere ähnliche Inhalte

Was ist angesagt?

Content based image retrieval
Content based image retrievalContent based image retrieval
Content based image retrievalrubaiyat11
 
Image super resolution
Image super resolutionImage super resolution
Image super resolutionAkshay Hazare
 
Hough Transform By Md.Nazmul Islam
Hough Transform By Md.Nazmul IslamHough Transform By Md.Nazmul Islam
Hough Transform By Md.Nazmul IslamNazmul Islam
 
Image enhancement techniques
Image enhancement techniques Image enhancement techniques
Image enhancement techniques Arshad khan
 
Morphological image processing
Morphological image processingMorphological image processing
Morphological image processingVinayak Narayanan
 
Morphological image processing
Morphological image processingMorphological image processing
Morphological image processingRaghu Kumar
 
Dental Digital Radiography in Easy to Understand Steps
Dental Digital  Radiography in Easy to Understand StepsDental Digital  Radiography in Easy to Understand Steps
Dental Digital Radiography in Easy to Understand StepsTheresa Nielsen
 
Digital Image Processing: Digital Image Fundamentals
Digital Image Processing: Digital Image FundamentalsDigital Image Processing: Digital Image Fundamentals
Digital Image Processing: Digital Image FundamentalsMostafa G. M. Mostafa
 
Lecture 3 managment of the developing dentition
Lecture 3 managment of the developing dentitionLecture 3 managment of the developing dentition
Lecture 3 managment of the developing dentitionMohanad Elsherif
 
Image segmentation 2
Image segmentation 2 Image segmentation 2
Image segmentation 2 Rumah Belajar
 
Super Resolution
Super ResolutionSuper Resolution
Super Resolutionalokahuti
 
ppt on region segmentation by AJAY KUMAR SINGH (NITK)
ppt on region segmentation by AJAY KUMAR SINGH (NITK)ppt on region segmentation by AJAY KUMAR SINGH (NITK)
ppt on region segmentation by AJAY KUMAR SINGH (NITK)Ajay Kumar Singh
 
Basics of edge detection and forier transform
Basics of edge detection and forier transformBasics of edge detection and forier transform
Basics of edge detection and forier transformSimranjit Singh
 
Filtering an image is to apply a convolution
Filtering an image is to apply a convolutionFiltering an image is to apply a convolution
Filtering an image is to apply a convolutionAbhishek Mukherjee
 
IMAGE SEGMENTATION BY USING THRESHOLDING TECHNIQUES FOR MEDICAL IMAGES
IMAGE SEGMENTATION BY USING THRESHOLDING TECHNIQUES FOR MEDICAL IMAGESIMAGE SEGMENTATION BY USING THRESHOLDING TECHNIQUES FOR MEDICAL IMAGES
IMAGE SEGMENTATION BY USING THRESHOLDING TECHNIQUES FOR MEDICAL IMAGEScseij
 

Was ist angesagt? (20)

Content based image retrieval
Content based image retrievalContent based image retrieval
Content based image retrieval
 
Hog and sift
Hog and siftHog and sift
Hog and sift
 
Image super resolution
Image super resolutionImage super resolution
Image super resolution
 
SIFT
SIFTSIFT
SIFT
 
Hough Transform By Md.Nazmul Islam
Hough Transform By Md.Nazmul IslamHough Transform By Md.Nazmul Islam
Hough Transform By Md.Nazmul Islam
 
Image enhancement techniques
Image enhancement techniques Image enhancement techniques
Image enhancement techniques
 
color image processing
color image processingcolor image processing
color image processing
 
Lecture-11.pdf
Lecture-11.pdfLecture-11.pdf
Lecture-11.pdf
 
Morphological image processing
Morphological image processingMorphological image processing
Morphological image processing
 
Morphological image processing
Morphological image processingMorphological image processing
Morphological image processing
 
Dental Digital Radiography in Easy to Understand Steps
Dental Digital  Radiography in Easy to Understand StepsDental Digital  Radiography in Easy to Understand Steps
Dental Digital Radiography in Easy to Understand Steps
 
Digital Image Processing: Digital Image Fundamentals
Digital Image Processing: Digital Image FundamentalsDigital Image Processing: Digital Image Fundamentals
Digital Image Processing: Digital Image Fundamentals
 
Lecture 3 managment of the developing dentition
Lecture 3 managment of the developing dentitionLecture 3 managment of the developing dentition
Lecture 3 managment of the developing dentition
 
Image segmentation 2
Image segmentation 2 Image segmentation 2
Image segmentation 2
 
Template Matching
Template MatchingTemplate Matching
Template Matching
 
Super Resolution
Super ResolutionSuper Resolution
Super Resolution
 
ppt on region segmentation by AJAY KUMAR SINGH (NITK)
ppt on region segmentation by AJAY KUMAR SINGH (NITK)ppt on region segmentation by AJAY KUMAR SINGH (NITK)
ppt on region segmentation by AJAY KUMAR SINGH (NITK)
 
Basics of edge detection and forier transform
Basics of edge detection and forier transformBasics of edge detection and forier transform
Basics of edge detection and forier transform
 
Filtering an image is to apply a convolution
Filtering an image is to apply a convolutionFiltering an image is to apply a convolution
Filtering an image is to apply a convolution
 
IMAGE SEGMENTATION BY USING THRESHOLDING TECHNIQUES FOR MEDICAL IMAGES
IMAGE SEGMENTATION BY USING THRESHOLDING TECHNIQUES FOR MEDICAL IMAGESIMAGE SEGMENTATION BY USING THRESHOLDING TECHNIQUES FOR MEDICAL IMAGES
IMAGE SEGMENTATION BY USING THRESHOLDING TECHNIQUES FOR MEDICAL IMAGES
 

Ähnlich wie Edges and lines

Feature Detection and Matching
Feature Detection and MatchingFeature Detection and Matching
Feature Detection and Matchingssuser24ddad
 
Computer vision - edge detection
Computer vision - edge detectionComputer vision - edge detection
Computer vision - edge detectionWael Badawy
 
Chapter10 image segmentation
Chapter10 image segmentationChapter10 image segmentation
Chapter10 image segmentationasodariyabhavesh
 
Lecture 6-computer vision features descriptors matching
Lecture 6-computer vision features descriptors matchingLecture 6-computer vision features descriptors matching
Lecture 6-computer vision features descriptors matchingcairo university
 
Computer Vision harris
Computer Vision harrisComputer Vision harris
Computer Vision harrisWael Badawy
 
09 cie552 image_featuresi
09 cie552 image_featuresi09 cie552 image_featuresi
09 cie552 image_featuresiElsayed Hemayed
 
Basics of Linear Hough Transform
Basics of Linear Hough TransformBasics of Linear Hough Transform
Basics of Linear Hough TransformRaj Rana
 
image segmentation image segmentation.pptx
image segmentation image segmentation.pptximage segmentation image segmentation.pptx
image segmentation image segmentation.pptxNaveenKumar5162
 
06 image features
06 image features06 image features
06 image featuresankit_ppt
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and SegmentationA B Shinde
 
Edge linking via Hough transform.ppt
Edge linking via Hough transform.pptEdge linking via Hough transform.ppt
Edge linking via Hough transform.pptSivaSankar306103
 
Computer Vision invariance
Computer Vision invarianceComputer Vision invariance
Computer Vision invarianceWael Badawy
 

Ähnlich wie Edges and lines (20)

Lec06 edge
Lec06 edgeLec06 edge
Lec06 edge
 
Feature Detection and Matching
Feature Detection and MatchingFeature Detection and Matching
Feature Detection and Matching
 
Computer vision - edge detection
Computer vision - edge detectionComputer vision - edge detection
Computer vision - edge detection
 
Lec09 hough
Lec09 houghLec09 hough
Lec09 hough
 
Lec05 filter
Lec05 filterLec05 filter
Lec05 filter
 
Chapter10 image segmentation
Chapter10 image segmentationChapter10 image segmentation
Chapter10 image segmentation
 
cv1.ppt
cv1.pptcv1.ppt
cv1.ppt
 
Lecture 6-computer vision features descriptors matching
Lecture 6-computer vision features descriptors matchingLecture 6-computer vision features descriptors matching
Lecture 6-computer vision features descriptors matching
 
Computer Vision harris
Computer Vision harrisComputer Vision harris
Computer Vision harris
 
09 cie552 image_featuresi
09 cie552 image_featuresi09 cie552 image_featuresi
09 cie552 image_featuresi
 
Basics of Linear Hough Transform
Basics of Linear Hough TransformBasics of Linear Hough Transform
Basics of Linear Hough Transform
 
Lec03 light
Lec03 lightLec03 light
Lec03 light
 
image segmentation image segmentation.pptx
image segmentation image segmentation.pptximage segmentation image segmentation.pptx
image segmentation image segmentation.pptx
 
06 image features
06 image features06 image features
06 image features
 
16 17 bag_words
16 17 bag_words16 17 bag_words
16 17 bag_words
 
PPT s06-machine vision-s2
PPT s06-machine vision-s2PPT s06-machine vision-s2
PPT s06-machine vision-s2
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and Segmentation
 
Edge linking via Hough transform.ppt
Edge linking via Hough transform.pptEdge linking via Hough transform.ppt
Edge linking via Hough transform.ppt
 
Computer Vision invariance
Computer Vision invarianceComputer Vision invariance
Computer Vision invariance
 
Module 31
Module 31Module 31
Module 31
 

Kürzlich hochgeladen

DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 

Kürzlich hochgeladen (20)

DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 

Edges and lines

  • 2. Edge detection • Goal: Identify sudden changes (discontinuities) in an image – Intuitively, most semantic and shape information from the image can be encoded in the edges – More compact than pixels • Ideal: artist’s line drawing (but artist is also using object-level knowledge) Source: D. Lowe
  • 3. Why do we care about edges? • Extract information, recognize objects Vertical vanishing point (at infinity) Vanishing • Recover geometry and line viewpoint Vanishing Vanishing point point
  • 4. Origin of Edges surface normal discontinuity depth discontinuity surface color discontinuity illumination discontinuity • Edges are caused by a variety of factors Source: Steve Seitz
  • 5. Closeup of edges Source: D. Hoiem
  • 6. Closeup of edges Source: D. Hoiem
  • 7. Closeup of edges Source: D. Hoiem
  • 8. Closeup of edges Source: D. Hoiem
  • 9. Characterizing edges • An edge is a place of rapid change in the image intensity function intensity function image (along horizontal scanline) first derivative edges correspond to extrema of derivative
  • 10. With a little Gaussian noise Gradient Source: D. Hoiem
  • 11. Effects of noise • Consider a single row or column of the image – Plotting intensity as a function of position gives a signal Where is the edge? Source: S. Seitz
  • 12. Effects of noise • Difference filters respond strongly to noise – Image noise results in pixels that look very different from their neighbors – Generally, the larger the noise the stronger the response • What can we do about it? Source: D. Forsyth
  • 13. Solution: smooth first f g f*g d ( f ∗ g) dx d • To find edges, look for peaks in ( f ∗ g) dx Source: S. Seitz
  • 14. Derivative theorem of convolution • Differentiation is convolution, and convolution is d d associative: ( f ∗ g) = f ∗ g dx dx • This saves us one operation: f d g dx d f∗ g dx Source: S. Seitz
  • 15. Derivative of Gaussian filter * [1 -1] =
  • 16. Tradeoff between smoothing and localization 1 pixel 3 pixels 7 pixels • Smoothed derivative removes noise, but blurs edge. Also finds edges at different “scales”. Source: D. Forsyth
  • 17. Designing an edge detector • Criteria for a good edge detector: – Good detection: the optimal detector should find all real edges, ignoring noise or other artifacts – Good localization • the edges detected must be as close as possible to the true edges • the detector must return one point only for each true edge point • Cues of edge detection – Differences in color, intensity, or texture across the boundary – Continuity and closure – High-level knowledge Source: L. Fei-Fei
  • 18. Canny edge detector • This is probably the most widely used edge detector in computer vision • Theoretical model: step-edges corrupted by additive Gaussian noise • Canny has shown that the first derivative of the Gaussian closely approximates the operator that optimizes the product of signal- to-noise ratio and localization J. Canny, A Computational Approach To Edge Detection, IEEE Trans. Pattern Analysis and Machine Intelligence, 8:679-714, 1986. Source: L. Fei-Fei
  • 19. Example original image (Lena)
  • 20. Derivative of Gaussian filter x-direction y-direction
  • 21. Compute Gradients (DoG) X-Derivative of Gaussian Y-Derivative of Gaussian Gradient Magnitude
  • 22. Get Orientation at Each Pixel • Threshold at minimum level • Get orientation theta = atan2(gy, gx)
  • 23. Non-maximum suppression for each orientation At q, we have a maximum if the value is larger than those at both p and at r. Interpolate to get these values. Source: D. Forsyth
  • 26. Hysteresis thresholding • Threshold at low/high levels to get weak/strong edge pixels • Do connected components, starting from strong edge pixels
  • 27. Hysteresis thresholding • Check that maximum value of gradient value is sufficiently large – drop-outs? use hysteresis • use a high threshold to start edge curves and a low threshold to continue them. Source: S. Seitz
  • 29. Canny edge detector 1. Filter image with x, y derivatives of Gaussian 2. Find magnitude and orientation of gradient 3. Non-maximum suppression: – Thin multi-pixel wide “ridges” down to single pixel width 4. Thresholding and linking (hysteresis): – Define two thresholds: low and high – Use the high threshold to start edge curves and the low threshold to continue them • MATLAB: edge(image, ‘canny’) Source: D. Lowe, L. Fei-Fei
  • 30. Effect of σ (Gaussian kernel spread/size) original Canny with Canny with The choice of σ depends on desired behavior • large σ detects large scale edges • small σ detects fine features Source: S. Seitz
  • 31. Learning to detect boundaries image human segmentation gradient magnitude • Berkeley segmentation database: http://www.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/segbench/
  • 32. Finding straight lines • One solution: try many possible lines and see how many points each line passes through • Hough transform provides a fast way to do this
  • 33. Hough transform • An early type of voting scheme • General outline: – Discretize parameter space into bins – For each feature point in the image, put a vote in every bin in the parameter space that could have generated this point – Find bins that have the most votes Image space Hough parameter space P.V.C. Hough, Machine Analysis of Bubble Chamber Pictures, Proc. Int. Conf. High Energy Accelerators and Instrumentation, 1959
  • 34. Parameter space representation • A line in the image corresponds to a point in Hough space Image space Hough parameter space Source: S. Seitz
  • 35. Parameter space representation • What does a point (x0, y0) in the image space map to in the Hough space? Image space Hough parameter space
  • 36. Parameter space representation • What does a point (x0, y0) in the image space map to in the Hough space? – Answer: the solutions of b = –x0m + y0 – This is a line in Hough space Image space Hough parameter space
  • 37. Parameter space representation • Where is the line that contains both (x0, y0) and (x1, y1)? Image space Hough parameter space (x1, y1) (x0, y0) b = –x1m + y1
  • 38. Parameter space representation • Where is the line that contains both (x0, y0) and (x1, y1)? – It is the intersection of the lines b = –x0m + y0 and Image –x m + b = space y1 Hough parameter space 1 (x1, y1) (x0, y0) b = –x1m + y1
  • 39. Parameter space representation • Problems with the (m,b) space: – Unbounded parameter domain – Vertical lines require infinite m
  • 40. Parameter space representation • Problems with the (m,b) space: – Unbounded parameter domain – Vertical lines require infinite m • Alternative: polar representation x cosθ + y sinθ = ρ Each point will add a sinusoid in the (θ,ρ) parameter space
  • 41. Algorithm outline • Initialize accumulator H to all zeros • For each edge point (x,y) ρ in the image For θ = 0 to 180 ρ = x cos θ + y sin θ H(θ, ρ) = H(θ, ρ) + 1 θ end end • Find the value(s) of (θ, ρ) where H(θ, ρ) is a local maximum – The detected line in the image is given by ρ = x cos θ + y sin θ
  • 42. Basic illustration features votes
  • 43. Other shapes Square Circle
  • 45. A more complicated image http://ostatic.com/files/images/ss_hough.jpg
  • 46. Effect of noise features votes
  • 47. Effect of noise features votes • Peak gets fuzzy and hard to locate
  • 48. Effect of noise • Number of votes for a line of 20 points with increasing noise:
  • 49. Random points features votes • Uniform noise can lead to spurious peaks in the array
  • 50. Random points • As the level of uniform noise increases, the maximum number of votes increases too:
  • 51. Dealing with noise • Choose a good grid / discretization – Too coarse: large votes obtained when too many different lines correspond to a single bucket – Too fine: miss lines because some points that are not exactly collinear cast votes for different buckets • Increment neighboring bins (smoothing in accumulator array) • Try to get rid of irrelevant features – Take only edge points with significant gradient magnitude
  • 52. Incorporating image gradients • Recall: when we detect an edge point, we also know its gradient direction • But this means that the line is uniquely determined! • Modified Hough transform: • For each edge point (x,y) θ = gradient orientation at (x,y) ρ = x cos θ + y sin θ H(θ, ρ) = H(θ, ρ) + 1 end
  • 53. Hough transform for circles • How many dimensions will the parameter space have? • Given an oriented edge point, what are all possible bins that it can vote for?
  • 54. Hough transform for circles image space Hough parameter space y r ( x , y ) + r∇ I ( x , y ) (x,y) x ( x , y ) − r∇ I ( x , y ) x y
  • 55. Hough transform for circles • Conceptually equivalent procedure: for each (x,y,r), draw the corresponding circle in the image and compute its “support” r x y Is this more or less efficient than voting with features?
  • 56. Finding straight lines • Another solution: get connected components of pixels and check for straightness
  • 57. Finding line segments using connected components 1. Compute canny edges – Compute: gx, gy (DoG in x,y directions) – Compute: theta = atan(gy / gx) 2. Assign each edge to one of 8 directions 3. For each direction d, get edgelets: – find connected components for edge pixels with directions in {d-1, d, d+1} • Compute straightness and theta of edgelets using eig of x,y 2nd moment matrix of their points ∑ ( x − µ x ) ( y − µ y ) Larger eigenvector  ∑( x − µx )2 M=  [ v, λ] = eig(Μ ) ∑ ( x − µ x ) ( y − µ y ) ∑( y − µ ) θ = atan 2( v(2,2), v(1,2)) 2  y   conf = λ2 / λ1 • Threshold on straightness, store segment Slides from Derek Hoiem
  • 58. 1. Image  Canny
  • 59. 2. Canny lines  … straight edges
  • 60. Comparison Hough Transform Method Connected Components Method

Hinweis der Redaktion

  1. How to fix?
  2. Is this filter separable?
  3. Figure 15.1, top half. Note that most points in the vote array are very dark, because they get only one vote.
  4. This is 15.1 lower half
  5. This is 15.1 lower half
  6. This is the number of votes that the real line of 20 points gets with increasing noise (figure15.3)
  7. 15.2; main point is that lots of noise can lead to large peaks in the array
  8. Figure 15.4; as the noise increases in a picture without a line, the number of points in the max cell goes up, too