Lab - Edge Detection

Computer Vision (CSCI 4220U)

Faisal Qureshi

Faculty of Science, UOIT

Task 1

The goal of this exercise is for you to use the Open CV's built-in Canny Edge Detector to identify pixels that correspond to edges observed in the image.

Task 2

Secondly, you are asked to color each edge pixel based upon the orientation of the edge passing through it. You can use the color wheel shown below to color the edge pixels.

Recall that it is possible to identify the orientation of an edge based upon \(\frac{\partial I}{\partial x}\) and \(\frac{\partial I}{\partial y}\).

You can define the orientation of an edge (passing through a pixel) using the normal vector of that edge. Specifically the orientation can be defined using the angle between the normal and the horizontal as seen below.

So according to the color wheel above, if a horizontal edge passing through a pixel then that pixel will color either Yellow or Purple depending if the normal makes a 90 degrees with horizontal or 270 degrees with the horizontal.

Below you see an image that shows edges colored based upon their orientation. However, this image doesn't use the color scheme proposed here.

Task 3

As a last step can you construct a histogram of edge pixel orientations seen in the image. For the sake of simplicility you can assume that the histogram consists of 12 bins (each corresponding to a color seen in the color wheel?). You simply need to count all the Red pixels, all the Yellow pixels, etc. and plot the counts as a histogram.

What to submit?

You can complete this task in Python Jupyter Notebook. Submit the notebook.