1. An X-ray imaging apparatus, comprising: an X-ray source to irradiate X-rays to a subject; a sensor mounted on the X-ray source; and a controller to obtain a volume of the subject based on an output value of the sensor, to determine a degree of obesity of the subject based on the volume, and to control an irradiation level of the X-rays based on the degree of obesity of the subject, wherein the output value of the sensor comprises, when the sensor comprises multiple image sensors, tilting angles of the multiple image sensors while the X-ray source is being shifted.