This paper presents the first implementation of a new algorithm for pattern recognition in machine vision developed in our laboratory. This algorithm has been previously presented only theoretically, without practical use. In this work we applied it to the RobotCub humanoid robotics platform simulator. We used it as a base for a circular object localization within the 3D surrounding space. The algorithm is a robust and direct method for the least-square fitting of ellipses to scattered data. RobotCub is an open source platform, born to study the development of neuro-scientific and cognitive skills in human beings, especially in children. Visual pattern recognition is a basic capability of many species in nature. The skill of visually recognizing and distinguishing different objects in the surrounding environment gives rise to the development of sensory-motor maps in the brain, with the consequent capability of object manipulation. In this work we present an improvement of the RobotCub project in terms of machine vision software, by implementing the method of the least-square fitting of ellipses of Maini (EDFE), previous developed in our laboratory, in a robotics context. Moreover, we compared its performance with the Hough Tranform, and others least-square ellipse fittings techniques. We used our system to detect spherical objects by applying it to the simulated RobotCub platform. We performed several tests to prove the robustness of the algorithm within the overall system. Finally we present our results.