1. A device for setting image acquisition conditions comprising: an image integration unit that integrates a plurality of image signals and forms an image; and a pattern matching unit that performs pattern matching on the image integrated by the image integration unit using a preliminarily registered template, wherein the image integration unit changes the number of integrations on each of a plurality of preliminarily acquired integrated images, and forms a plurality of images with the different numbers of integrations, the pattern matching unit performs pattern matching on the plurality of images with the different numbers of integrations, and acquires a score representing a degree of matching between the template and a position specified by the template, and the device further comprises a selection unit that selects the number of integrations where variation in the scores is within a prescribed allowable range, the number of integrations where all the plurality of integrated images represent a score of at least a prescribed value, the number of integrations where variation in dimensions of a pattern specified by the pattern matching is within a prescribed allowable range, or the number of integrations where an average of dimensions of the pattern is within a prescribed range.