A processing device includes: a processor including hardware, the processor being configured to acquire image data; determine, for each pixel of an image corresponding to the acquired image data, whether a pixel value of the pixel is equal to or less than a preset threshold as a dark level; accumulate, for a predetermined number of frames, the pixel value that has been determined to be equal to or less than the preset threshold and positional information regarding a position of the pixel whose pixel value has been determined to be equal to or less than the preset threshold, on the image sensor; calculate a statistical value of the accumulated pixel values for each pixel; determine, for each pixel, whether the statistical value falls outside a preset range; and correct a pixel value of the pixel whose statistical value has been determined to fall outside the preset range.