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; and a shielding unit which shields a part of the X-ray which is split by the splitting element and whose position is changed by a test object. The shielding unit has a region transmitting an X-ray and a region having a shielding element shielding an X-ray. 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.