1. An image sensor, comprising: a plurality image pixels, wherein each image pixel includes a photosensitive element configured to convert incoming light into electric charges; a plurality of dark pixels, wherein each dark pixel is optically shielded from the incoming light; an oscillator circuit switchably coupled to the plurality of image pixels and the plurality of dark pixels; and a counter coupled to the oscillator circuit, wherein the counter is configured to increase a counter value when the oscillator circuit is coupled to the image pixels, and wherein the counter is configured to decrease the counter value when the oscillator circuit is coupled to the dark pixels.