A system or method for improving quality in projection and tomographic x-ray, which includes a depth sensing device to measure a depth of at least one body part of a patient from the depth sensing device and a control unit to calculate a thickness and/or circumference of the body part using the depth information. The calculated thickness and circumference information is used to determine an optimal level of x-ray exposure for the body part. The system or method also includes a camera to identify the body part that needs to be examined and to detect any motion of the identified body part.