Active contours are a method of image segmentation. They are well-loved for their accuracy, ease of implementation, and nice mathematical underpinnings. However, a full level-set implementation can be quite slow, especially when dealing with large data! Here are some tips to speed things up. By combining these ideas and solid programming techniques I’ve been able to get active contour trackers running at hundreds of frames per second!

  1. Use Fast Level-Sets
  2. Start by using a fast level-sets implementation that minimizes the number of required computations [code]. This will already save a huge number of computations per iteration and speed things up quite a bit!

  3. Create better initializations.
  4. The farther the initial contour is from its final position, the more computations must be done for the contour to converge. Hence, if you can start the contour in almost the right place, you’ll drastically reduce the time needed for segmentation. You can use prior knowledge, user input, or other segmentation techniques to create a rough guess that is close to the right answer. Another initialization that can leads to quick initialization is ‘bubbles’ on an evenly-spaced grid.

  5. Use a multi-scale approach.
  6. This is a way to quickly get good initializations using active contours. Say your data is MxN. Instead of segmenting the full data set, downsample the data so that you are dealing with an (M/8)x(N/8) volume. The segmentation should run much quicker on the smaller volume. Next, upsample the result back to MxN and use this as an initialization for the full data. The idea is that the time saved on the full segmentation by having a good estimate based on downsampled data will make up for the time needed to downsample, segment on the small data, and upsample.

  7. Use approximate active contours.
  8. Using an approximate solution for all or part of your segmentation can be helpful. As in 2 and 3, you can use an approximate active contour technique to quickly get close to the right answer. Then you can use an accurate level sets implementation to get the right answer quickly. Alternatively, the discrete methods can work quite well alone! James Malcolm proposed a nice method in “Fast Approximate Surface Evolution in Arbitrary Dimension” [code].

  9. Use another technique entirely.
  10. Active contours are “variational,” so they give nice, principled solutions with analytic geometry, etc. However, if you just want fast segmentations, other techniques such as thresholding/morphology, graph cuts, region growing, etc. can all be viable solutions.

Any other tips or links to good implementations? Leave them in the comments.

2 thoughts on “Making Active Contours Fast

  1. j’ai besoin d’aide sur mon projet de fin d’etude sur la segmentation d’image par contour actif

  2. Hi Shawn

    this might be a dumb question, but I’m new to Matlab. I’m trying the grow cut segmentation, but dont know how to do the initialization, could you help me out


Leave a Reply

Your email address will not be published.