Self-localization in robotics is still a challenging task for both indoor and outdoor mobile robotic systems. The main reason is various sources of sensors and calculation errors that summarizes into a general position estimation error. While it is rather common to use some external landmarks to prevent error accumulation over time the sensors themselves used for landmark detection are significant sources of localization error. Within this paper we discuss one possible implementation of the localization mechanism, which uses an on-board camera on top of the robot for ceiling landmark detection and then through appropriate calculations estimates the actual position of the robot. While the camera is not set up perfectly and therefore has some unknown angular and displacement offset it generates a systematic error in the position estimation data. Self-calibration algorithm has to detect and compensate this offset automatically to maintain the necessary accuracy of the position estimation. Therefore, we propose an automatic calibration algorithm, which is based on spiral motion of the robot for data gathering and multi factor optimization for the error.