Assignment 1: As Fast As Fast Can Be

These Canon PowerShots don't allow you to control everything, but you do have full control over the mechanical shutter. The shutter is the between-the-lens type, which you would expect would move pretty slowly, but in fact it can be very fast. How fast? Well, that's your first question to answer....

The idea here is very simple. First, determine the fastest reliable shutter speed. That should be something faster than 1/1000s. Now all you need to do is write a script that will make a reasonably bright exposure at that speed... even if the lighting conditions are way too dark. You can't open the aperture more because there isn't an iris. Thus, all you can play with is the ISO.


One of the more interesting fundamental debates in the digital camera community had 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 centered 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:

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.

I'll jump right to the punchline and tell you that your PowerShot does indeed produce higher quality images by boosting the film speed in digital postprocessing. In other words, turning-up the camera ISO gives lousy results because it simply bumps the analog gain amplifying noise.

Your Project Using CHDK Lua Scripting

You are going to write a script that always fires the shutter once at the highest speed you've found your Canon PowerShot A4000 nor ELPH 115 can consistently use. You'll let the camera meter the exposure, but you'll ignore what it wants to do, always firing the shutter at the top speed with ISO at whatever setting was set beforehand. It will generally underexpose by quite a bit... and your script can read by how much.

The image you capture should include a raw file. 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. Use repeated summing to multiply the image brightness so that the scene isn't so dark anymore.

Another nice new feature in CHDK is raw development. Your script should use this to convert the summed raw into a finished JPEG.

Due Dates, Submission Procedure, & Such

You will be submitting source code (for your Lua script; call it fastest.lua), a make file (which does nothing much for this project except maybe format your implementors notes), and a simple "implementor's notes" document -- this time, formatted semi-formally, as specified here. Aside from a brief overview of how your script works, be sure to answer the question: what is the fastest reliable shutter speed for your camera? In addition to the source code, it would be reasonable to include at least a couple of images -- one taken normally exposed at a slower shutter speed, 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 18, 2016. 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 Cameras as Computing Systems