1. An image processing device for generating a snowfall-corrected image which has snowfall noise removed from temporally consecutive input images, the device comprising: a processor that executes instructions, the instructions, when executed by the processor, causes the processor to perform operations including: performing median processing in a time direction on temporally consecutive input images, the input images including an image at a time point of interest; generating a median image at the time point of interest by performing the median processing; generating a primary image at the time point of interest based on the input image at the time point of interest, the median image at the time point of interest, and a difference between a median image at a time point immediately preceding the time point of interest and the input image at the time point of interest; generating a background image at the time point of interest based on the primary image at the time point of interest and a background image at the time point immediately preceding the time point of interest; determining whether each pixel of the input image at the time point of interest represents an object in motion other than snow particle based on the input image at the time point of interest, an input image at a time point immediately subsequent to the time point of interest, and the background image at the time point of interest; and generating the snowfall-corrected image: when a pixel value of the input image at the time point of interest is adopted as a pixel value of the snowfall-corrected image when a pixel of the input image at the time point of interest represents the object in motion, and when a pixel value of the median image at the time point of interest is adopted as the pixel value of the snowfall-corrected image when the pixel of the input image at the time point of interest represents the snow particle.