A method of automatically configuring an X-ray imaging system for taking an X-ray image of an object includes, first, obtaining one or more depth images from one or more depth cameras covering at least an area covered by an X-ray bundle of an X-ray source. Then, a thickness of the object is determined from the depth image(s). Then, this thickness value is converted to a dose configuration of the X-ray imaging system by taking into account a transmission length of the X-ray bundle through the object and knowledge about tissue types being imaged.