# Cameras & Optics Design and a Camera Calculator Walkthrough.

## Camera Design Resources

Camera design is a multi-disciplinary effort requiring optical, mechanical, electrical, firmware, and software engineering. Talented engineers can run into areas which they are not as familiar with. We are from the worlds of optical engineering, camera module assembly, and image quality testing. We have put together a preliminary walk-through for the first-order camera design below.

- Calculate Your System Angle of View Requirements
- Select Your Image Sensor and Electronics
- Calculate Your Target Lens Focal Length
- Find Lenses that are in the Focal Length Range
- Calculate the Exact Field of View
- Calculate the Depth of Field of your System
- Design the Mechanics of your Camera

## Camera Component Selection Starts with an Angle of View Calculator

### Start by Determining the Required Camera Angle of View

The first step of a camera project is to determine the Angle of View (AoV) which you would like the camera to provide. The AoV is the same as Field of View, however, we use AoV to help clarify early stage communication. This allows you to separate your scene requirement from the functional performance of a lens and sensor combination.

You can use our camera angle of view calculator to complete this calculation, without the trigonometry. We provide an example of a security system scene layout.

A few initial questions which should be answered are:

- How many cameras do I need to provide full coverage of the scene, if more than one?
- What is the closest distance of the object/scene under inspection? What is the furthest distance of the object?
- What is the minimum distance which the camera needs to see top to bottom?
- What is the minimum distance which the camera needs to see from left to right?

## Select Your Camera Electronics

### Select Your Camera Image Sensor and Lens in Parallel

The next step is to select an image sensor and camera electronics. Many people jump to this step before determining the required system field of view requirements. Consider the requirements of both the system electronics and camera lens at the same time, otherwise, you may run into the laws of physics. A few questions to ask are:

- What electronic interface (ouput) requirements does my system have?
- What are the minimum number of pixels across an object?
- What are the total number of output pixels which your camera needs?

Now that you have identified at least one camera which could work, you should find and write down the number of Horizontal Active Pixels and Vertical Active Pixels for your desired mode. Also, find the Pixel Pitch on the sensor specification. In the case you are using the Raspberry Pi High-Quality camera, these values are 4056*3040 and 1.55um if using the "-md -3" mode.

## Define your Lens Constraints by using our Camera Focal Length Calculator

### Calculate a Range for your Lens Focal Length Requirements

The third step is to calculate a range of acceptable Effective Focal Length values. Then, establish the mechanical mounting constraints for your lens. Check whether your target Horizontal Field of View or Vertical Field of View exceeds 100 degrees. If so, the lens will likely have distortion.

You can then find lenses which are in the target EFL range.

## Use our M12 Lens Field of View Calculator to determine the Camera FoV

### Calculate the FoV of the Lens and Image Sensor Combination

The final step in the component selection process is to calculate the field of view of your selected lens and sensor combination. This can be cross-referenced against your calculated Camera Angle of View Requirements. We recommend iterating each step until you find the best camera and lens combination. If you can't find the exact combination with our lenses, please contact us.

The field of view of a lens is dependent upon the Sensor Size, the Optical Effective Focal Length (EFL) and Lens Distortion. In our calculator, we use a simplified equation which does not include distortion.

## Use our Depth of Field Calculator to determine the Camera's DoF

### Calculate the DoF of the Lens and Image Sensor Combination

Once you have selected an optimal lens and image sensor combination, you can calculate the depth of field of the system. For adjustable aperture (iris) lenses, this calculation allows you to optimize the target F/# of the system. We recommend calculating the depth of field at an earlier stage of the component selection process if your object is closer than 500mm. A 2-pixel blur is 'sharply in-focus' and a 4-pixel blur as 'moderately in-focus'.

Many people ask what is the hyperfocal distance of a camera. The definition of the hyperfocal distance is "when a lens is focused at its hyperfocal distance, the depth of field will extend to infinity". A corollary to the hyperfocal distance is the near focus distance, which is the closest distance at which the scene is in focus. When the lens is focused at the hyperfocal distance, this distance is exactly 1/2 of the hyperfocal distance.

To understand the relationship between Depth of Field and EFL and F/#, we've created a depth of field lookup chart. This chart uses inputs of the Sony IMX477 series image sensors and common M12 lens focal lengths. In practice, many people focus the lens closer than the hyperfocal distance, particularly when a lens with EFL greater than 4mm is used.

## Read our Walk Through on Lens Adapters and Camera Mount Compatibility.

### Select Your Lens Mount and Design Your Housing

We suggest starting the design of a lens mount and housing after all of the optical and electronic components have been selected. We've provided a page to help you determine the compatibility of various lens types and camera mounts