ECE516 Lab01, 2024: What is a camera? Fundamentals of Intelligent Image Processing.

Introduction

This lab teaches, in the most fundamental way, the first and foremost element of imaging: what a camera is. This lab will be done individually. Each person in the class does this lab. Subsequent labs will be done with lab partners, once you all get to know each other (2 people per lab group).

This first lab will also help you get to know others in the course and what they are capable of. Think of this lab as a chance to show off to the rest of the class and build possible connections.

The word "camera" is an abbreviation of the Latin term "camera obscura" which means "darkroom". "Camera" is Latin for "room", and "obscura" is Latin for "dark". Early cameras were large darkrooms and people would go inside the camera to see the picture:

Pictures, Wikimedia Commons; article: Camera Obscura

Sometimes people would setup or build a tent or other struture and put a blank framed canvas inside to make a painting of what appeared there.

You might enjoy watching this video: Camera obscura on a houseboat https://www.youtube.com/watch?v=nye6iEMv33M

Also you might like to subscribe to my YouTube, Hydraulist, and watch these videos:
What is a camera? Fundamental lecture on what a camera is and
Livestream lecture "What is a Camera?"
ECE516 week2 lectures camera obscura part2 making... from 2021

Let's get started

In this lab you will experiment with the camera obscura principle.

In the first part of the lab you will build 2 cameras, a large one and a small one, and experiment with various aperture sizes and note the effects of aperture size versus camera size on the sharpness and light qualities in the camera.

In the second part of the lab you will try to understand the mathematical principles behind this very simple form of imaging.

Lab 1 Part A

Build a large camera obscura and a small one. For the large one you can use a room in your house, or a nice large box that you can look into easily, e.g. ideally big enough to put your head into. For the small camera build something into which you can fit a smartphone or a smartphone lens to take a picture of a picture in the camera. In both cases you are taking a picture of a picture. This is called metadocumentary, metaphotography, or metavision, or Through The Viewfinder (TTV) photography.

What is metaphotography?
(link to photographic version of our logo)
Meta is a Greek word that means "beyond", e.g. a meta-conversation is a conversation about conversations, or a meta-argument is an argument about arguments. Meta-data is data about data, e.g. the GPS location in which a photograph was taken embedded into the header of a JPEG photo.

Meta is also the name of the Silicon Valley company founded by Steve Mann and his student Raymond Lo, along with Meron Gribetz, and Ben Sand, based on the technology of US Patent 9,720,505, "Extramissive spatial imaging digital eye glass...", Gribetz; Meron (New York, NY), Mann; W. Steve G. (Toronto, CA) , filed January 3rd, 2014, and US Patent and Trademark Office, Patent Application 61/748,468, Jan 3, 2013. See http://wearcam.org/meta/

Part Ai

A room with a small window that has a good view works really well. A small window is easy to cover up with black cardboard or black cloth or the like. For example you can cut a piece of cardboard to fit tightly into a small window to make the room dark. The room should be completely dark except for a small hole through which light enters to create the picture on an opposite wall or other surface. Experiment with different sized holes and note the result. A black cloth can be stuffed under the crack in the door to the room to keep it dark. When choosing a room, it is best to have a view to a brighly lit place that has high contrast subject matter. I chose a darkroom with a covered skylight, having a view of a tree. That didn't turn out too good, so I then chose a small wood storage room that faced North so the sun was behind the camera, shining brightly on the subject matter to be photographed, which was a nice group of laneway houses. Sitting inside the room I could clearly see the image of the laneway houses on the screen. I used a white board for the screen, but imperfections made the image kind of unclear, so I later covered the board in white paper to get a better image. I used my smartphone (Huawei P30 Pro) to take the picture of the white board. I used a 30 second exposure at ISO 3200. If you have a tripod that helps, or you can press and hold the picture-taking camera such as a smartphone firmly against a desk or opposite wall or other structure so it stays perfectly still for the duration of the exposure (e.g. in my case, for the 30 seconds).

Try various size openings from the whole window, to half window, quarter window, etc., and keep decreasing the size of the opening. This will help you understand the principle. No need to paint the walls black.| It works better if you have dark walls but try whatever is simplest first. You can try some black cardboard or black cloth on some of the walls to make the image a bit more crisp and contrasty, but start with whatever you can readily do with what you have handy.

If you don't have a room with a window that faces a bright scene, you can use a large box. I didn't have a box big enough for me to fit inside, so I found one that was big enough I could put my head inside the box, which still gave me the full "camera obscura" effect of being able to see the image. If you don't have a really big box handy, you could use a medium-sized box and cut 2 large holes for your eyes to look into, and of course a small hole for the pinhole.

Part Aii

