1. A moving amount detector that sets a movable member included in a device or an object conveyed by the device as a detection target and detects a moving amount of the detection target, the moving amount detector comprising: an imaging unit that repeatedly captures a series of images of the detection target at a constant sampling period while the detection target moves; and a hardware processor configured to function as a moving amount calculating unit that selects every Nth image of the series of images and compares each pair of adjacent selected images with each other from among the series of images of the detection target captured by the imaging unit; wherein N is determined based on an intended moving speed of the detection target; and the moving amount calculating unit calculates a moving amount of the detection target based on a movement of the detection target during a time period between when the two compared images were taken.