[](https://www.mathworks.com/matlabcentral/fileexchange/38358-active-geometric-shape-models)
6. [Copyright and Citation](#copyright-and-citation)
7. [Version History](#version-history)
---
## Overview
This software implements **Active Geometric Shape Models (AGSM)** for robust feature extraction and shape fitting. It supports:
- Line fitting
- Circle fitting
- Ellipse fitting
- Cubic spline fitting
AGSM leverages Gradient Vector Flow (GVF) and iterative force-based optimization to fit geometric primitives and flexible contours to image data.

## Installation
### Prerequisites
- MATLAB or GNU Octave
- C++ Compiler (for MEX file compilation)
### Compilation
Before using the library, you must compile the C++ MEX files. Run the `compile.m` script located in the `code` directory:
```matlab
cd code
compile
```
## Usage
The library includes several demo scripts to illustrate how to use the different fitting modules. You can find them in their respective directories under `code/`:
Quan Wang (2026). Active geometric shape models (https://in.mathworks.com/matlabcentral/fileexchange/38358-active-geometric-shape-models), MATLAB Central File Exchange.
Retrieved .
Wang, Quan, and Kim L. Boyer. “The Active Geometric Shape Model: A New Robust Deformable Shape Model and Its Applications.” Computer Vision and Image Understanding, vol. 116, no. 12, Elsevier BV, Dec. 2012, pp. 1178–94, doi:10.1016/j.cviu.2012.08.004.
Wang, Quan, and Kim L. Boyer. “The Active Geometric Shape Model: A New Robust Deformable Shape Model and Its Applications.” Computer Vision and Image Understanding, vol. 116, no. 12, Elsevier BV, Dec. 2012, pp. 1178–94, doi:10.1016/j.cviu.2012.08.004.
APA
Wang, Q., & Boyer, K. L. (2012). The active geometric shape model: A new robust deformable shape model and its applications. Computer Vision and Image Understanding, 116(12), 1178–1194. Elsevier BV. Retrieved from https://doi.org/10.1016%2Fj.cviu.2012.08.004
BibTeX
@article{Wang_2012,
doi = {10.1016/j.cviu.2012.08.004},
url = {https://doi.org/10.1016%2Fj.cviu.2012.08.004},
year = 2012,
month = {dec},
publisher = {Elsevier {BV}},
volume = {116},
number = {12},
pages = {1178--1194},
author = {Quan Wang and Kim L. Boyer},
title = {The active geometric shape model: A new robust deformable shape model and its applications},
journal = {Computer Vision and Image Understanding}
}
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.