The main purpose of this paper is to make table tennis robots complete the hit table tennis ball action by imitating human's behavior. The main strategy is to record a video of action which people played the table tennis, then analysis the video of the racket trajectory. The racket in the image is extracted by image processing when the each frame is captured in the video. Then three-dimensional coordinates of the center of the racket and racket posture are obtained via PnP positioning approach based on the intrinsic parameters of the camera. The table tennis robot will off-line learn to complete the imitation of basic actions of the racket trajectory and postures. A large number of experimental data is used to establish basic actions of table tennis robot.