An efficient obstacle detection technique is required so that navigating robots can avoid obstacles and potential hazards. This task is usually simplified by relying on structural patterns. However, obstacle detection constitutes a challenging problem in unstructured unknown environments, where such patterns may not exist. Talukder et al. (2002, IEEE Intelligent Vehicles Symposium, pp. 610–618.) successfully derived a method to deal with such environments. Nevertheless, the method has a high computational cost and researchers that employ it usually rely on approximations to achieve real-time. We hypothesize that by using a graphics processing unit (GPU), the computing time of the method can be significantly reduced. Throughout the implementation process, we developed a general framework for processing dynamically-sized sliding windows on a GPU. The framework can be applied to other problems that require similar computation. Experiments were performed with a stereo camera and an RGB-D sensor, where the GPU implementations were compared to multi-core and single-core CPU implementations. The results show a significant gain in the computational performance, i.e. in a particular instance, a GPU implementation is almost 90 times faster than a single-core one.