5062CEM

Programming and Algorithms 2

Computer Vision and OpenCV

Computer Vision and OpenCV

For this activity, you will need to be using an Integrated Development Environment (IDE). The recommended IDE for this module is JetBrains IntelliJ IDEA for Python and JetBrains CLion for C++. You can follow instructions at the following page to set up your development environment:

Setting up your Development Environment

Before you begin to attempt this task, you will need to build the OpenCV libraries to work on your machine. A tutorial has been provided to guide you through the process of building the libraries from source, and can be accessed at the following page:

Compiling the OpenCV Libraries in WSL

The guide assumes you have the Windows Subsystem for Linux (WSL) installed on your Windows device. If you do not, then another tutorial has been provided to guide you through the process of setting up WSL on your machine. You can access the tutorial at the following page. Alternatively, if you have Linux installed on your machine through either a virtual machine or natively, then you can follow the first tutorial and ignore any references to WSL etc.

For the purpose of this task, you will be concerned with loading a static colour image file and changing the colour so it is grayscale. You will be required to display the original and grayscale images in their separate windows, with appropriate names given to the windows.

Note that the windows should be displayed until the Esc key is pressed by the end-user.

For the purpose of this task, you will be concerned with reading the frames from your web camera, or a video file if you do not have a web camera. You will need to display each video frame that is being read in an appropriately named window.

Note, that the window should be displayed until the Esc key is pressed by the end-user.

Once you have implemented this basic functionality, you are then required to calculate the number of frames that are being processed per-second. This number should then be displayed in the top-left corner of the window, overlaying the frame being read from the web-camera.

For this task, you will be expanding upon the work undertaken in task one. You will build upon the code you have developed to work upon a method of detecting an object from a static image.

You are able to use any particular feature detector provided by OpenCV to assist you in the development of your own algorithm for this task. However, you may want to look at some of these useful guides to assist you:

For this task, you will be expanding upon the work undertaken in task two and build upon the knowledge gained from task three. You will merge both aspects of the code you have developed to work upon a method of detecting an object from a video.

You are able to use any particular feature detector provided by OpenCV to assist you in the development of your own algorithm for this task. However, you may want to look at some of these useful guides to assist you:

For the purpose of this task, you want to take the knowledge you have gained from tasks one, two, three and four and implement a script that is able to detect faces from a static image, and video stream (either your webcam or a video file).

You may want to look at some of these useful guides to assist you:

If you are struggling with this lab activity, you may want to get some additional support. You can speak to the module leader/team in the room of when the lab week is active, or you can visit the Additional Support page for more information on how you can get extra support.