A CT device and method based on motion compensation are proposed. The present invention obtains motion parameters of a target object by using a stereo-vision-based motion measurement system, and then implements motion compensation through the technology based on reconstructed image matrix transformation, thereby obtaining a clear 2D/3D CT image while eliminating motion artifacts. The present invention can effectively eliminate motion artifacts caused by the scanned objects own motions in the CT scanning, and can be easily embedded into the existing CT scanning equipments. The present invention can improve quality of the CT images, and is especially important for CT imaging of some special groups of people that can not control their own motions, such as Parkinsons patients, infants, living mouse and so on. It can also improve ultra-high-resolution imaging of human body.