GHP Day 3
Programming
Moving forward
I want our daily classes to look like the following:
Session 1 - Warmup, Going over homework, code-along with me in openCV or Pygame
Session 2 - Code-along with me in OpenCV and pygame
Session 3 - Time to work on pygame group project, research presentation
CodingBat Warmup
Let’s warmup and refresh our python by completing these problems
Agenda
OpenCV basics
Colorspaces
There are a lot of different color spaces, but the main ones we’ll use are:
Converting colorspaces
When you load an image using OpenCV, it is automatically set to BGR colorspace
We can convert this to any color space using the cv2.cvtColor() function
Let’s try to convert a few frames from our webcams to gray
Making a simple object tracker
We can use the color space data to create a simple object tracker.
Following this tutorial, we can create a simple tracker based purely on color space.
This is the simplest form of tracking, but has its limitations. What do you think these limitations are?
Pygame - Making a simple game
We’re going to follow this tutorial together to create a simple little game. (download data files from here and add to a data directory)
Your exercise will be to expand this game in some of the following ways:
Pygame - Create a simple game
In groups of up to 4
You are to create a simple game where your player wanders through a maze or a map.
Pygame - Create a simple game
Some ways to divide the responsibilities:
Research Presentation
Your Topic Approval Form was due yesterday
Important dates: