Revision 30c1737950c14e02f59bd97946d56a08b48716e9 (click the page title to view the current version)

Corner Detection

Briefing

Corners and Feature Points

Differentiation

Harris Feature Detector

Exercises

We need an image to work with, you can either load an image from disk or capture a new image from the webcam with the below code.

As we will be working with a lot of different images in this exercise, it is recommended to save it to disk, we can do that with

As we will be working with gray-scale images, we need to convert the image

The first part of the exercise is to implement a Sobel-filter, we recall from the theory that we need to implement two 3x3 kernels to convolve with the original image.

This can be done using scipy.signal.convolve2d ( https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.convolve2d.html ) (Note: For a larger challenge you can also try implementing your own algorithm for the convolve function using numpy)

If you haven’t already, run ‘pip install scipy’.

Hint (Click to expand) Note: Use signal.convolve2d(, , boundary=‘symm’, mode=‘same’)

Code answers from here on will be collapsed, we recommend that you try to implement them yourself before reading an answer.

Answer (Click to expand)

You should then show the images using cv.imshow or save using cv.imwrite, as we did earlier Discuss what you see.

You can compare the results of your implementation with the built in function cv.Sobel

Debrief