We describe a technique for segmenting individual prostatic glands in hematoxylin-and-eosin stained prostatic tissue images. The method begins with image artifact correction, then segments the image into four tissue components using principal component analysis and k-means clustering, and finally identifies glands using a region-growing algorithm. We calculated the average gland size to distinguish cancer glands from non-cancer glands. Quantitative comparison between computer and manual outlines of glands based on 62 images (25 containing cancer) indicated an agreement of up to 67%, which approached the inter-observer agreement. Subjective evaluation corroborated these quantitative results and indicated that the technique segmented benign glands more accurately than malignant glands. Area under the receiver operating characteristic (ROC) curve of the average-gland-size feature was 0.92 in distinguishing prostate cancer from non-cancer glands.