Dendritic spine expression plays an important role in the central nervous system. Modern fluorescence microscopy and green fluorescent protein technology have facilitated the research on spines. To quantitatively analyze the spines in fluorescence microscopy images, an automatic dendritic spine analysis method is proposed. Because of the limit of axial resolution, our method is designed to process the projection image along the z-axis and analyze the lateral spines. The method can automatically extract the dendrite centerlines and segment the spines along the dendrites according to width-based criteria. The criteria utilize a common morphological feature of the spines. It can detect some shapes of spines missed by previous methods. In addition, the proposed method is automatic once a few parameters are set. Spine numbers, lengths, and densities, which biologists are interested in, are analyzed both manually and automatically. The results of the two methods match well. The proposed method provides automatic and accurate dendritic spine analysis. It can serve as a useful tool for spine image analysis to avoid tedious manual labor.