1. A method for providing autofocus for an imaging device comprising: determining, for a region of interest of a scene, a plurality of accumulated phase difference values associated with a plurality of phase shifts for a first phase autofocus image and a second phase autofocus image; performing a curve fitting based on the plurality of accumulated phase difference values and the plurality of phase shifts to generate an accumulated phase difference values fitted curve; generating a reliability value associated with a focus phase shift for the plurality of accumulated phase difference values and the plurality of phase shifts based at least in part on the accumulated phase difference values fitted curve; and focusing the imaging device based at least in part on the reliability value.