All Code is Free for Download, Reuse, and Modification

Hierarchical Mean Shift, Space-Time Segmentation and Action Recognition (Matlab)
Author: Daniel DeMenthon
Date: 2002 - 2003

This package contains the Matlab code developed to implement the video retrieval method described in the paper by Daniel DeMenthon and David Doermann, "Video Retrieval of Near-Duplicates using k-Nearest Neighbor Retrieval of Spatio-Temporal Descriptors". Multimedia Tools and Applications (MTAP), pp. 229-253, vol. 30, no. 3, Sept. 2006.
Download zipped package (15 MB).
Note that the Matlab code calls several mex files. The C code provided for these files will probably need to be recompiled into mex files appropriate for your CPU. In addition, the Matlab code uses nearest neighbor and range search functions nn_prepare, nn_search and range_search. The source code and mex files for these three functions can be downloaded as part of the excellent TSTOOL package.

LAMP_HMM v. 0.9 (C++)
Authors: Daniel DeMenthon and Marc Vuilleumier
Date: Feb. 1999 - Revised Jan. 2003

This package contains C++ code for applying Hidden Markov Models (HMMs) to files of observation data. We used Tapas Kanungo's HMM C code as a starting point.

Main upgrades from Tapas Kanungo's code:

1. Observations can be vectors.

2. Components of an observation vector can use different numbers of symbols.

3. Observation probabilities can be modeled by histograms or by Gaussians.

4. Training can be accomplished by multiple observation sequences, defined in a file.

5. State durations can be modeled explicitly by Gamma distributions.

6. In addition to the Baum-Welch method, the much faster segmental k-means method can be selected for training.

Download tar gzipped package (260 KB).

Download zipped package (276 KB).

POSIT (C and Matlab)
Author: Daniel DeMenthon
Date: 1993 - 2003

POSIT is a fast iterative algorithm for finding the pose (rotation and translation) of an object or scene with respect to a camera when points of the object are given in some object coordinate system and these points are visible in the camera image and recognizable, so that corresponding image points and object points can be listed in the same order. This method is described in "Model-Based Object Pose in 25 Lines of Code" IJCV 15, pp. 123-141, 1995 (see below). Here is a Matlab version of the Mathematica Posit code of the paper:

Display text file of classicPOSIT.m code (4 KB).

Here is a version of Matlab POSIT using projective geometry that does not require the origin of the object coordinate system to be one of the image points of the image. This approach was described first in the appendix of the paper "Recognition and Tracking of 3D Objects by 1D Search", Proc. Image Understanding Workshop, Washington, DC, pp. 653-659, 1993. This approach is also described in more details in the IJCV 2004 SoftPOSIT paper.

Display text file of modernPOSIT.m code (4 KB).

Here is an early implementation of POSIT in C, including test files for image points and object points:

Download C code for POSIT (zipped package, 12 KB).

Also note that a C implementation of POSIT is included in the OpenCV Image Processing Library and available at

POSIT for Coplanar Points (C)
Authors: Denis Oberkampf and Daniel DeMenthon
Date: 1996 - 2004

This is the code for the algorithm described in the CVIU (ex-CVGIP) paper "Iterative Pose Estimation using Coplanar Feature Points". It was used in particular for recovering the pose of a camera taking pictures of the Mall from the top of the Washington Monument, using a map of Washington, DC as a planar model, as described in that paper.

Download POSIT C code for coplanar points (zipped package, 15 KB).

SoftPOSIT v. 0.9 (Matlab)
Authors: Daniel DeMenthon and Philip David
Date: 2001 - 2003

SoftPOSIT is an algorithm for determining the pose of a 3D object from a single 2D image in the case that correspondences between model features and image features are unknown. Here is the Matlab code for the SoftPOSIT algorithm for feature points. Details of the approach are described in the SoftPOSIT papers available below.

Display text file of SoftPOSIT code (52 KB).


Updated August 2009