1. A method of touchless counting of substantially planar substrates which are stacked in the form of stacks of substrates, the method comprising the following steps: taking at least one sample image of a portion of a side of a stack of substrates, which sample image contains contrast information representing substrate edges that extend along substantially a first direction in the sample image; processing the contrast information representing the substrate edges within the sample image, which processing includes subjecting at least one area of interest within the sample image to anisotropic diffusion to produce a processed image containing a substantially coherent set of continuous lines representing the substrate edges; and counting the number of substrate edges in the processed image.