Cameras & sensorsTroubleshooting

Black spot in camera image: isolate a persistent defect

Diagnose a black spot in camera image data with uniform-target tests, aperture checks and source-frame comparisons, then choose cleaning or service.

LumaSpec Vision10 min read Share on LinkedIn

On this page 9 sections
  1. 01Start with the least invasive explanation
  2. 02Build a repeatable uniform-target test
  3. 03Measure persistence without overinterpreting it
  4. 04Compare source data with the processed image
  5. 05Use aperture changes as supporting evidence
  6. 06Clean only documented accessible surfaces
  7. 07Separate a service decision from a replacement decision
  8. 08Verify the repair and prevent a repeat
  9. 09Questions

A persistent dark patch can spoil inspection even when the rest of the image looks normal. The challenge is separating a shadow in the optical path from defective pixels or a processing artifact, without making the camera harder to service. This procedure is for technicians diagnosing a localized defect on an otherwise usable image. You will build a repeatable test, compare acquisition paths, and decide whether approved external cleaning, a configuration correction, or documented service is the appropriate next step.

Start with the least invasive explanation

A spot that stays in the same image location points toward the camera or its processing chain, but it does not prove sensor damage. Contamination close to the sensor, pixel correction, shading correction, and display overlays can all produce stationary features.

If almost the entire frame is dark, follow the black-image exposure and lighting checks instead. A small persistent patch requires a different test sequence.

Use this table to choose your first checks. The order favors reversible tests, not assumed failure rates.

Possible cause Typical clue First useful test
Target mark or illumination shadow Feature follows the target or lighting geometry Move the target and change illumination direction
Display or host-processing artifact Feature appears in only one viewer or processed output Compare a saved source frame with another viewer
Optical contamination near the sensor Soft patch, sometimes more distinct at smaller apertures Compare uniform-target images at different aperture settings
External lens contamination or damage Haze, flare, contrast loss, or an irregular artifact Inspect and clean only accessible surfaces using the documented method
Pixel defect or sensor-region fault Isolated pixels, a small cluster, or a fixed region Inspect source pixels across several exposure levels

Do not use shape alone as a diagnosis. Resizing, demosaicing, sharpening, and compression can turn a tiny defect into a larger-looking patch.

Build a repeatable uniform-target test

  1. Save the current configuration before changing anything. Record exposure, gain, image dimensions, pixel format, region of interest, and active processing.
  2. Fill the field with a clean, matte, evenly illuminated target. Avoid a visible pattern, reflections, and direct views of intense light sources.
  3. Set manual exposure and gain where supported. Choose a midrange signal with no clipped bright regions.
  4. Save 10 consecutive frames in a lossless format. Keep the original acquisition data where your software allows it.
  5. Move or rotate the target while leaving the camera fixed. Capture another set under the same settings.
  6. Change the illumination direction without introducing a new shadow, then repeat the capture.

A feature that moves with the target is not fixed to the imaging system. A feature that changes position with the illumination may be a real shadow. A patch that remains at the same image coordinates deserves further optical and processing checks.

Record the patch center, approximate width, and appearance at native resolution. Inspect at an integer zoom without smoothing; an enlarged screenshot is not a reliable measurement of its pixel footprint.

If automatic settings cannot be disabled, log their values for every capture. Otherwise, changing brightness can conceal whether a test actually changed the defect.

Measure persistence without overinterpreting it

Compare the dark region with a nearby clean region receiving similar illumination. Use the same regions in every frame, avoiding target edges and strong brightness gradients.

For a simple relative-darkness estimate, subtract the local black level where it is known and applicable:

Relative darkness = (reference mean − spot mean) / reference mean × 100%

Suppose an illustrative monochrome image has a reference mean of 160 digital counts and a spot mean of 120 counts. The estimate is:

Relative darkness = (160 − 120) / 160 × 100% = 25%

This describes the symptom, not its cause. Gamma, tone mapping, clipping, and unknown black-level processing make it unsuitable as an optical-transmission measurement. For color images, compare the same channel rather than mixing channel responses.

