Revision d63b2213b8630dea5d9fac62329b2133b2a19d6e (click the page title to view the current version)

Edges

Changes from d63b2213b8630dea5d9fac62329b2133b2a19d6e to f393fe798807b54f660e478d2ffc8c76df70415d

---
title: Edge Detection
categories: session
---

**Date** 29 September 2021

**Briefing** [Edge Lecture]()

**Reading** Ma (2004) Ch 4.4;
[Canny Edge Detection in OpenCV](https://docs.opencv.org/4.x/da/d22/tutorial_py_canny.html)

# Exercises

## Python API

This is based on Ma (2004) Exercise 4.9, which is written for Matlab.

### The Canny 

1.  Find a test image.
2.  Test the `Canny` edge detector in OpenCV.
    See the [tutorial](https://docs.opencv.org/4.x/da/d22/tutorial_py_canny.html)
    for an example. Experiment with different thresholds.
    See the [docs](https://docs.opencv.org/3.4/dd/d1a/group__imgproc__feature.html#ga04723e007ed888ddf11d9ba04e2232de) for details.
3. 
    for an example. 
    What kind of data does it generate?  What do the data look like?
3.  Experiment with different thresholds and different window sizes
    (apertures).
    See the [docs](https://docs.opencv.org/3.4/dd/d1a/group__imgproc__feature.html#ga04723e007ed888ddf11d9ba04e2232de) 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.

### Hough

## Project

1.  Can you use edge detection in your tracker project?
2.  Is it possible to match the edges to the object you want to track?
3.  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.