PROBLEM TO BE SOLVED: To provide an X-ray inspection device that enables information on a connection wiring with a substrate of a mounted component to be accurately and easily input. SOLUTION: In teaching of a substrate examination, when a user inputs a two-dimensional region of a component to be examined with respect to a visible light image of the substrate, three-dimensional data are generated for the relevant region, and then analyzed to acquire a center coordinate, the number, the number of rows, and the number of columns on a ball terminal connecting the component to the substrate. Results such as the center coordinate acquired in such a manner may be displayed. A visible light image for the substrate is displayed in a display field 1502 of a screen 1501. In the display field 1502, a frame 610 corresponding to a region acquired as an examination target is displayed in accordance with the visible light image, and a frame 610C corresponding to each solder ball is displayed based on a position and the like of the solder ball acquired based on the three-dimensional data. COPYRIGHT: (C)2010,JPO&INPIT