To allow the center of a reference mark to be detected soon after the reference mark is selected using a template.
A preparation stage comprises a step where a multilayer wiring board is irradiated with an X-ray to image a reference mark, a step where a prescribed reference mark is extracted from a picked-up image together with a surrounding identifying image to generate the template, a step where an image of the reference mark of the template is extracted to measure a center position, a step where data of the center position is set to the template, and a step where an image of the template and the center position data are registered. A detection stage comprises a step where the multilayer wiring board is irradiated with the X-ray to image the reference mark, a step where the picked-up image is scanned with the template for a pattern matching process, a step where the center position of the image of the reference mark is detected based on the center position data registered in the template, and a step to output the data.