When a vision inspection project gets stuck, tracing back the cause often leads to the image, not the model. If a defect is blurry in the image, adding more training data does not raise accuracy. Conversely, if the defect is clearly visible, even simple rules can judge it.
Camera and Resolution
Do not ask "how many megapixels should the camera have?" Work backward from how many pixels the smallest defect you must find covers.
- Set the width of the field of view (FOV) to inspect. Example: 60 mm.
- Set the smallest defect size. Example: 0.2 mm.
- Decide how many pixels that defect must span to be seen reliably. In the field, the usual target is 3 to 5 pixels or more.
- Required horizontal pixels = 60 ÷ 0.2 × 4 ≈ 1,200 pixels. Choose a camera with some margin above this.
If you capture while the part is moving, also check the exposure time. If the part moves more than 1 pixel during exposure, the edges blur. For targets that do not fit in one frame, such as long parts or rotating bodies, use a line scan camera that captures one line at a time. fineAi Viewer Pro is for line scan.
Lighting Creates Contrast
The same part can show or hide a defect depending on the lighting. When you choose lighting, think about how the defect reflects light differently from its surroundings.
| Lighting | What it shows well | Example |
|---|---|---|
| Ring light | Even illumination overall, color, stains | General appearance |
| Coaxial light | Scratches and dents on flat, shiny surfaces | Machined metal surfaces |
| Backlight | Outline shape, holes, dimensions | Silhouette measurement |
| Directional (low-angle) light | Surface relief, shallow scratches | Fine dents |
If you place several directional lights and capture while turning them on one at a time, you can even compute surface height. The lesson Photometric Stereo covers this method.
Trigger: When to Capture
If parts pass on a conveyor, the camera must capture at exactly the same position. A hardware trigger (GPIO), which feeds the sensor signal straight to the camera, captures at a constant position regardless of software delay. In a cell where a robot holds the part in front of the camera, the robot controller requests capture with a Modbus signal.
Fix the Conditions with a Recipe
If conditions differ between collecting training data and inspecting in the field, the model receives images it has never seen. So save camera exposure and gain, lighting channels and brightness, and lens settings as a recipe. A recipe made in fineAi Viewer can be converted and brought into Multi-Inspector, so the collection stage and the inspection stage run under the same conditions.
Preprocessing Before the Model
You can use captured images as they are, but a few processing steps make training more stable. These preprocessing options can be chosen in the Multi-Inspector inspection mode settings (modeN_type).
- histogram-eq / clahe — Spread the brightness distribution to reveal defects in dark areas. CLAHE splits the image into small regions and adjusts contrast in each, so it suits an image that is dark on one side only.
- live_canny — Build a contour mask of the part with Canny edges, keep only the part and move it to the image center. Conveyor patterns or jigs in the background do not enter the decision.
- rotation-fix — Rotate the part to a common orientation. The next lesson, Alignment, explains it in detail.
Field Checklist
- Is the smallest defect captured at 3 to 5 pixels or more?
- When you capture the same part 10 times, are brightness and position constant?
- When you place a defective sample next to a good one, is the difference clear to the human eye?
- Did you save the recipe, and do collection and inspection use the same one?
If you can answer "yes" to the last question with confidence, you can move on to choosing a model.