Obstacle detection and avoidance are two main problems that demand solutions in the autonomous movement of mobile robots. To this end, the robots have been equipped with sensors and cameras. This study proposes a new method that allows mobile robots to move freely without any collision in an uncertain (i.e., both static and dynamic) workspace by processing images taken using a real-time webcam. In the study, a robot was allowed to move depending on the visibility and suitability of the floor in the images. These steps were repeated for each new image and, furthermore, the images were segmented based on an adaptive threshold obtained by calculating the statistical parameters. This segmentation was aimed to separate the floor from other areas in the study. Experimental results demonstrate that the proposed method is extremely successful to separate the floor from other regions and has a low cost and flexible method for obstacle avoidance.