Revision 7a7047a1d26936ce134478e9d314c9aea0bd3b04 (click the page title to view the current version)
Edge Detection
Date 29 September 2021
Briefing Edge Lecture
Reading Ma (2004) Ch 4.4; Tutorials on OpenCV: Canny Edge Detection; Hough Circle Transform
Exercises
Python API
This is based on Ma (2004) Exercise 4.9, which is written for Matlab.
The Canny
- Find a test image.
- Test the
Canny
edge detector in OpenCV. See the tutorial for an example. What kind of data does it generate? What do the data look like? - Experiment with different thresholds and different window sizes (apertures). See the docs for overview of the parameters for
Canny
.
It is not difficult to implement your own Canny edge detector. The exercise would be very similar to the Harris corner detector, and add little new.
Connected Components
The edge detector gives a binary image. How can you find collections of pixels forming edges?
You can either,
- implement your own connected components function, using the ideas from the briefing, or
- test the
ConnectedComponents
function in OpenCV.
Visualise the components you find, for instance by using different colours Do they correspond to the objects you see in the image?
Line fitting
- Implement a simple line fitter using the ideas from the briefing.
- Can you identify straight lines among the components?
- Calculate the angle \(\theta\) and the distance \(\rho\) from the origin for each component.
Hough
TODO
Project
- Can you use edge detection in your tracker project?
- Is it possible to match the edges to the object you want to track?
- Can the multiple connected components be used to give an idea about different objects in the scene?
Use the rest of the time to improve the tracker.