1. An image processing device comprising: a processor configured to execute various programs for performing image processing on a target image; and a memory that stores a result of the image processing, wherein the processor is configured to execute a process of converting a color space of the target image and acquiring color information on the converted color space, a process of calculating, for the target image, a first average value indicating an average value of brightness of color information on a target region that contains an object to be detected, a process of comparing, for the target region, brightness of color information on each pixel with the first average value to generate a corrected image with corrected brightness/darkness, and a process of extracting the object on the basis of the corrected image.