Saturday 11 March 2017

Image Sensor Theoretical Performance Calculator

For my previous blog post Comparing the Theoretical Performance of Four Hackable Cameras I wanted to compare the performance of some image sensors using the values found in their datasheets. However, looking at the datasheets did not make their relative performance obvious, especially since the manufacturers do not always provide the information in a clear to understand format. So I had to work out how to calculate the read noise of each sensor using the numbers provided in the datasheets. In addition, I wanted to calculate a value for the signal-to-noise (SNR) that could be expected for a specific light level (in lux) and a specific exposure time.

In case it is of use to others I've created this calculator. The example buttons on the right hand side of the calculator can be used to see the exact numbers used for the four image sensor that were compared in the previous blog post.
Examples


Reference Lux Values[3]
Illuminance (lux) Surfaces illuminated by
0.0001 Moonless, overcast night
0.05–0.36 Full moon on a clear night
20–50 Public areas with dark surroundings
100 Very dark overcast day
320–500 Office lighting
400 Sunrise or sunset on a clear day
1000 Overcast day
10,000–25,000 Full daylight
32,000–100,000 Direct sunlight

F/#: the F-number of the lens

Scene Reflectivity: the proportion of light reflected by an object in scene

Average Quantum Efficiency: the average proportion of light (photons) converted to signal (electrons) by the image sensor

Read Noise

Parameter Value
Max SNR `(dB)`
Full Well Capacity `(e^-)`
Dynamic Range `(dB)`
Read Noise `(e^-)`
</ br>

Signal

Parameter Value
Pixel Size `(\mum)`
Incident Illuminance `(lux)`
`F//#`
Scene Reflectivity, `R`
Average Quantum Efficiency, `q`
Exposure Time, `t` `(s)`
J `(e^-)`
Shot Noise `(e^-)`
</ br>

Result

Parameter Value
Read + Shot Noise `(e^-)`
SNR `(dB)`

How is the calculation performed

Estimating the read noise

Where read noise statistics are not provided by the manufacturer they can be estimated using the full well capacity and the dynamic range.
The dynamic range is calculated by dividing the maximum signal, which is the full well capacity, by the read noise.[1]

`drg = 20*log_10({fwc}/{rn})`

where:
`drg` is the dynamic range `(dB)`
`fwc` is the full well capacity `(e^-)`
`rn` is the read noise `(e^-)`

If the full well capacity is not stated in the datasheet it is usually possible to calculate it by using the maximum SNR figure often provided by manufacturers. This is the maximum SNR, which occurs when the signal is equal to the full well capacity.

`SNR_{max} = 20*log_10({fwc}/{tn})`

where:
`tn` is the total noise `(e^-)`

It is usually okay to assume that the total noise is dominated by the shot noise at the maximum signal.
`SNR_{max} \approx 20*log_10({fwc}/sqrt(fwc)) \approx 20*log_10(sqrt(fwc))`

Estimating the signal

To calculate the SNR it is necessary to estimate the number of electrons generated in each pixel during the exposure. To estimate the number of electrons generated, an equation was taken from the paper “When Does Computational Imaging Improve Performance?”[2].

Note: This calculation is an approximation but should be of the right order of magnitude.

`J = 10^15 (F//#)^{-2}tI_{src}R q\Delta^2`

where:
`J` is the number of generated electrons
`F//#` is the f-number of the lens
`t` is the exposure time
`I_{src}` is the incident illuminance in lux
`R` is the average reflectivity of the scene
`q` is the quantum efficiency of the sensor
`\Delta` is the size of a pixel in metres

Estimating Quantum Efficiency

For the values of the quantum efficiency (QE) it is usually necessary to estimate them from the charts put in the datasheets. For colour sensors, since each colour channel blocks approximately ⅓ of the photons, the QE can be approximated by taking the peak QE for the three colour channels and dividing by three.

References

[1] https://theory.uchicago.edu/~ejm/pix/20d/tests/noise/noise-p2.html
[2] When Does Computational Imaging Improve Performance?
[3] https://en.wikipedia.org/wiki/Lux

Monday 6 March 2017

Comparing the Theoretical Performance of Four Hackable Cameras

Update (11/03/2017): If you are looking to calculate your own read noise and SNR values like those used in this comparison, take a look at the calculator I've created for the blog post Image Sensor Theoretical Performance Calculator.


I'm currently looking for a hackable camera for a project requiring relatively good low light level performance and at least a 1 megapixel resolution. I have identified four possible cameras but it is not immediately obvious which best fits my needs from looking at the datasheets. This post covers how I have gone about comparing the options.

