Foundation of Camera Modeling - lorentzo/IntroductionToComputerGraphics GitHub Wiki

General

  • Camera in 3D scene is required to specify information for "recording" an 2D image from a 3D scene.
  • Camera is used to solve 3D viewing problem: how to project a 3D scene onto a 2D image for display.
    • Orthographic vs perspective camera
  • Simplest camera model is Pinhole Camera Model.
  • More complex camera models (e.g., thin-lens, fish-eye or multi-lens example) are building on concept of Pinhole camera.
  • The most important function of the camera is to define the portion of the scene that will be recorded onto the film.
    • This is called viewing volume.
    • For ray-tracing, camera is used to generate viewing rays which contribute to final image
    • For rasterization, viewing volume is used to determine which geometry is visible, which is than projected on camera plane.
  • Pinhole camera is simple to model, but neglects important effects that lenses have on light passing through them that occur with real cameras.
    • For example, everything rendered with a pinhole camera is in sharp focus
    • modeling effect of lenses is important for accurately simulating the radiometry of image formation.
    • Camera lens systems also introduce various aberrations that affect the images that they form:
      • Vignetting causes a darkening toward the edges of images due to less light making it through to the edges of the film or sensor than to the center
      • pincushion or barrel distortion causes straight lines to be imaged as curves
  • Camera coordinate space:
    • Object space vs World space vs Camera space
    • A camera is placed in the scene at some world space point with a particular viewing direction and orientation (e.g., viewing in z direction with y as up direction). This camera defines a new coordinate system with its origin at the camera’s location.
    • If objects are projected on camera plane (e.g., for rasterization). We have three more coordinate systems:
      • Screen space: Screen space is defined on the film plane. The camera projects objects in camera space onto the film plane; the parts inside the screen window are visible in the image that is generated. Depth z values in screen space range from 0, to 1, corresponding to points at the near and far clipping planes, respectively. Note that, although this is called “screen” space, it is still a 3D coordinate system, since values are meaningful.
      • Normalized device coordinate (NDC) space: This is the coordinate system for the actual image being rendered. In x and y, this space ranges from (0,0) to (1,1), with (1,1) being the upper-left corner of the image. Depth values are the same as in screen space, and a linear transformation converts from screen to NDC space.
      • Raster space: This is almost the same as NDC space, except the x and y coordinates range from (0,0) to (image_resolution.x, image_resolution.y).

Pinhole Camera Model

  • Pinhole camera is light-tight box with a tiny hole at one end. When the hole is uncovered, light enters this hole and falls on a piece of photographic paper that is affixed to the other end of the box. Very long exposure times are necessary to get enough light on the film to form an image.
  • Connecting the pinhole to the edges of the film creates a double pyramid that extends into the scene. Objects that are not inside this pyramid cannot be imaged onto the film.
    • This defines a region of space that can potentially be imaged onto the film as the viewing volume.
  • Another way to think about the pinhole camera is to place the film plane in front of the pinhole but at the same distance
    • In this case, pinhole is called the eye
    • This is the abstraction that we are using for simulation.
  • Pinhole camera defines pyramidal viewing volume
    • During ray-tracing, it is used to generate rays that travel along the vector between the pinhole and a point on the film, only those rays can contribute to that film location. The pinhole is used as the origin and the vector from the pinhole to the near plane as the ray’s direction.
    • During rasterization, pyramidal viewing volume is used to determine which objects should be projected onto camera plane

Topics:

  • pinhole size, exposure, depth of field and lenses
  • Focal Length, Angle Of View and Field of View
  • Film Size - Image Resolution and Frame Aspect Ratio
  • Near and Far Clipping Planes and the Viewing Frustum
  • The Near Clipping Plane and the Image Plane
  • Ray generation: ray-tracing
  • Projection: rasterization

For each topic:

  • Practical example (e.g., image) and technical explanation

Literature