1. An image forming apparatus comprising: an image forming unit constructed to form a plurality of patch images on a recording material; a spectral data detection unit constructed to irradiate the recording material with light, photoelectrically convert light of a first number of wavelengths included in the reflected light, and detect an amount of the light of the first number of wavelengths; a border judgment unit constructed to judge a border between two patch images adjacent to each other among the plurality of patch images formed on the recording material, based on change in the amount of the light of a second number of noticed wavelengths detected by the spectral data detection unit, wherein the second number is one or more, and less than the first number; a color value calculation unit constructed to calculate a color value of a patch image from the amount of the light of the first number of wavelengths detected by the spectral data detection unit irradiating the patch image with the light; and a control unit constructed to control an accumulation period of charge for the photoelectric conversion at the spectral data detection unit, wherein the control unit is further constructed to make the accumulation period of the spectral data detection unit shorter when judging the border between the two patch images adjacent to each other than when calculating the color value of each of the two patch images.