This article is written by Chethan Parameshwara. Please contact Chethan Parameshwara if there are any errors.

Table of Contents:


11:59PM, Tuesday, Feb 19, 2019


Have you ever played with these adorable Nao robots? Click on the image to watch a cool demo.

 Nao robot demo

Nao robots are star players in RoboCup, an annual autonomous robot soccer competitions. We are planning to build the Maryland RoboCup team to compete in RoboCup 2019, we need your help. Would you like to help us in Nao’s soccer training? We need to train Nao to detect a soccer ball and estimate the depth of the ball to know how far to kick.

Nao’s training has two phases:

  • Color Segmentation using Gaussian Mixture Model (GMM)
  • Ball Distance Estimation

What you need to do

To make logistics easier, we have collected camera data from Nao robot on behalf of you and saved the data in the form of color images. Click here to download. The image names represent the depth of the ball from Nao robot in centimeters. The test dataset is here to download.

Problem Statement

  1. Prepare the data: Extract the regions of the ball from each of the training images. For example, you can use the roipoly function to do so. The image points obtained this way are the data that you will use to train your color model.
  2. Write MATLAB code to cluster the orange ball using a Single Gaussian [30 points]
  3. Write MATLAB code to cluster the orange ball using a Gaussian Mixture Model [40 points] and estimate the distance to the ball [20 points]. Also, plot all the GMM ellipsoids [10 points].

You are NOT allowed to use any built-in MATLAB function(s) like fitgmdist() or for GMM. To help you with code implementation, we have given the pseudocode :-)

Submission Guidelines

We will deduct points if your submission does not comply with the following guidelines.

Please submit the project once for your group – there’s no need for each member to submit it.

File tree and naming

Your submission on Canvas must be a zip file, following the naming convention For example, The file must have the following directory structure.

  • train_images/.
  • test_images/.
  • results/.
  • GMM.m
  • trainGMM.m
  • testGMM.m
  • measureDepth.m
  • plotGMM.m
  • report.pdf


Logistics and bookkeeping you must include at the top of your report (-5 points for each one that’s missing):

  • The name of each group member.
  • A brief (one paragraph or less) description of what each group member contributed to the project.

For each section of the project, explain briefly what you did, and describe any interesting problems you encountered and/or solutions you implemented. You must include the following details in your writeup:

  • Your choice of color space, initialization method and number of gaussians in the GMM.
  • Explain why GMM is better than a single gaussian.
  • Present your distance estimate and cluster segmentation results for each test image.
  • Explain strengths and limitations of your algorithm. Also, explain why the algorithm failed on some test images.

As usual, your report must be full English sentences, not commented code. There is a word limit of 1500 words and no minimum length requirement

Collaboration Policy

You are encouraged to discuss the ideas with your peers. However, the code should be your own, and should be the result of you exercising your own understanding of it. If you reference anyone else’s code in writing your project, you must properly cite it in your code (in comments) and your writeup. For the full honor code refer to the CMSC426 Fall 2018 website.