INSTITUTE OF PHYSICS PUBLISHING PHYSIOLOGICAL MEASUREMENT Physiol. Meas. 26 (2005) 639–651 doi:10.1088/0967-3334/26/5/006 A template matching algorithm for sperm tracking and classification Vahid Reza Nafisi 1 , Mohammad Hasan Moradi 1 and Mohammad Hosain Nasr-Esfahani 2 1 Bioelectric Department, Faculty of Biomedical Engineering, Amirkabir University of Technology, Tehran, Iran 2 Medical Embryology Group, Royan Institute, Tehran, Iran E-mail: vrnafisi@cic.aut.ac.ir Received 17 October 2004, accepted for publication 6 May 2005 Published 13 June 2005 Online at stacks.iop.org/PM/26/639 Abstract The conventional assessment of human semen, especially sperm movement characteristics, is a highly subjective assessment, with considerable intra- and inter-technician variability. Computer-assisted sperm analysis (CASA) systems provide a rapid and automated assessment of the parameters of sperm motion, together with improved standardization and quality control. However, it should be noted that the measurement of the sperm head motion by CASA is sensitive to the technique of experimentation. While conventional CASA systems use digital microscopes with phase-contrast accessories that make the sperm’s head appear brighter and sharper than the other parts, in this research, a regular light microscope was used with a digital camera directly attached to its eyepiece. One of the drawbacks of this method is that the images lack proper contrast and sharpness. To remedy this, we have proposed an algorithm for sperm tracking that is insensitive to image acquisition conditions. This tracking algorithm was used after the background and extra particles were successfully removed through a two-step enhancement algorithm. Additionally, in this research, a template matching method was used for finding the sperm’s path. Upon examination, it was proven that our tracking algorithm worked well with different image acquisition conditions. This paper explains how this method reduces error probability in finding and tracking sperm in various frames. Keywords: computer-assisted sperm analysis (CASA), tracking, enhancement, wavelet transform 0967-3334/05/050639+13$30.00 © 2005 IOP Publishing Ltd Printed in the UK 639