This paper presents a robust algorithm for object detection and tracking using MATLAB. This program captures a single image using a webcam attached to the laptop. The captured image is processed to find a predefined object. The centroid of the object is calculated. Subsequent images are then acquired. Each time a new image is acquired, the predefined object and its centroid is extracted and compared to the centroid of the previous image. The differences in the x and y coordinates of the centroids are used to determine the direction of movement of the Irobot Create. Once the algorithm determines the direction of movement, the program issues the move command wirelessly to the robot with the aid of a Bluetooth Adapter Module.