Assignment 1: ISO-less?

One of the more interesting fundamental debates going on in the digital camera community has to do with "ISO speed" of sensors. ISO is the International Organization for Standardization, and the particular standard is ISO 12232:20076 Photography -- Digital still cameras -- Determination of exposure index, ISO speed ratings, standard output sensitivity, and recommended exposure index. Don't bother looking for this document online (it isn't freely available), but the interesting thing is that it actually provides manufacturers with five different techniques for determining ISO. The three methods from the original 1998 version of the standard compute ISO speed from sensor properties such as sensitivity and noise, while the two 2006 additions compute ISO values based on appearance of the JPEG image produced: SOS and REI. The SOS (Standard Output Sensitivity) is based on matching a reference Y-channel value in the JPEG, and should consistently be about 0.704 times the ISO speed, resulting in somewhat brighter images. The REI (Recommended Exposure Index) is somewhat more arbitrary, intended to approximate the value that would generally give the best metering results for most users and scenes. We'll talk about them all here as if they are interchangably "ISO" because cameras rarely document how the marked/published ratings were selected, but keep in mind that "ISO speed," SOS, and REI are really not quite the same thing... in the same way the 1947 ASA (American Standards Association) speed and EI (Exposure Index) values were not quite interchangable for film.

The debate centers on whether changing the ISO setting of a camera actually changes any significant property of the image quality. When one changes the ISO setting on a camera, you are obviously still using the same physical sensor. However, potentially two things do change:

The debate centers on how the sensor gain is changed while keeping the exposure settings the same.

Suppose that the combination of aperture and shutter speed you desire would require ISO 6400 to make a technically correct exposure as the scene is lit. Imagine taking two exposures with those exposure settings, one with the camera ISO set at 6400 and another at ISO 100. The ISO 100 image is clearly grossly underexposed, but using the raw data we can digitally change the gain in postprocessing. This postprocessing is analogous to what was known as "push processing" of film -- over-developing to compensate for underexposure. Here is a DPReview posting claiming to have done precisely the ISO 6400 vs. 100 comparison described above. The claim is that not only is the ISO 6400 shot not better, but it is actually worse than the ISO 100 shot because the ISO 100 shot preserved more highlight details. In other words, the ISO 100 shot had a greater dynamic range, doing equally well in dark areas but preserving more detail in highlights.

The folks developing Magic Lantern recently discovered that on Canon DSLRs with dual sensor readout channels, they could control sensor gain independently on interleaved rows of sensels, thus implementing "Dual ISO" exposures (with exposure settings shared by pixels at both ISOs) from which careful raw processing could extract a greater dynamic range. They claim an ISO 100/800 exposure has about 3 stops more dynamic range than an exposure made at either single ISO.

DxOMark has measured detailed properties of cameras and their sensors. A tool allowing comparison of camera models is freely available; the same data is also freely available in a form processed differently to give more insight into sensor details. For example, compare the dynamic range as ISO setting is changed for the Sony NEX-7 and the Canon EOS 70D. You'll see that the Sony sensor dynamic range drops about 1 stop for each stop increase in ISO speed -- in other words, the NEX-7 sensor is ISO-less. In contrast, the EOS 70D doesn't start losing dynamic range at that rate until around ISO 400, implying that changing ISO setting really does shift the placement of the dynamic range... and explaining why ML's Dual ISO hack can be effective.

Your Project Using CHDK Lua Scripting

Neither the Canon PowerShot A4000 nor ELPH 115 has been tested by DxOMark. In fact, none of the PowerShots using that 16MP sensor have been. So, are they ISO-less?

The camera knows how to adjust the ISO normally, so we don't need to do anything to try it for ISO 100, 200, 400, 800, or 1600. Using the CHDK controls, you can even extend that range without doing any programming; for example, adding ISO 50 is a very reasonable thing to try.

To adjust the ISO in postprocessing, you need to write a little CHDK Lua script. Here's how it should work:

  1. There should be three parameters to your script that can be set by the script user:
  2. If c isn't 0, set the camera ISO to a*2b and capture a comparison photo.
  3. The script should set the camera ISO to a, thus setting internal (analog) sensor gain.
  4. The script should set the exposure settings to integrate b stops less light. Neither of the cameras used in this course really have an aperture control, so this means simply reducing the time the shutter is open by an appropriate amount. This can be done in many ways, ranging from setting exposure compensation to explicitly changing the shutter speed.
  5. Capture at least one raw image with those settings.
  6. Lua now supports some operations on raw files. In particular, you can use raw_merge_start(0) to sum raw files. It might not be the fastest way to do this, but you can use this raw summing facility to multiply the underexposed raw by the appropriate digital gain factor -- i.e., multiply by 2b. I've posted the dumb little "average the last two raws" script I showed in class as an example of using the raw development facilities, rawavg.lua. Note that you can add an image to itself, but it would also be acceptable in your script to have the camera capture and sum separate images taken with the same exposure settings. Just be sure to mount your camera firmly if you're testing using multiple exposures; thanks to tolerancing and IS, things might not line-up perfectly even if you do fix the camera position.
  7. Another nice new feature in CHDK is raw development. Your script should use this to convert the summed raw into a finished JPEG.

Is your camera ISO-less? It is if the results from the postprocessed digital gain are comparable to or better than those from the higher "real" camera ISO. For example, compare ISO 800 to your script with a=100 and b=3. (This comparison is easy if you set c to 1.)

Due Dates, Submission Procedure, & Such

You will be submitting source code (for your Lua script), a make file (which does nothing much for this project), and a simple HTML-formatted "implementor's notes" document. Aside from a brief overview of how your script works, be sure to answer the question: is your camera ISO-less? Toward that, it would be reasonable to include at least a couple of images -- one taken normally, the other taken using your script. These should be referenced in your HTML using IMG tags with SRC in the local directory, not posted and referenced from somewhere on the WWW.

For full consideration, your project should be submitted no later than October 23, 2014. Submit your .tar or .tgz file here:

Your email address is .
Your password is

Which type of student are you?
Undergraduate registered for EE599
Graduate registered for EE699


http://aggregate.org/CACS/ Cameras as Computing Systems