Now that you have made a large pinhole camera, make a small pinhole camera. For this I used a small box with a pinhole for the aperture and a larger hole to photograph the camera obscura's screen through.

Optimal pinhole size

Explain what you noticed about the large camera versus the small camera. What size pinhole works best for the large camera? What size pinhole works best for the small camera?

The optimal pinhole size is based on a tradeoff between classical optics (i.e. that light travels in straight lines) and modern optics (diffraction effects). Classical optics would have that a smaller hole gives a sharper image. So a big window makes a really fuzzy image, but blacking out most of the window except for a small hole makes a sharper image. But today it is well-known that the far-field diffraction pattern is the Fourier transform of the electric field across the aperture. So when you make the aperture smaller the diffraction pattern gets bigger. Take a look at this for example from Lecture 1: http://wearcam.org/html5/mannkeynotes/images/plotter_stepper_motors_interference_patterns_varying_spacing.gif.

As you can see there is a kind of reversed effect: at some point a smaller hole gives you a fuzzier image.

A great deal of research has been done regarding the optimum aperture size. Here's the general formula for diameter of the aperture:

d=c √(fλ),
where
d = optimal hole (aperture) diameter;
f = focal length (distance from aperture to image plane);
λ= wavelength o light, e.g. pick something around the middle of the range of human vision such as green = 550nm (which is also the wavelength to which human vision is most sensitive), or to which your sensor or film is most sensitive;
c = a constant related to the Rayleigh criterion 1.22λ/d (with some adjustment for other factors).
We usually use something in the range from c=1.56 to c=2. So if your screen is 50cm from the aperture, the it should be about 1mm in diameter. If the screen is 1 metre from the aperture, it should be about 1.5mm in diameter, and if 2 metres away, 2mm in diameter, 4 metres away, 3mm in diameter, and so on.

Reference reseach citations regarding calculation of optimal pinhole size

Professor Petzval, in 1859 https://www.tandfonline.com/doi/pdf/10.1080/14786445908642614 proposed c = sqrt(2).

In 1891 Lord Rayleigh confirmed this value c=sqrt(2) https://www.biodiversitylibrary.org/item/93442#page/9/mode/1up
but later published a 2nd paper https://www.tandfonline.com/doi/abs/10.1080/14786449108620080 suggesting that c should be between sqrt(2) and 2.

More recently it has been suggested that the size of hole should optimize not just sharpness but also contrast, i.e. containment of stray light, and this paper proposed the optimum constant to be 1.56: https://www.kth.se/social/files/5c7fae6756be5bc7488edcb5/Pinhole%20camera.pdf

We often use something in the range c=1.5 to c=2.

Making a small box camera (Part Aii)

There are 2 basic designs, either you can have your screen viewed from the same side as the image, or from the opposite side. Use a small box or other housing and put a viewfinder display screen at one end and a hole or a lens at the other end to let light in. Ideally you'll make your box black. You can use black cardboard to make the box, or you can line it with black cardboard, or paint it black. Be prepared to explain why it should be black (at least on the inside), except for the opening and the screen.

Part B: Mathematical analysis

Explain what a camera does. Derive a mathematical relationship between planar subject matter and what is projected onto the camera image plane. For simplicity you may assume you're living in a 2-dimensional world and the image and subject matter are both 1-dimensional. Draw simple diagrams that show you understand what a camera is and what it does.

Marking scheme for 2023:

Post your results to the following Instructable, by clicking "I made it" and submitting pictures, text, descriptions, etc.: Pinhole Camera for Teaching and Research and then bring to the lab (BA3165) to present your results, Thurs. Feb. 2nd, 9am.

After your demonstration in the lab, we'll have some fun and show you how to jump into the metaverse and beyond. To get the most out of this experience, please bring a computer with the following installed:

External links:
Meta photography (meta-documntary), also known as "Through the Viewfinder photography": https://en.wikipedia.org/wiki/Through_the_Viewfinder_photography [Leonardo, Vol. 31, No. 2, pp. 93-102, 1998]
Flickr, "Through the Viewfinder": https://www.flickr.com/groups/throughtheviewfinder/
Through the viewfinder howto: https://blog.jpegmini.com/photography-tutorial-shooting-through-the-viewfinder/
#throughtheviewfinder
https://vimeo.com/104088954
https://kids.nationalgeographic.com/explore/books/pinhole-camera/
https://www.wikihow.com/Make-a-Pinhole-Camera
https://wonders.physics.wisc.edu/make-a-pinhole-camera/
https://en.wikipedia.org/wiki/Pinhole_camera
https://rimstar.org/science_electronics_projects/how-to-make-pinhole-camera-from-poster-board.htm