Let us begin with the easy thing: digital cameras. One main feature of all measurement devices is linearity, that is the ability to deliver a value directly proportional with the measured quantity (light, in our case).
If you think about it, that is a good thing: you can measure whatever value with a constant absolute precision. Do you want to use one inch precision to measure one foot in length? You have it! Do you want to measure the Earth-to-Moon distance with the same precision? There you go, but... what the sense in that? One inch is probably too much to measure with satisfactory precision one foot in length, and it is certainly nonsense for the Earth-to-Moon distance. I mean, what is the use of measuring 15 billion inches with one inch precision? And moreover, imagine you have a counter able to measure inches: one foot will be only 12" while Earth to Moon will be 15 billion inches, a number you can store in 34 bits. If able to perform such measurements, your counter would cover 11 orders of magnitude (from units to tenths of billions), not too bad!
But, what if you want to go and measure Sun distance? at almost 150 million km, that is 6'000 billion inches, a number you need 43 bits to represent, if you want to go with 1" precision. That is, covering 13 orders of magnitude.
Nature is wiser, it always was and will always be. When you see the Sun in its brightness, you are staring at something 20'000 billion times as bright as the faintest stars in a pitch-dark sky, a leap of 14 orders of magnitude to be covered with 45 bits. For a comparison, the precision of the raw format of DSLR cameras is 14 bits (from 0 to 16383 different levels); most pro CCD cameras use 16 bits (up to 65535), while only a few, very advanced cameras go up to 18 bits (up to 262'143).
How can eyes do better than our best technology, and in such a shameful (for the tech, of course) way? One reasonable reply is: “being reasonable”! First of all, we have already shown that a direct, linear correspondence between an input stimulus and the value we associate to it is not viable. As a first approximation, Nature uses logarithmic laws for this kind of things.
I know: logarithm is mathematics, and there are chances that you do hate mathematics, but there is no understanding without effort so, please, just follow my argument and I shall make my maths as simple as possible.
Logarithm function graph [source: Wikipedia]Logarithm is a nice function, see it in the picture aside: it only grows (which is good for us, as we need higher sensations in reply to higher stimuli), it only exists for positive values (again, good for us, as there is nothing darker than no light at all, where we are going to fix our zero) and (now, for the hardest part) the rate of its growth decreases vs. the abscissa. The last property suits perfectly our needs, because it means that in reply to small stimuli in the dark (small x values) we get huge differences in the sensation, while big changes in high brightness (large x values) result in small sensation differences. You could say that this function tries to keep constant the relative precision of your sensations, i.e.: you perceive as different those stimuli that differ some given percent one from the other, independently of the stimulus you receive. Imagine that the value of this given percent is 10%, then you will see that a light stimulus of, say, 8, is different from 10, but 92 and 100 will be barely distinguishable, if ever.
Does this thing work? How well? In astronomy, for instance, light intensity of stars is given in magnitudes, and the difference between one magnitude and the next one is a constant, multiplicative factor of 2.512. Being multiplicative, two magnitudes in difference means 2.512 × 2.512 =2.5122. This means that light intensity can be measured by magnitudes with the inverse of a power law, i.e. a logarithm law. Is it that easy? Well, yes, and if it is good for astronomers, I assume it is good for me, and for you as well.
Actually, a more precise law is a power law, as those of you who already play with the gamma in their images know only too well, and magnitudes are nowadays measured with an hyperbolic sine law that handles some problems that may arise with logarithm in very dark images in a more robust way than logarithm does. Do not worry about that now, any difference with what I wrote up to now is inessential AND I will dedicate a post soon to both these topics (gamma and magnitudes) in a short time.
Is it enough? No other mistery than that? Well, sure there is, think about it: when you enter or get out of a tunnel while driving in a sunny day, chances are high that you will need some time in order to let your vision adapt to the new lighting conditions. What happens during this time?
This adaptation to the new light conditions allows you to see although with an ambient light 10'000 (that's it: ten thousand!) times as dim/bright as the previous conditions.
That is not an easy feat: the retina of your eyes is filled with rod and cone cells. The former are more sensitive to light and see in darkness, the latter are less sensitive BUT do distinguish colours. So, you do not actually cover the incredible luminosity range I wrote you about at any single time but, from time to time, your eyes adapt to the optimum sensitivity range. Don't ask me how eyes do that: they had millions of years to evolve to their perfection and I don't know any manufacturer wiser than Nature.

Why the eye is better than a camera at capturing contrast and faint detail simultaneously
[source: esciencenews.com]
So, is that all? Not yet. Up to now we have just seen how do our “detectors” (the eyes) work, but in human vision there is more that meets the eye (as the saying goes, and I find it quite appropriated to the discussion). The retina already adds something of its own by processing and manipulating the image in order to make it easier the task of analysing and understanding it. The main image processing technique operated by the eye is the edge enhancement, something you will find in your favourite picture processing software package, and able to make picture profiles sharper. In this way, the acknowledgement of shapes is easier, as they stand up over the image as the dark contour lines in a comic (so you know why kids draw so bold contours and comics are painted that way).
How does the filter works? As you can see in the image, retina cells on the bright side of a luminosity transition shut down their neighbours on the dark side, therefore making the transition look stronger.
EDIT (17/05/2011) - sorry for closing the post this way: it was late night and I completely forgot to write down a proper ending. Nonetheless, that's all, it's over. I hope you liked it and will comment about it.
See you for the next post,
Marino







