So in the camera lecture, we saw that cameras have a
bunch of different properties that are important to know.
And the camera manufacturers give you a spec sheet,
with a lot of these properties of cameras. But in this
tip, I want to show you how you can measure a whole number
of these things yourself to make sure that they actually
conform to the specifications, and also that there are certain
features that are not listed here but that may be important to you
that you can quite easily measure. I have here a camera, and
this is just a camera that belongs to that spec sheet.
I have a c-mount on the camera with a cap, so that at the
moment, no light is reaching it. With this capped camera, no
light is reaching this CCD and we can see what the dark image
looks like, and we can do some measurements on the dark
image. When I now snap an image, first thing that I see
is that the size of this image is 2048x2048 pixels.
And that is exactly the same as promised on this spec sheet, so
we are getting the pixels that we paid for. Now to make this a
little bit easier on the software, I'm going to take a subreading.
And this spec sheet says that it can take subareas, yes?
And I'll be working with a subregion of 512x512 pixels.
Now what you already see now is that the picture doesn't look
black, but kind of grainy. So there's a certain type of noise.
And we assume that most of this noise is the readout noise.
And to now see what this noise is, the best thing that you can do
is to measure. And I've set the software up so that it will measure
the mean, the average of these pixel values, and the standard
deviation. And here we see that we have a mean of about 100.
And a standard deviation of about 3. And the mean in this
case is the offset, so the manufacturer put the lowest pixel
value a certain number higher than zero so that we can
actually see this noise and it's not clipped. And the standard
deviation is a measure for the readout noise. When we now
go live, we see a couple of things. One is that all this noise is
changing, we see some lines moving and most likely those
lines are some kind of very small amount of electronic noise
happening in this system. Now, a test that you always will want
to do is to run a series of images with no light reaching the camera
to see if the baseline, that zero level, is the same in all of them.
So when I now set this up to take a hundred time points and
acquire them, first of all you see how incredibly fast this is.
We have set an exposure time of 3 milliseconds, and this whole series
actually takes place in something like 300 milliseconds.
So we have a hundred images in 300 milliseconds.
Then we use this tool here to measure all the intensities
and standard deviations in these 100 images. And what we see
here when we now scroll through the list is that we have a mean
of roughly 101 and stays more or less constant, indicating that our
baseline stays nice and flat. And also the standard deviation
stays nicely roughly 2.9 - 3. So in this point in time,
we know that this reflects the readout noise, but we don't know yet
how digital numbers relate to photons. And so to express
the readout noise the way we want it, in photoelectrons,
we will need that photon conversion factor that we will
calculate later on. One other measure that is intriguing is
listed in this spec sheet as the dark current. And the dark
current is how much charge accumulates on the chip
during a longer exposure when no light is reaching
the camera. And so we can simply look that up by setting a longer
exposure time. I'll set an exposure time of 5 seconds.
Then snap an image. So the dark current is expressed
in electrons per pixel per second. And so, now that we have
our image here, we see that all of a sudden we start to
see these very bright pixels coming out of the black background.
So we have what I call "hot pixels." Still, to see if this spec
is roughly right, what we can do is measure the standard deviation.
And we see that the mean went up by 7/10 or so of a digital number,
but you see that the standard deviation went up dramatically.
So, the dark current is defined by this mean. So we are
1 higher, and if we knew how to convert a digital number
into a photoelectron, we could actually check whether this number
was about right. And we'll be able to do that later. But the
important thing to note is that not all the pixels are accumulating
this dark charge the same way. You also see here that
in the spec sheet, that the dark current depends on something.
And that something is actually the cooling. So the better we
cool the camera, and we are now only cooled at -10, if we
would cool the camera further, then the dark current would go down
and these hot pixels would get less prominent. So we now
know how this camera responds when there is no light, and so the next
thing is that we want to know how it responds when there is light. One
of the things that is difficult to do is to provide a very
homogeneous flat source of illumination. And so I used
now some very simple tricks to get a relatively even illumination.
And I'll show you here at the camera how to do that. The first thing
we need to do is take the cap off the camera. So in here,
you see the photosensitive chip, the 2048x2048 pixels.
And then the other thing I use is these cups that are semi-transparent
and kind of act as a diffuser. And those happen to fit very nicely here
on the camera. Then, the other concern is the light source.
We have fluorescent lights here, those flicker at a 60 hertz
rate. That's not very good. And so, it so happens to be that phones
provide a much nicer, very continuous light source. So I'm using
here a flashlight application on my phone. You also see that it's
set to a very dim and low light intensities. And I'll just put this
in front of the cups to provide the continuous and relatively
even source of illumination. When we snap an image, we
see some patterns on it. We also see that it's bright on the top
and dark on the bottom. And then when we go live, we notice
pretty profound flickering. And that flickering is coming from those
fluorescent lights that we still have on in here. So we'll need to
switch the lights off to have our constant continuous illumination.
With the phone and the cups in front of the camera, snap an
image. I see first of all in my histogram that we have bright pixels
that are distributed in a relatively narrow area. And what I see on
the screen is that we have a relatively homogeneous illumination.
Although it's still a little darker here on the corners. And we see
some strange folds, we see some strange patterns here.
What is highly useful is to again take something like 100 images
here, and then average the 100 of them. And so that will then
show us how the individual pixels are responding to the
light with which we are illuminating. So I acquired 100 images,
I then make a projection of it. And what I say is to simply
sum all the numbers. And that in the end will give us an
average image. And the first thing that we note in that average
image is how homogeneous it is. And what we also note
that certain pixels respond worse than others. So for instance,
right here are some pixels that respond very poorly. Much more
poorly than their neighbors. And we also see that there are some
patterns that basically are on the photosensitive area itself.
One piece of information that is missing and that we really want to know
is how these digital numbers correlate with photons hitting the
sensor. And so to figure that out, what we're going to do
is to take images with illumination like we used here to get that
flat field. So homogeneous illumination. And then in those
images, we're going to measure the average intensity
and we're also going to measure the noise in the image.
And so, since the noise is going to be limited, hopefully, only
by photon shot noise, we know that that noise should go with
the square root of the intensity. And so out of that relation, we can
then backtrack what the photon conversion factor is. And
I wrote a number of scripts that make it relatively easy and
straight forward to measure the photon conversion factor.
So what these scripts are going to do is that first, we're going to
acquire a data set, and we're going to acquire a data set
with increasing exposure times. Every time we're taking
two images at the same exposure time, and we're doing that
to correct for inhomogeneities in the illumination. Because we take these two
images, we subtract them from each other, and from that subtracted
image, we calculate the noise. And we correct that then
by the square root of two. And so that way, we can actually
deal with certain inhomogeneous illumination. So then at the
end, we'll have intensities at different intensity levels, and we
have the noise, the variants, that we measured from those images.
We will plot that on a log-log scale and from that plot, we can
deduce the photon conversion factor. So we open the
script panel here. I prepared the 3 scripts that we need.
We need to run this script "plot" just once. Then we're going to
use this script "CameraLabs," and that's what we're using to
acquire the data. So we have to enter a few values here, one is
the final exposure, 100 milliseconds is okay, 50 exposures is
fine. We can start here and 3 milliseconds is also roughly about
right. Or we can start at 2.1. And now when I run this,
it will be taking images at increasing sets of images at
increasing exposure times. These are being autoscaled.
So it's only actually from the apparent noise reducing that we
see that our exposure times are increasing. Once we have this,
we will run the analysis script. And that will now process
all the images. And it will give us two things, so one is the
photon transfer curve. This is plotting the signal, the mean
intensity, as a digital number against a noise, the variance
as a digital number. And this is plotted on a log-log plot.
And you see that it is relatively straight. Here at the
lower end, if we were able to go to very short exposure
times, this would go to the readout noise. However, this camera
doesn't let us set very short exposure times, so we don't really
get that low. There's a little bump here, don't know what that is.
You also see that it starts to level off here somewhere at this
point. And that is where we are filling the pixels, so we are
reaching saturation here. And we can run another one where we
go to slightly higher exposure times, and you'll see that it really
starts to go down around here. So we have here the photon
transfer curve as we measured it. So we see here that
it is pretty straight along most of the area where we measured.
And we can now in this table, we can look for areas where the slope
on the log-log plot is 0.5. And a slope of 0.5 indicates that
the relation between the two is the square root, and that means
that this is the area that we're really limited by photon
shot noise. So wherever that slope is 0.5 or close to it, we
can read out the photon conversion factor. You'll see here that the
photon conversion factors are in a pretty close area, so roughly
between 0.44 and 0.46. So 0.45 is a pretty good estimation for
the photon conversion factor. Now, let me go back to the beginning where
we measured on a dark image the standard deviation
of 3, we now know that we have to multiple that 3 in
digital numbers with this 0.45 to get the readout noise
in photon electrons. I think the readout noise was actually
2.9. And so there, we get a readout noise in photon electrons of
1.305. Now when we go back to the spec sheet, we see
that the read noise is given as 1.3 electrons root mean square.
And so this indicates that we are measuring very much the same
thing that the manufacturer measured. And the specs are
holding up to what was promised. So the other thing that we are seeing
is that we are reaching around here, we are reaching
full well capacity. So now our noise is not going up
anymore with the square root. And we can read out
here that it is happening around a signal in digital numbers
of about let's say 55,000. And so this indicates that we are reaching
full well capacity. And likewise, we can now multiply
55,000 by our photon conversion factor of 0.45, and from that we get
a full well capacity of roughly 25,000. Now the manufacturer
gives a full well capacity of 30,000. One thing that is possible
is that we are here not reaching the real full well capacity
of the pixels itself, but we're getting close to 64,000,
which is the end of the 16-bit range. So we're just starting
to cut off pixel values, and that will also reduce the actual noise here.
Okay, I hope I explained to you how with very simple means,
you can check the quality of your camera. And you can really
quite easily measure if your camera is performing the way you
would like it to perform.