1. An image forming apparatus comprising: a plurality of image forming units configured to form images using an electrophotographic technique; an image carrier onto which images formed by the plurality of image forming units are transferred; a sensor configured to irradiate the image carrier with light, and detect reflected light; a detection unit configured to detect, among output values of the sensor corresponding to one patch image, an output value of the sensor corresponding to a density varied edge area of the one patch image on the image carrier, the one patch image being formed on the image carrier by one of the image forming units, the density varied edge area being an area where densities of the one patch image are varied due to an edge density variation phenomenon; a setting unit configured to set a correction condition based on the output value corresponding to the density varied edge area of the one patch image; a determination unit configured to correct the output values of the sensor corresponding to the one patch image based on the correction condition, and determine a position of the patch image based on the corrected output values; and a color registration control unit configured to perform color registration control based on the determined position of the patch image.