Python for MATLAB Users: Promoting Open Source Computer Vision Research

Thursday, June 21, 2012


  • Matt Leotta (Kitware, Inc., USA)
  • Amitha Perera (Kitware, Inc., USA)
  • Eran Swears (Kitware, Inc., USA)
  • Patrick Reynolds (Kitware, Inc., USA)
  • Yong Zhao (Google Research)
  • Varun Ganapathi (Google Research)

Course Description

This tutorial is a hands-on introduction to using Python for rapid prototyping and computer vision research. Python is presented from a MATLAB user’s point of view, showing how to directly map the familiar MATLAB syntax and workflow to a very similar syntax and workflow in Python. The goal of the tutorial is to provide a free and open source alternative to MATLAB to promote open science and to better prepare students for careers outside of academia.

The target audience is students, professors, researchers, and software developers who are interested in using Python for computer vision research. In particular, there is an orientation toward developers who primarily use MATLAB for computer vision applications. While the focus is on replicating a MATLAB-like work flow using open source software, attendees are not strictly required to have MATLAB experience. Attendees are required to have some prior programming experience as well as basic familiarity with linear algebra and common computer vision algorithms.

This is a full day tutorial divided into a morning and an afternoon session. The morning session provides an introduction to Python and focuses on migrating from MATLAB to Python for general scientific computing. The afternoon session focuses more on application of Python to computer vision problems, using third party computer vision libraries, and other advanced topics.

Attendees who would like to participate should bring a laptop. Participating attendees will receive USB stick containing a virtual appliance (VirtualBox) with the full scientific Python environment pre-configured, and will execute programming exercises ranging from the introductory level to the intermediate level. Attendees wishing to participate are strongly encouraged to attend both morning and afternoon sessions.


MATLAB has long been the language of choice for rapid development in much of the computer vision community. It has a simple, easy to learn syntax. Its matrix-centric data structures are well suited to representing and manipulating images. MATLAB comes with a large number of built-in algorithms for numerical computing, image processing, and signal processing. Its IDE allows for interactive experimentation, introspection, and plotting. Academic licensing at most universities makes MATLAB effectively free for use in research and as a platform for teaching computer vision. It is a powerful tool and its popularity in the field is well deserved.

Unfortunately, MATLAB is not a free and open source solution. Outside of academic institutions, MATLAB is often prohibitively expensive. Many private research institutions avoid MATLAB development and maintain a limited number of MATLAB licenses for running 3rd party code. This means that students who are taught computer vision through MATLAB are often unprepared for jobs outside of academia. Furthermore, MATLAB licensing inhibits open scientific collaboration. Research code written in MATLAB can be shared, but the cost of MATLAB licensing limits the number of researcher who can run that code.

Open source alternatives to MATLAB have had a large upswing is recent years. Tools such as Octave and SciLab aim to provide an open source analog to MATLAB, but have relatively small user communities. On the other hand, Python is a powerful open source, interpreted language that has enjoyed broad adaption in a large variety of application areas. Python itself is not a MATLAB replacement, but additional modules have been developed for Scientific computing (NumPy/SciPy), plotting (matplotlib, guiqwt), and IDE (Spyder). These libraries are designed to make Python as capable as MATLAB for computer vision research. The plethora of other libraries available for Python make it more capable than MATLAB in many ways.

The aim of this tutorial is to teach MATLAB users how to migrate their familiar interactive, matrix-based, work flow to Python. We hope these ideas will trickle back into academia and reduce the dependency of computer vision research on proprietary software. This will both promote open science and better prepare students for jobs outside of academia.

Syllabus and Schedule

Morning Session

  • Virtual Appliance Setup (for hands on participants)
  • Overview of Python and other open source MATLAB alternatives
  • Introduction to the Python language
  • Python for Scientific Computing
  • NumPy
  • SciPy
  • Matplotlib
  • Using the Spyder Python IDE

Afternoon Session

  • Python for Computer Vision
  • Basic image I/O
  • Basic image processing using NumPy/SciPy
  • discussion of 3rd party libraries for vision, machine learning, etc.
  • working with SimpleITK
  • working with OpenCV
  • Parallel Processing with Python
  • Distributing over multiple processes
  • Using OpenCL for heterogeneous computing
  • Interfacing Python with other languages
  • Calling legacy MATLAB code from Python
  • Wrapping C/C++ code for Python

Physical Event

Providence Rhode Island Convention Center
1 Sabin St, Providence, RI 02903

IEEE Computer Society