1. A non-transitory computer-readable recording medium that stores therein a detection program that causes a computer to execute a process comprising: obtaining, for each of a plurality of taken images that are sequentially taken, a difference between a taken image and at least one taken image taken prior to the taken image; detecting times at which a change amount temporarily decreases in the plurality of images, on a basis of a result of comparing differences between the plurality of taken images obtained at the obtaining; and extracting a time at which a person beats rhythm from the detected times at the detecting, when difference amounts obtained at the obtaining keep decreasing from an image taken earlier than the image at the detected time by a predetermined quantity of images prior to the image at the detected time, and keep increasing from the image at the detected time subsequent to an image taken later than the image at the detected time by a predetermined quantity of images.