In this project your phone will be used to fully stabilize a self balance robot. For controlling the position of the robot you need information about the bot’s movement. This information is normally aquired by having motors which are equipped with encoders or using stepper-motors. In this project your phone‘s camera is providing this information via visual odometry – something also used by the mars rover(s).
The performance is strongly depending on the sensors used in your phone, some just delivier better results than others. Addtionally the enviorment needs to be structured, so small movements can be detected between successive images.