To choose machine vision camera resolution, divide the field of view by the size of the smallest feature you must detect, then multiply by the number of pixels you need across that feature, typically 3 or more for defect detection and more for measurement. The result is the minimum pixel count in each direction. A 100 mm field with a 0.2 mm smallest defect at 3 pixels per defect needs at least 1,500 pixels across.
Resolution is only one part of a machine vision system, but it is the first number that rules a camera in or out. This article explains the formula, works through an example including the aspect-ratio trap, covers line scan cameras and lenses, and includes a calculator.
The formula
- Pixel size on the part = smallest feature ÷ pixels needed across it.
- Pixels needed in each direction = field of view in that direction ÷ pixel size on the part.
- Choose a sensor with at least that many pixels in both directions, then check the field it actually covers.
How many pixels across the feature?
| Task | Pixels across the smallest feature | Why |
|---|---|---|
| Presence or absence of a large feature | 2 to 3 | Only needs to be detectable |
| Defect detection | 3 to 5 | Separates a real defect from noise and texture |
| Classifying defect types | 5 to 10 or more | The system must see the defect’s shape |
| Measurement and gauging | Set by tolerance and repeatability | Sub-pixel edges help, but plan from the tolerance; see machine vision metrology |
| AI and deep learning | Similar to defect detection, or more | Models need visible detail to learn from |
For measurement, size from the tolerance instead: our article on machine vision metrology works through a gauge sized to a ±0.025 mm tolerance.
Worked example, including the aspect-ratio trap
Field of view: 100 mm wide by 75 mm tall. Smallest defect: 0.2 mm. Required: 3 pixels across it.
- Pixel size on the part: 0.2 ÷ 3 = 0.0667 mm.
- Pixels needed: 100 ÷ 0.0667 = 1,500 across, and 75 ÷ 0.0667 = 1,125 down. That is about 1.7 megapixels.
- A common 1,920 × 1,200 sensor (2.3 MP) has enough pixels in both directions.
Now check the field it really covers. The camera’s 16:10 sensor does not match the 4:3 field, so one direction sets the scale. Fitting 100 mm across 1,920 pixels gives 0.052 mm per pixel, but then 1,200 pixels cover only 62.5 mm vertically, short of 75 mm. Fitting 75 mm across 1,200 pixels instead gives 0.0625 mm per pixel; the camera then sees 120 mm by 75 mm, and the 0.2 mm defect spans 0.2 ÷ 0.0625 = 3.2 pixels. That still meets the requirement, with a little margin.
| Sensor (pixels) | Megapixels | Pixel size on part to fit 100 × 75 mm | Pixels across 0.2 mm | Meets 3 px? |
|---|---|---|---|---|
| 1,440 × 1,080 | 1.6 | 0.0694 mm | 2.9 | No |
| 1,920 × 1,200 | 2.3 | 0.0625 mm | 3.2 | Yes |
| 2,448 × 2,048 | 5.0 | 0.0408 mm | 4.9 | Yes, with margin |
| 4,096 × 3,000 | 12.3 | 0.0250 mm | 8.0 | Yes; enough to classify |
For each sensor the scale is the larger of 100 ÷ width and 75 ÷ height, since both dimensions must fit. Higher resolution is not free: it lowers frame rate, raises data rates and processing load, and usually needs a better lens.
Resolution calculator
Estimates only. Lens quality, lighting and contrast also decide what a camera can detect; confirm with a test on real parts.
Line scan cameras: resolution along the travel
A line scan camera has resolution across the web from its pixel count, and along the web from the line rate. Pixel size along the travel = speed ÷ line rate. To get 0.05 mm pixels on material moving at 500 mm/s, the camera needs 500 ÷ 0.05 = 10,000 lines per second (10 kHz). Across a 1,000 mm web at the same 0.05 mm, it needs 1,000 ÷ 0.05 = 20,000 pixels, which usually means two or more cameras side by side with overlap.
Choosing the lens to match
- Focal length. As a first estimate, focal length ≈ sensor width × working distance ÷ field of view. A sensor 8.45 mm wide (2,448 pixels of 3.45 µm) viewing a 100 mm field from 300 mm needs about 8.45 × 300 ÷ 100 ≈ 25 mm.
- Lens resolving power. The lens must resolve the pixel. For 3.45 µm pixels, the Nyquist limit is 1 ÷ (2 × 0.00345 mm) ≈ 145 line pairs per mm; a lens rated well below that blurs detail the sensor could otherwise capture.
- Sensor format. The lens image circle must cover the whole sensor without dark corners.
- Measurement work often needs a telecentric lens, sized to the field of view.
Other things that limit what a camera can see
- Contrast. A defect three pixels wide is invisible if it does not stand out. Lighting usually matters more than extra megapixels.
- Motion blur. Blur in pixels = speed × exposure time ÷ pixel size. At 200 mm/s, a 100 µs exposure and 0.0625 mm pixels, blur is 200 × 0.0001 ÷ 0.0625 = 0.32 pixels, which is acceptable; ten times the exposure is not.
- Depth of field. Smaller pixels and wider apertures reduce the range of distances in focus.
- Frame rate and data. More pixels mean more data per second for the network and processor to handle.
Want the numbers checked on real parts?
Sciotex specifies cameras, lenses and lighting around your smallest defect, and is vendor-neutral on hardware. Send sample parts for free testing and we will confirm the resolution your application needs.
Frequently asked questions
Divide the smallest feature size by the number of pixels you want across it to get the pixel size on the part, then divide the field of view by that pixel size in each direction. Choose a sensor with at least that many pixels in both directions.
A common starting point is 3 pixels for detection, 5 or more for reliable classification, and more again for measurement, where the tolerance and required repeatability set the number.
No. More pixels lower the frame rate, increase data and processing, and need a sharper lens. Lighting and contrast often limit detection before resolution does.
The field of view is the area the camera sees. Resolution is the number of pixels spread over it. The same camera covering a smaller field sees finer detail.
Across the material, divide the width by the pixel count. Along the travel, pixel size equals line speed divided by line rate, so a faster line or finer pixel needs a higher line rate.
Related articles
- Machine Vision: The Complete Guide to Machine Vision Systems
- Camera Types Used in Vision Systems
- Machine Vision Metrology: Accuracy, Calibration and Gauging
- Smart Camera vs PC-Based Vision Systems
- Lighting Systems Used in Machine Vision
- Automated Inspection System Examples: Machine Vision Case Studies