Automatic detection and quantification of glands in gastric cancer may contribute to objectively measure the lesion severity, to develop strategies for early diagnosis, and most importantly to improve the patient categorization. This article presents an entire framework for automatic detection of glands in gastric cancer images. This approach starts by selecting gland candidates from a binarized version of the hematoxylin channel. Next, the gland's shape and nuclei are characterized using local features which feed a Monte Carlo Cross validation method classifier trained previously with manually labeled images. Validation was carried out using a dataset with 1330 annotated structures (2372 glands) from seven fields of view extracted from gastric cancer whole slide images. Results showed an accuracy of 93% using a simple linear classifier. The presented strategy is quite simple, flexible and easily adapted to an actual pathology laboratory.