An X-ray inspection apparatus comprising: a transport unit configured to transport an article; an electromagnetic wave irradiation unit configured to irradiate the article with a first electromagnetic wave in a first energy band and a second electromagnetic wave in a second energy band higher than the first energy band; an electromagnetic wave sensor configured to detect the first electromagnetic wave and the second electromagnetic wave emitted to the article; and a control unit configured to receive an input of a detection result of the electromagnetic wave sensor, wherein the control unit is configured to: generate a first transmission image based on a detection result of the first electromagnetic wave and a second transmission image based on a detection result of the second electromagnetic wave; perform image processing including a subtraction process on the first transmission image and the second transmission image by directly or indirectly using a luminance distribution related to a background other than the article reflected in the first transmission image and the second transmission image; determine whether or not a foreign material is included in the article on the basis of a difference image obtained by the subtraction process; and the control unit is configured to perform the image processing which further includes: a look-up table generation process of generating an LUT used to match a brightness of the first transmission image with a brightness of the second transmission image, on the basis of first data indicating the number of pixels for each gradation in the first transmission image and second data indicating the number of pixels for each gradation in the second transmission image; an LUT correction process of correcting at least a portion of the LUT, directly or indirectly using the luminance distribution; and an image correction process of correcting the brightness of the first transmission image using the corrected LUT, and the subtraction process is performed on the first transmission image (P1R) after the image correction process and the second transmission image. a transport unit configured to transport an article; an electromagnetic wave irradiation unit configured to irradiate the article with a first electromagnetic wave in a first energy band and a second electromagnetic wave in a second energy band higher than the first energy band; an electromagnetic wave sensor configured to detect the first electromagnetic wave and the second electromagnetic wave emitted to the article; and a control unit configured to receive an input of a detection result of the electromagnetic wave sensor, wherein the control unit is configured to: generate a first transmission image based on a detection result of the first electromagnetic wave and a second transmission image based on a detection result of the second electromagnetic wave; perform image processing including a subtraction process on the first transmission image and the second transmission image by directly or indirectly using a luminance distribution related to a background other than the article reflected in the first transmission image and the second transmission image; determine whether or not a foreign material is included in the article on the basis of a difference image obtained by the subtraction process; and generate a first transmission image based on a detection result of the first electromagnetic wave and a second transmission image based on a detection result of the second electromagnetic wave; perform image processing including a subtraction process on the first transmission image and the second transmission image by directly or indirectly using a luminance distribution related to a background other than the article reflected in the first transmission image and the second transmission image; determine whether or not a foreign material is included in the article on the basis of a difference image obtained by the subtraction process; and the control unit is configured to perform the image processing which further includes: a look-up table generation process of generating an LUT used to match a brightness of the first transmission image with a brightness of the second transmission image, on the basis of first data indicating the number of pixels for each gradation in the first transmission image and second data indicating the number of pixels for each gradation in the second transmission image; an LUT correction process of correcting at least a portion of the LUT, directly or indirectly using the luminance distribution; and an image correction process of correcting the brightness of the first transmission image using the corrected LUT, and a look-up table generation process of generating an LUT used to match a brightness of the first transmission image with a brightness of the second transmission image, on the basis of first data indicating the number of pixels for each gradation in the first transmission image and second data indicating the number of pixels for each gradation in the second transmission image; an LUT correction process of correcting at least a portion of the LUT, directly or indirectly using the luminance distribution; and an image correction process of correcting the brightness of the first transmission image using the corrected LUT, and the subtraction process is performed on the first transmission image (P1R) after the image correction process and the second transmission image.