The cameras are:
  1. The Raspberry Pi OV5647 (2592 x 1944) based camera [1]. This is available as a module which has a built-in lens with an F-number of 2.9
  2. The OV9712 (1280 x 800) which is available as a module that contains a hackable Linux based system using the HI3518. It doesn't have a fixed lens so can be fitted with a fast (low F-number) lens if desired
  3. The AR0130 (1280 x 960) that is also available as an HI3518 based module. It doesn't have a fixed lens so can be fitted with a fast (low F-number) lens if desired
  4. The MT9M001 (1280 x 1024) which is an interesting 1/2" monochrome sensor mentioned as compatible with the Arducam development platform[2]. Like the Raspberry Pi camera it also has a built-in lens which one datasheet suggests has an F-number of 2.8

To get an idea of the performance, I wanted to be able to compare their read noise values, as well as the signal-to-noise ratio (SNR) that could be expected for a specific light level (in lux) and a specific exposure time. In low light level conditions read noise usually dominates. However, the SNR value should provide a better idea of the expected quality of an image. An acceptable SNR for an image is typically taken to be 20dB and an excellent SNR for an image is 30dB+.[3]

To calculate the SNR value two pieces of information are needed: a value for the total noise and an estimate of the signal level, which is related to the amount of light collected by the image sensor and the efficiency by which the sensor converts it into a voltage. (Note: I have considered the read (temporal dark) noise and shot noise but not other sources of noise. For instance, in applications requiring a very long exposure time, thermal noise will start to become an important factor.)

Some manufacturers provide a value for the read noise however if this is not the case it is possible to work it out using the stated dynamic range and full well capacity of the sensor. Where the full well capacity is not provided this can be estimated using the maximum SNR value that some datasheets contain.

For the estimate of the signal level, the approach taken in the paper “When Does Computational Imaging Improve Performance?”[4] was used.

I wanted to get an impression of how these sensors would compare in low light levels with a exposure time of 0.005s. This exposure time was chosen based on a need to image a target moving at ~2m/s with a ground pixel size of 1cm. This means to prevent motion blur the exposure time would need to be in the range of 0.01/2s = 0.005s.

The resulting read noise and SNR values I calculated were:
Sensor Read noise `(e^-)` SNR value
OV5647 1.92 -6.94
OV9712 4.6 9.57
AR0130 2.00 15.09
MT9M001 12.30 9.80

Observations:
  • The SNR results suggests that the AR0130 would perform the best under the assumed conditions, while the Raspberry Pi camera (OV5647) would perform the worst. This is even though the OV5647 has the lowest read noise, suggesting that using the read noise values alone to compare cameras for low light level applications is not sufficient.
  • The read noise of the OV5647 and AR0130 were low at ~2e- while the read noise for the MT9M001 was much higher at 12e-. This is likely due to the MT9M001 being an older design.
  • The OV5647 has a low expected SNR even though it has the lowest read noise due to it's small pixel size and the high F-number of the built-in lens, which both result in a small signal (a small number of photons hitting each pixel)
  • It is possible to get the Raspberry Pi camera with a removable lens, which would allow for a faster (lower F-number) lens to be used. If the F-number is changed from 2.9 to 1.4, which is the same F-number used for the AR0130, the SNR increases to 3.44dB. This is still lower than the rest of the sensors due to the small pixel size on the OV5647
  • Another option for the Raspberry Pi camera is to bin the pixels. The resolution of the OV5647 is higher than the rest of the sensors by approximately a factor of 2 along each dimension. 2x2 binning of the pixels on the Raspberry Pi camera results in a resolution of 1296x1944, which is similar to the other sensors. Performing 2x2 binning results in a read noise for the combined pixels of `sqrt(1.92^2 * 4) = 3.84e^-`. Binning also results in a binned pixel size of 2.8`\mum`. Taking this into account the Raspberry Pi camera is still expected to perform worse than the AR0130, with a read noise and pixel size closer to the OV9712.
Based on these results I've purchased an AR0130 HI3518 based camera module to have a play with. I'll write another blog post covering how well it perform.

References

[1] https://www.raspberrypi.org/documentation/hardware/camera/
[2] http://www.arducam.com/camera-modules/1-3mp-monochrome-infrared-camera-module-mt9m001/
[3] https://en.wikipedia.org/wiki/Signal-to-noise_ratio_(imaging)
[4] When Does Computational Imaging Improve Performance?