Repeat at two exposure settings that avoid clipping. A shadow from contamination can remain approximately proportional to local brightness. A defective pixel can behave differently, but correction and nonlinear processing may obscure that distinction. Use the result alongside the other tests, never as a standalone verdict.

Fixed coordinates also need a defined coordinate system. Cropping shifts the image origin; binning, resizing, mirroring, and rotation change the mapping. Compare full-resolution source coordinates where possible, and record every transformation before deciding that a spot has moved.

Compare source data with the processed image

A defect visible only after processing should be investigated there before replacing hardware. Compare the same captured frame through the simplest available path and through the production pipeline.

Check these stages individually:

  • Acquisition buffer before host processing.
  • Conversion from packed or encoded data into image pixels.
  • Demosaicing or color conversion, where applicable.
  • Flat-field, shading, or defect-pixel correction.
  • Undistortion, registration, resizing, and filtering.
  • Display overlays and exported screenshots.

Do not assume that an output called raw bypasses every camera-side correction. Feature availability and processing order depend on the camera. Consult its documented controls, and change only supported settings.

Our guide to decoding image bytes before processing explains why a file buffer and a pixel array are not interchangeable. For acquisition-format problems, use the pixel-format setting checks.

If the spot appears only after shading correction, temporarily disable that correction through its documented control. A correction map captured with contamination or under the wrong geometry can introduce local brightness errors. Do not regenerate calibration data until the optical path and illumination are verified.

If the feature becomes larger only after resizing or warping, compare the source pixels first. The resampling and antialiasing guide helps separate the original defect from its processed footprint.

Use aperture changes as supporting evidence

If your lens has an adjustable iris, compare a wide aperture with a smaller aperture while preserving similar image brightness. Keep camera position, target, focus setting, gain, and processing unchanged. Compensate with exposure on a stationary target where possible.

For example, changing from f/4 to f/8 reduces ideal image irradiance to approximately one quarter. An exposure of 2 ms would therefore become approximately 8 ms for comparable brightness, ignoring transmission differences and other limitations.

Exposure ratio ≈ (new f-number / original f-number)² Exposure ratio ≈ (8 / 4)² = 4

Particles close to the sensor can cast more sharply defined shadows when the aperture becomes smaller. A repeatable increase in patch definition therefore supports an optical-contamination explanation. It does not identify which internal surface carries the particle.

A fixed-aperture lens cannot perform this test. Mark it as unavailable rather than improvising an obstruction or disturbing the assembly.

External lens dirt is often far from the image plane and strongly defocused. It may reduce contrast or cause flare rather than create a sharply bounded dark spot. Cleaning the front surface without improvement does not establish that the sensor is damaged. For a separate controlled assessment of optical marks, follow the lens-scratch image tests.

Clean only documented accessible surfaces

Inspect accessible external optical surfaces before cleaning. Use the camera or lens documentation to identify approved materials, fluids, and methods. A general-purpose cloth may carry abrasive debris, and an unsuitable solvent can damage coatings or bonded components.

Do not scrub repeatedly because the image has not improved. Stop after an approved cleaning attempt if the mark remains unchanged. Keep the before-and-after captures as evidence.

Avoid probing a cover window, scraping a suspected particle, applying household cleaning products, or directing an uncontrolled air jet into the assembly. A visible protective window is not permission to clean the sensor stack underneath it.

For board-level cameras, distinguish normal integration access from documented service access. A compact or open assembly does not make every optical surface user-serviceable. Mechanical disturbance can also alter focus or alignment; the focal-length and back-focus explanation describes why those adjustments are different.

An approved lens substitution can help when a qualified technician follows the documented exchange procedure. Use a known-good compatible lens, preserve the acquisition settings, and repeat the uniform-target test. Do not interpret disappearance of the spot after a completely different field of view or processing setup as a conclusive result.

Separate a service decision from a replacement decision

Seek documented service when the defect persists in the source image, remains fixed through controlled tests, and cannot be attributed to an accessible surface. Send the source files, configuration record, patch coordinates, and test sequence through technical support. Ask which further tests are approved before opening anything.

