Frame data of tomographic planes that are parallel in the scan direction and between an X-ray tube and an X-ray detecting unit is generated based on detected frame data. The generation of frame data is based on the fan-shaped spreading of an X-ray beam and the differences in position in a height direction between the tomographic planes from a detection surface. Tomographic images are respectively generated from the frame data of the tomographic planes based on laminography technique. Edge information based on the changes in pixel values in each tomographic image is calculated for each pixel. A three-dimensional distribution of the edge information is generated and the edge information is searched in a direction passing through the tomographic planes and pixels indicating a maximum value in the edge information are detected. Only pixels in the tomographic images that positionally correspond to detected pixels are combined into a single composite image.