The invention is aimed to provide an X-ray imaging apparatus and the like ensuring a sufficient range of detecting the amount of X-ray movement with respect to the pixel size of a detector in comparison with the method disclosed in International Publication No. WO2008/029107. The X-ray imaging apparatus of the present invention has a splitting element which spatially linearly splits an X-ray beam; and a shielding unit which shields a part of the X-ray beam which is split by the splitting element and whose position is changed by a test object. The shielding unit has a region transmitting X-rays and a region having a shielding element shielding (blocking) X-rays. A dividing line between the X-ray transmitting region and the region having the shielding element is configured to be arranged obliquely so as to cross the linearly split X-ray beam.