A service report should distinguish suspected contamination, pixel defects, and processing behavior. Avoid declaring a manufacturing cause or permanent sensor damage from appearance alone.

If replacement is necessary, select against the inspection requirement rather than the appearance of the old camera. Use the area scan camera category and camera finder to check interface, shutter behavior, resolution, mounting, and required acquisition controls.

The LS-CMR-0053 is a GigE area scan camera. Treat it as a selection candidate, not a guaranteed remedy for an unidentified artifact.

Area scan cameras12 MP GigE area scan camera, IMX226, 1/1.7" rolling shutter, 9 fps (LS-CMR-0053)LS-CMR-0053
Sensor format
1/1.7"
Lens mount
C-mount
Interface
GigE
Resolution
12 MP
$560.00View partBuild a system with it

The LS-CMR-0166 uses USB3. Confirm the host connection and application requirements before choosing it.

Area scan cameras12 MP USB3 area scan camera, IMX226, 1/1.7" rolling shutter, 30 fps, 4000 × 3000 resolution (LS-CMR-0166)LS-CMR-0166
Sensor format
1/1.7"
Interface
USB3
Resolution
12 MP
Shutter
Rolling
$560.00View partBuild a system with it

Neither interface determines whether a localized spot is optical or electronic. Verify any required raw-output, correction-control, or diagnostic capability in the applicable documentation rather than assuming it from a product category.

When a lens change is justified, compare machine vision lenses through the lens finder. Check mount compatibility, sensor coverage, working distance, and inspection coverage before ordering.

Verify the repair and prevent a repeat

Repeat the original uniform-target test after cleaning, configuration correction, service, or replacement. Use the same settings and processing path so the comparison answers the original question.

Then inspect representative production samples. A clean uniform image alone does not prove that the inspection still finds its smallest required defect. Likewise, a software mask may hide a nuisance patch while also concealing a genuine defect at that location.

Before returning the station to use, confirm:

  • The patch is absent or meets a documented acceptance limit at native resolution.
  • The finding holds across the exposure and aperture settings actually used.
  • Production processing does not reintroduce the artifact.
  • Focus, field of view, and measurement calibration remain valid after optical changes.
  • Known acceptable and defective samples still produce the expected decisions.
  • Configuration files and diagnostic captures are retained with the maintenance record.

Do not replace hardware when the artifact exists only in an overlay or correction map. Do not keep cleaning when evidence points inside a non-serviceable assembly. If the cause remains uncertain, send the comparison captures through the contact page before disturbing the optical stack. For a confirmed replacement, start with the camera configuration step.

Questions

Does a black spot at fixed coordinates mean the sensor is damaged?

No. A stationary feature can originate from contamination near the sensor, a pixel defect, a correction map, or an overlay. Confirm its position in source-image coordinates, move the target, and compare acquisition data with processed output before deciding that hardware is damaged.

Can I clean the sensor myself if lens cleaning does not help?

Only clean surfaces identified as user-accessible by the camera documentation, using its approved procedure. Removing the lens does not establish that the remaining window or sensor stack is safe to touch. For internal contamination, request documented service rather than experimenting with cleaning materials.

Why can stopping down the lens make a dark spot clearer?

A smaller aperture can make the shadow from a particle near the sensor more defined. Compare captures at similar brightness, compensating with exposure on a stationary target where possible. This supports an optical explanation but does not locate the particle or rule out other causes.

Can defect-pixel correction or a software mask solve the problem?

Possibly, but those functions are not interchangeable with repair. A documented pixel-correction feature may address isolated defective pixels, while a larger contamination shadow needs separate assessment. Any correction must be validated against real inspection defects, especially where masking could conceal a reject condition.

What evidence should I send when requesting camera service?

Provide lossless source frames, a processed example, image coordinates, exposure and gain settings, pixel format, and the active correction settings. Include uniform-target captures before and after approved cleaning. Describe which tests changed the spot and which left it unchanged.