Guide · 7 min read

Choosing a camera and lens for small-defect inspection

A camera that looks sharp on screen can still miss the defect you care about. Whether it can see a scratch depends on a few numbers you can work out in advance. This guide walks through resolution, field of view, shutter type, color, working distance and lenses.

Key points
  • Resolution only means something next to the field of view. Compute millimeters per pixel.
  • Aim for several pixels across the smallest defect you must catch.
  • A global shutter exposes the whole image at once and avoids distortion from motion.
  • A mono sensor is sharper per pixel and simpler. Choose color only when color matters.
  • A fixed working distance and a fixed focus make the setup repeatable.

Resolution against field of view

Megapixels alone say little. What matters is how much of the part each pixel covers. Take the width of the area the camera sees, called the field of view, and divide it by the number of pixels across. The result is millimeters per pixel. Smaller means finer detail. A worked example. A sensor is 1600 by 1200 pixels, and the lens is set so the field of view is about 108 mm wide. Then 108 divided by 1600 is about 0.068 mm per pixel. The height covers roughly 81 mm. A part 50 mm across fills about 740 pixels.

Now ask about the defect. A scratch 2 mm long spans about 2 divided by 0.068, which is roughly 29 pixels. That is plenty to see. A scratch 0.1 mm wide, though, is only one or two pixels across, and it may fade into noise. Length and width both matter.

How many pixels does a defect need?

A widely used rule of thumb says a defect should span at least a few pixels, often three to five, to be detected reliably. Treat this as a starting point, not a law. Contrast matters as much as size. A high-contrast mark under good lighting may be found with fewer pixels, and a faint one may need more.

Work backwards from your smallest defect. If it is 0.3 mm wide and you want about four pixels across it, you need roughly 0.075 mm per pixel or finer. Then you can calculate the field of view that fits your sensor and see whether the whole part fits in one picture. If it does not fit, you have options. Use a higher resolution sensor, move closer and take several images of different areas, or inspect only the faces that matter. Each option has a cost in price, time or setup, so decide early which defects are worth the trouble.

Global shutter and rolling shutter

A rolling shutter reads the image one row at a time. If anything moves during the readout, such as a part on a conveyor or a hand placing it, the picture skews. A global shutter exposes every pixel at the same moment, so a moving or vibrating scene stays undistorted.

For a part resting in a fixture, a rolling shutter can work well, and such cameras are often cheaper. For parts that move, for use with a pulsed light, or for any case where the operator may still be moving the part, a global shutter is the safer choice. Shutter type also affects how you control light. A global shutter pairs naturally with a short, bright strobe pulse that freezes motion and cuts the effect of room light. If you plan to add strobing later, choose a global shutter now.

Mono or color

A color sensor places a small filter over each pixel, then fills in the missing colors by calculation. A mono sensor has no filter, so every pixel records brightness directly. For the same pixel count, mono gives sharper detail and more light per pixel. For many surface checks, such as scratches, dents and nicks on metal, brightness and shape are what matter, and mono is a good fit. It also works well with colored light and matching filters, which can suppress room light.

Choose color when color is part of the defect: stains, discoloration, anodize shade, wrong finish, or colored markings. If color matters on only some checks, consider whether a second camera or a separate step is simpler than giving up mono sharpness everywhere. Pick the lens and distance together, because changing one changes the other.

Working distance and M12 lenses

The working distance is the gap between the lens and the part. For a given lens, a longer distance gives a wider field of view and a coarser look. A shorter distance gives finer detail but a smaller area, and it can leave less room for lights and for loading parts.

Many compact cameras use M12 lenses, also called S-mount, named for their 12 mm thread. They are small, cheap and come in many focal lengths. A longer focal length gives a narrower view at the same distance. Check that the lens is made for the sensor size, or the corners of the image may be dark or soft.

Plan for repeatability. Lock focus and aperture once the image is sharp, and fix the camera at a set distance. Look at lens distortion at the edges, since straight edges can curve and a defect near the border may look different. Also check whether a filter, such as a polarizer, can be fitted to the lens.

Putting it together

Start from the defect and the part, not from a catalog. Write down the smallest defect that matters, the largest area you need in view, and whether the part stays still. From those, work out the millimeters per pixel you need and the field of view that results. Then pick the cheapest camera and lens that meet those numbers with some margin. Test with real parts before you buy anything in quantity: photograph a few good parts and a few defective ones, and check whether the defects you care about are visible to the eye in the image. If you cannot see them, software will struggle too.

Finally, remember that optics are only part of the answer. A sharp image under bad lighting still hides defects. Lighting, a fixed position and a repeatable setup decide as much as the sensor does, so plan them together. Photograph real parts first, and decide only once you can see the defect.

The VZSOR station uses a fixed camera, a fixed lens and a fixed working distance, with a field of view of about 100 to 120 mm. That is set up once at the bench so every part is imaged the same way. It is an inspection aid for visible surfaces and is not a dimensional gauge.

Questions

How do I calculate millimeters per pixel?
Divide the width of the field of view by the number of pixels across the sensor. For example, 108 mm across a 1600 pixel sensor gives about 0.068 mm per pixel.
Do I need a global shutter camera?
Not always. A part resting in a fixture can work with a rolling shutter. Choose a global shutter if parts move during capture, if hands may still be moving them, or if you plan to use strobed light.
Is more resolution always better?
No. More pixels can give finer detail, but they also mean larger files, slower processing and often more demanding lenses. Work out the pixels you need across your smallest defect, then choose the simplest sensor that provides them.

Try it on your parts.

$3,500 pilot on one part number, station on loan, 30–60 days. The fee is credited toward a station if you buy within 30 days.