Based on a quick perusal of contrast detection descriptions on the internet, I understand that the camera computer measures the gradient of the intensity in that region and then changes the focus, in order to reach at a local maxima.
Now all this is good for a point source of light at the centerline of the lens and that's what is used in most of the descriptions. But natural scenes are never like that - therefore I would like to know how this method works most of the time? And if it doesn't, then what are those cases?
My concern is that I would assume, since there's light usually being reflected into the lens from a large number of places, that even an unfocused image, could cause a peak in the intensity values just because, maybe the unfocus caused light from another region to land on the region of interest and took in intensity beyond the focused value? Is this not possible?