Introduction to ASMLibrary


Active Shape Model Library (ASMLibrary©) SDK, which is is developped under OpenCV for face alignment and face tracking. ASMLibrary supports and runs on Windows, Linux, MacOSX and Android platforms.

When you build ASM model, you must have an image database associated with its annotation files. ASMlibrary supports asf and pts format. For pts, you can refer to BioId、XM2VTS、FGNet databases annotated by Time Cootes. For asf, please refer to IMM database annotated by Mikkel Stegmann. Generally speaking, The database should contain at least several hundreds images.

Anyone who has the problem can goto the Google Group and let your question there.


A Quick Tutorial

Build active shape models

Usage: build [options] train_path image_ext point_ext cascade_name model_file 
  • Build asmmodel from 240-images of imm-database which you can download from Stagmman’s homepage.

    build -i 0 -p 3 -l 8 -t 0.98 ../immdatabase bmp asf haarcascade_frontalface_alt2.xml aamapi.amf

  • Build asmmodel from FRANCK-database which you can download from Cootes’s homepage.

    build -i 1 -p 4 -l 8 ../franck jpg pts haarcascade_frontalface_alt2.xml franck.amf

Fit using active shape models

Usage: fit -m model_file -h cascade_file {-i image_file | -v video_file | -c camara_idx} -n n_iteration
  • Image alignment on an image using 30 iterations

    fit -m my.amf -h haarcascade_frontalface_alt2.xml -i aa.jpg -n 30

  • Face tracking on a video file

    fit -m my.amf -h haarcascade_frontalface_alt2.xml -v bb.avi -n 25

  • Face tracking on live camara

    fit -m my.amf -h haarcascade_frontalface_alt2.xml -c 0


Stable version:asmlibrary-6.0.tar.gz

View source code at

Your donation will help me to improve ASMLibrary. You can donate via PayPal .



训练模型之前,确保你拥有一个图像数据库以及对应于该图像数据库的标定文件库。所谓的图像标定指对图像进行点的标定,指示了相关特征点的具体坐标位置,支持的文件格式有pts和asf,pts的示例可以参看Time Cootes对BioId、XM2VTS、FGNet等数据库的标定;asf的示例可以参看Mikkel Stegmann对IMM图像库进行的标定。 一般而言,标定图像数据库的规模在几百张就可以了。




blog comments powered by Disqus
Copyright © 2013-2016 All Rights Reserved by greatyao. Powered by Jekyll, Themed by codepiano, Hosted on Github.