Automated optical inspection (AOI) is getting popular in quality of control in manufacturing. There is a huge demand to install AOI systems in production lines seamlessly. Usually, a conveyor is used in a product line to carry work-pieces. Thus, it becomes difficult to inspect the quality of products by images when work-pieces are moving. This paper proposed a robotic AOI system which is able to track moving objects in a conveyor to take clear images. This system can be installed into production lines on the fly. To achieve this, the system estimates the pose of the coming work piece using a camera before the work-piece arrives the inspection spot, and adjust the poses of the inspection cameras to align with the work piece. Then, the robot moves along the conveyor at the same speed and the system requires the correct calculation of image Field of View (FOV). By doing this, the robotic AOI system can take clear images of the work piece. We validated the system on a Denso RC8-series industrial robot equipped with eye-in-hand cameras to capture clear images while the work-piece is moving. The results show that the proposed system is able to take clear images when the conveyor speed is up to 10cm/sec.