a b s t r a c tTraditional machine learning algorithms very often assume statistically independent data samples. However, this is clearly not the case in remote sensing image applications, in which pixels present spatial and/or temporal dependencies. In this work, it has been presented an approach to improve land cover image classification using a contextual approach based on optimum-path forest (OPF) and the well-known Markov random fields (MRFs), hereinafter called OPF-MRF. In addition, it is also introduced a framework to the optimization of the amount of contextual information used by OPF-MRF. Experiments over high-and mediumresolution satellite (CBERS-2B, Landsat 5 TM, Ikonos-2 MS and Geoeye) and radar (ALOS-PALSAR) images covering the area of two Brazilian cities have shown the proposed approach can overcome several shortcomings related to standard OPF classification. In some cases, the proposed approach outperformed traditional OPF in about 9% of recognition rate, which is crucial for land cover classification.