CSCI 507 / EENG 507 - HW6

Quick Reference

  • Due date: Monday, November 26th by the beginning of class.
  • Submission: Submission must be made on Canvas
  • Format: Your submission will consist of two files: (1) a matlab or C++ file (or tar/zip/archive of code), and (2) a PDF file. Please upload these as two seperate files – do not group both code and report into the same tar/zip/archive.

1 Assignment (100 pts)

The video “checkers.mp4” is on the course website. It is a short clip that shows a game of checkers. Process every 10th image from the video. In each of these images, try to recognize the board and find the pieces. Note that you may not be able to find the board in each image. Even if you find the board, you may not correctly detect all the pieces. However, by processing all the images in the clip, we can accumulate all the detections and get a better idea of where they are.

After processing the entire clip, record the number of times that you detected a white piece and the number of times you detected a black piece in each of the 8x8 squares. Pick a threshold such that if the count is equal to or higher than the threshold, then you decide that the square contains the appropriate color piece.

  • Your program code.
  • A description of your method of solution and the architecture of the program.
  • The 8x8 matrices of counts for detections of white pieces and detections of black pieces, and the threshold you used.
  • One image from the clip, with a border drawn around the outside of the checkerboard to show that you found the board correctly. An example is shown below.
  • One “orthophoto” of the board from the clip, overlaid with symbols showing the locations of the final detected pieces. Use one type of symbol for a detected white piece, and a different symbol for a detected black piece. An example is shown below.



  • The Matlab code “findCheckerBoard” we'll develop in class can be used to find the checkerboard.
  • The Matlab function that finds circles using the Hough transform may be helpful in finding the pieces. Note that black pieces are difficult to find, because the contrast with the black square is so low. You may have to lower the edge threshold and raise the detection sensitivity (see the documentation on the circle finding function). Also note that this function takes a grayscale image as input, not an edge image.
  • Once you have found candidate pieces, you will have to decide if the piece is white or black. A single fixed intensity threshold may not work since the lighting varies across the image. One possible way to do it is to compare the intensity of the pixels just inside the circle against the intensity of the pixels just outside – white pieces should have a much larger contrast against the local background. A function to calculate this difference is available here.
  • Given a circle of radius R0, this function computes the average difference between the pixels inside the ring [R0+dR, R0+2*dR] and the ring [R0-dR, R0-2*dR].


2 Turn in

  1. Your MATLAB or C++ program listing, with comments.
  2. A PDF file containing all other deliverables.