“…The second technical issue is how to apply proper image processing techniques to separate the coffee granules from the background and estimate their sizes to obtain the coffee granule size distribution. In previous studies related to granule or particle segmentation, morphological watershed transform [8,22] processing has been successfully applied in the segmentation of solar photosphere particles [23,24], diagnostic systems to identify acute myeloid leukemia [16], granule segmentation in electron microscopy (EM) images [17], segmentation of biological membranes in electron tomography [25], fast imaging of yolk granules to quantify intraembryonic movement [18], evaluation of the particle size distributions of gravel [15] and on-site rockfill [26], DNA scalograms segmentation [27], and feature extraction of wear debris of planetary gearboxes [28]. Therefore, with so many successful results, the morphological watershed transform has also been selected for coffee granule segmentation in this paper.…”