The hand-eye system calibration, aiming to achieve the relationship between the robot hand and vision sensor mounted on it, is an important technique in the robot applications, involving automatic 3D measurement, visual serving, sensor placement planning, etc. Generally, the key issue of hand-eye calibration is equivalent to solving the homogeneous transformation matrix X from the equation of the form AX=XB. In this paper, we develop an accurate hand-eye calibration method by establishing a global objective function, in which the errors of camera calibration and robot movements have been considered. It is constructed based on the minimizing the projection error from the target benchmarks to the camera retina plane at all robot motions. The experimental results prove that the proposed algorithm can accurately solve the hand-eye calibration problem. Meanwhile, we set up an automatic 3D measurement system based on a robot and a rotary table, and developed a calibration scheme for the system to achieve the multi-view and fully automatic 3D data acquisition by using a fringe projection 3D sensor.