1. An image processing apparatus comprising: one or more non-transitory computer-readable storage devices; and one or more computer processing devices connected to the one or more non-transitory computer-readable storage devices and configured by one or more programs stored in the one or more non-transitory computer-readable storage devices at least to: set a plurality of first image process parameter candidates; generate a plurality of processed training images by processing a training image using one of the plurality of first image process parameter candidates, wherein each of the plurality of processed training images is an image generated by using a different first image process parameter candidate; generate a plurality of dictionary candidates based on the plurality of processed training images; generate a plurality of first processed test images by processing a first test image using one of the plurality of first image process parameter candidates, wherein each of the plurality of first processed test images is an image generated by using a different first image process parameter candidate; detect, in each of the plurality of first processed test images, a target object by using one of the plurality of dictionary candidates; determine a dictionary based on detection results of detecting the target object in the plurality of first processed test images; set a plurality of second image process parameter candidates; generate a plurality of second processed test images by processing a second test image using one of the plurality of second image process parameter candidates, wherein each of the plurality of second processed test images is an image generated by using a different second image process parameter candidate; detect, in each of the plurality of second processed test images, the target object by using the determined dictionary; and determine a second image process parameter based on detection results of detecting the target object in the plurality of second processed test images; and store the determined dictionary and the determined second image process parameter in at least one of the one or more non-transitory computer-readable storage devices, wherein the training image is different from the first and second test images, and wherein each of the first and second test image is a photographed image.