Performance assessment and optimization of ATR systems poses the problem of developing image databases for learning and testing purposes. An automatic IR image database generation technique is presented in this paper. The principle consists in superimposing segmented background, target and mask (bushes for example) from real images, under the constraint of predefined image characterization metrics. Each image is automatically computed according to a specification which defines the metrics levels to reach, such as the local contrast ΔTRSS (NVESD metric), the Signal to Clutter Ratio, or the masking ratio target/mask. An integrated calibrated sensor model simulates the sensor degradations by using the pre and post-filter MTF, and the 3D noise parameters of the camera. The image generation comes with the construction of a ground truth file which indicates all the parameter values defining the image scenario. A large quantity of images can be generated accordingly, leading to a meaningful statistical evaluation. A key feature is that this technique allows to build learning and testing databases with comparable difficulty, in the sense of the chosen image metrics. The theoretical interest of this technique is presented in the paper, compared to the classical ones which use real or simulated data. An application is also presented, within the CALADIOM project (terrestrial target detection with programmable artificial IR retina combined with IR ATR system). Over 38,000 images were processed by this ATR for training and testing, involving seven armored vehicles as targets.