A compact stacked integrated module of optical mathematical morphological processor is developed, which consists of a weighted interconnecter of the building blocks like calcite and quartz plates and a variable thresholding device. Based on the Boolean decomposition for morphological function and the thresholding for weighted convolution, a simple algorithm with only the programming of threshold levels is developed. Thus, any morphological image processing function can be performed by using a series of different threshold levels.