In a human-robot collaborative manufacturing application where working object can be placed in an arbitrary position, there is a need to calibrate the actual position of the work object. This paper presents an approach for automatic calibration in flexible robotic systems. It consists of two subsystems: a global positioning system based on fixed cameras mounted around robotic workspace, and a local positioning system based on the camera mounted on the robot arm. The aim of the global positioning is to detect work object in working area and roughly estimate the position, whereas the local positioning is to define the object frame according to the 3D position and orientation of the work object with higher accuracy. For object detection and localization, coded visual markers have been utilized. For each object, several markers have been used to increase the robustness and accuracy of localization and calibration procedure. This approach can be used in robotic welding or assembly applications.