EECE 5554 Robotics Sensing and Navigation  /  Interactive demo

Aim the roof camera

A camera on the roof of our Mustang sees the ground through the pinhole model: every point is divided by its distance and scaled by the focal length. Set the mounting height, the pitch, and the lens, and see the image, the field of view, the closest ground the camera can see, and how big one pixel is on the road.

Runs pinhole_camera.pyLecture 11
Starting...

Mounting

Height
Pitch down

Lens

The camera is the course stereo rig's Blackfly S BFS-U3-19S4C: 1616 × 1240 pixels, 4.5 µm each. The 5 mm lens is the one on the car.

What the camera sees: a ground grid every 2 m across, distance lines ahead, a 3.6 m lane in white, and a 1.7 m tall person (red) 10 m ahead.

Try this

  1. With the defaults, read the table: one pixel 20 m ahead is about 2 cm across but about 21 cm along the road. Distance along the road is the hard direction.
  2. Raise the pitch until the horizon leaves the image. The camera sees closer to the car, but nothing far away.
  3. Switch to the 3.5 mm and the 12 mm lens. A wider lens sees more road, and each pixel covers more of it.
  4. Lower the height to 1.2 m. The along-the-road footprint grows: one reason the rig goes on the roof.

Notebook

Work with the same script in cells, like Jupyter, right here in the browser. Edit any cell and run it. Nothing is saved: Reset brings a cell back, and Download .ipynb keeps your edited version for VS Code or Jupyter.

Loading Python...
The Python script: pinhole_camera.py

This is the script the page runs. Run it yourself with python3 pinhole_camera.py.

pinhole_camera.py