Morphological profiles (MPs) are efficiently exploited for modelling the geometrical features of structures in a scene. They increase the discriminability between different classes. The degree of processing of images depends on the geometrical structure and shape of the used structure element (SE) in the transformation. Since the geometric structures of an image are not the same in the whole image, the use of a fixed shape for SE may not be so efficient. Thus, it is proposed to extract an edge patch image-based morphological profile (EPIMP), which considers SEs with different shapes for different areas of image. The used SE in each patch of image is corresponding to the shape (i.e. edge image) of that patch. The proposed method is experimented on both multispectral and hyperspectral images and the obtained results show that the proposed method is much more efficient than the conventional MPs. Moreover, the experiments show the superiority of EPIMP compared with some state-of-the-art spectral-spatial classification methods such as generalised composite kernel, multiple feature learning, weighted joint collaborative representation and multiple-structure-element non-linear multiple kernel learning.