System designTroubleshooting

Saving polarization images that match the preview

Fix saving polarization images by separating raw mosaics, polarization measurements and display colors, then verify exports with repeatable tests.

LumaSpec Vision9 min read Share on LinkedIn

On this page 9 sections
  1. 01Identify which image you actually saved
  2. 02Test the most likely cause: raw data versus rendering
  3. 03Verify the measurement calculation and conventions
  4. 04Check display mapping before changing acquisition settings
  5. 05Rule out bit-depth, encoding and layout errors
  6. 06Save a reproducible export package
  7. 07Verify the fix with paired-frame tests
  8. 08Check export requirements before ordering hardware
  9. 09Questions

A polarization preview can look correct while its saved image appears gray, patterned or differently colored. Usually, the preview and the file represent different stages of processing, rather than a failed camera. This troubleshooting procedure helps you identify those stages, choose the right export and reproduce the display without discarding measurement data. Start with one captured frame so that motion, exposure changes and automatic display scaling cannot confuse the comparison.

Identify which image you actually saved

A polarization acquisition can produce several valid images from the same exposure. They are related, but they are not interchangeable.

Representation What the values mean Typical mismatch First check
Raw sensor mosaic Samples taken through individual polarizer orientations Fine pattern or unexpected grayscale appearance Confirm the source pixel format and mosaic layout
Separated orientation images Intensity samples grouped by polarizer orientation Smaller image or different contrast Check orientation labels, dimensions and reconstruction method
Derived measurement Linear polarization degree, angle or Stokes components Dark, clipped or unfamiliar grayscale image Read numerical values and their units
Display rendering Measurement values mapped into visible brightness or color Colors differ between applications Compare lookup tables, limits and masks
Composite preview Several images arranged into a panel Export contains only one panel Check which output the save operation selects

The first question is not which file extension you chose. It is which buffer the save operation received.

Open the file with a reader that reports dimensions, channel count and sample type. Compare those properties with the acquisition buffer and the selected preview mode. The distinction explained in image bytes versus decoded pixel data also matters here: an encoded file must be decoded before its pixels can be interpreted.

Test the most likely cause: raw data versus rendering

The most likely explanation is that the viewer renders a polarization measurement while the save command writes the source frame. Neither operation is necessarily wrong.

Use this isolation sequence:

  1. Capture one stationary scene and retain that frame in memory.
  2. Record the preview selection, including the measurement name and display limits.
  3. Save the acquisition buffer without additional processing.
  4. Export the selected measurement separately, if supported.
  5. Export the rendered preview through the application's documented function.
  6. Reopen all outputs and compare their metadata before comparing their appearance.

Use the camera manufacturer's documented software or API to select these outputs. A save button may export the current display, a measurement plane or the original acquisition buffer. Its label alone does not establish which behavior applies.

For a common four-orientation mosaic, a 2 × 2 sensor neighborhood contains different analyzer orientations. A simple separation of an illustrative 2048 × 1536 mosaic produces four 1024 × 768 sample planes. An interpolated output may instead retain the original dimensions, but that does not create independent measurements at every original pixel location.

Do not infer the orientation order from the appearance of the mosaic. Confirm it from the camera's documentation and the delivered image format. Cropping, rotation and image reversal can change how the pattern must be interpreted.

Verify the measurement calculation and conventions

If raw and rendered exports are correctly identified but the derived image still differs, check the polarization calculation. Apply the same calibration, orientation assignment and spatial reconstruction used by the preview.

For ideal linear analyzers at nominal orientations of 0°, 45°, 90° and 135°, one common convention is:

S0 = (I0 + I45 + I90 + I135) / 2 S1 = I0 - I90 S2 = I45 - I135 DoLP = sqrt(S1^2 + S2^2) / S0 AoLP = 0.5 × atan2(S2, S1)

Here, the intensity samples must represent the same scene location after the required reconstruction. DoLP is the degree of linear polarization, not the total degree of polarization. AoLP is the angle of linear polarization, with equivalent orientations separated by 180°.

These equations assume matched, linear intensity responses and a defined angle reference. Real processing can require dark-offset correction, channel calibration and other documented corrections. Do not apply those corrections twice when starting from an already processed output.

As a worked example, suppose corrected intensity samples are 800, 500, 200 and 500 for the respective orientations:

S0 = (800 + 500 + 200 + 500) / 2 = 1000 S1 = 800 - 200 = 600 S2 = 500 - 500 = 0 DoLP = sqrt(600^2 + 0^2) / 1000 = 0.60 AoLP = 0.5 × atan2(0, 600) = 0°

A saved DoLP value of 0.60 can be numerically correct even when it looks almost black in an unsuitable viewer. The display needs an explicit mapping from the measurement range to visible brightness or color.

Check whether angles use degrees or radians, where zero lies, and which direction increases the angle. Near zero linear polarization, AoLP becomes highly sensitive to noise. Low intensity and saturation also make derived measurements unreliable. Preserve a validity mask rather than assigning confident colors to every pixel.

Check display mapping before changing acquisition settings

When the measurement values agree but the colors differ, test the presentation settings next. A pseudocolor preview is a rendering of data, not the data itself.

Record these settings:

  • Selected measurement and component.
  • Fixed or automatically calculated display limits.
  • Lookup table and its direction.
  • Angle interval and wrap convention.
  • Gamma or other display transfer function.
  • Invalid-pixel color and confidence threshold.
  • Any overlay, legend or composite arrangement.

For an illustrative DoLP display using fixed limits from 0 to 1, a linear grayscale mapping is:

Display code = round(255 × clamp(DoLP, 0, 1)) For DoLP = 0.60: round(255 × 0.60) = 153

That display code is not the original measurement value. If each frame instead stretches its own minimum and maximum across the display range, identical DoLP values can receive different colors in different frames.

AoLP needs a cyclic interpretation because 0° and 180° describe the same linear orientation. A cyclic color mapping avoids treating that boundary as a large physical discontinuity. Save its range and reference direction with the export.

The same separation between numerical values and presentation colors appears in thermal image color-to-value mapping. In both cases, matching the picture requires reproducing the mapping, not merely saving an array.

Rule out bit-depth, encoding and layout errors

If neither the measurement nor its appearance matches, inspect the storage path. Start with sample type and scaling, then examine channel layout and encoding.

A hypothetical 12-bit acquisition contains codes from 0 to 4095. Those codes can be preserved unchanged inside an unsigned 16-bit container. A viewer that assumes a full range from 0 to 65535 may display them much darker than the acquisition preview.

Do not multiply or shift values just to improve appearance unless that transformation belongs to a separate display output. The guide to preserving 12-bit camera intensity data explains this storage distinction in more detail.

Derived measurements need their own representation. DoLP may be stored as floating-point fractions or documented scaled integers. AoLP needs an explicit angular unit. Some Stokes components can be negative, so an unsigned container without a defined encoding can discard their meaning.

Check for these additional errors:

  • Packed acquisition bytes interpreted directly as unpacked samples.
  • Row padding treated as image pixels.
  • Incorrect channel count or element type.
  • Reversed color-channel order in a rendered export.
  • A measurement plane saved from the wrong frame.
  • Polarization processing applied again to an already derived image.

The checks in matching array type to pixel format help isolate layout errors before debugging polarization mathematics.

Use lossless storage for source data and quantitative measurements. A lossless file only preserves the values passed to its encoder; it cannot reverse an earlier conversion to lower precision. A rendered color image is useful for reporting, but it is not a substitute for the measurement array.

Save a reproducible export package

For inspection development, preserve separate source, measurement and presentation outputs. This allows later processing changes without sacrificing the original acquisition.

Output Recommended content Why retain it
Source frame Unmodified samples and acquisition metadata Supports recalculation and diagnosis
Measurement output Named numerical planes, units and validity masks Supports analysis without interpreting display colors
Preview export Rendered image with recorded display settings Supports visual review and report matching
Processing record Calibration identity, software version and transformation settings Makes the processing path reproducible

Associate every output with the same frame identifier. Include dimensions, sample type, pixel format, exposure, gain and relevant image transformations. Record the calibration version, reconstruction method, angle convention, scaling and mask rules.

If the application cannot export a rendered preview directly, use the manufacturer's documented API to apply the intended rendering to the measurement output. A screenshot may document the appearance, but window resizing, overlays and display scaling make it unsuitable as a quantitative archive.

Keep display normalization separate from measurement generation. Changing the color range should not silently overwrite the underlying DoLP or AoLP values.

Verify the fix with paired-frame tests

Validate the repaired pipeline in stages. Comparing two attractive pictures is weaker evidence than comparing the intermediate arrays.

  1. Verify source preservation. For a lossless export without conversion, compare decoded sample values against the retained acquisition buffer. Account for documented row padding and layout changes.
  2. Verify measurement agreement. Compare the same valid pixels using identical calibration and processing settings. Set floating-point tolerances according to the implementation and application requirements.
  3. Verify rendering agreement. Apply the same limits, lookup table, masks and channel order to both measurement arrays. Compare exported pixel codes, not just their appearance on a monitor.
  4. Repeat under controlled scene changes. Check a stationary target, a changing polarization response and a low-signal region. Confirm that automatic scaling is not hiding differences.

For angles, compare the smallest difference modulo 180°. An angle of 179° and an angle of 1° differ by 2° in linear orientation, not 178°.

Check export requirements before ordering hardware

A preview mismatch alone is not evidence that you need another camera. Confirm the export selection, numerical representation and rendering path first.

If hardware selection is necessary, area scan cameras and the camera finder provide a starting point. A general interface or resolution listing does not establish a polarization sensor, its mosaic arrangement or access to derived measurements. Verify those requirements in the specific product documentation before selection.

CamerasArea scan cameras

GigE, USB3, 10GigE and CoaXPress

1,287 models · from $149.00

Use this final checklist:

  • Identify whether each output is source data, a measurement or a rendering.
  • Confirm pixel format, dimensions, channel layout and sample type.
  • Preserve signed components, units, scaling and validity masks.
  • Match calibration, orientation conventions and reconstruction settings.
  • Record display limits, lookup tables and invalid-pixel handling.
  • Verify one retained frame before comparing continuous capture.
  • Check documented access to every required export before ordering.

For a new acquisition setup, start with the camera configurator. If the required polarization outputs or file representations remain unclear, contact applications support with the documented pixel format, an example export and the intended measurement.

Build the whole station

The configurator matches a camera, lens, light, light controller and cables to each other, step by step, and lists only parts that fit what you already picked.

Start with the camera

Questions

Why does my saved polarization image look different from the preview?

The application may display a derived polarization measurement while saving the original sensor samples. It may also apply automatic scaling or a color lookup table only to the preview. Check the selected export buffer, sample type and rendering settings before changing exposure or replacing hardware.

Should I save the raw polarization frame or the colored preview?

Keep both when reproducibility matters. The raw frame supports recalculation with documented calibration and processing settings. Numerical measurement outputs support analysis, while a rendered preview supports visual review. Connect these files with a shared frame identifier and a record of the processing settings.

Can I recover accurate polarization measurements from a colored image?

Not reliably from appearance alone. A rendered image can include quantization, clipping, masks and display transformations that discard numerical information. Save the measurement planes separately with their units and scaling. Use the colored export for presentation rather than as the primary measurement record.

Why does an angle image have a sharp color boundary?

Linear polarization orientation repeats every 180 degrees, so values near opposite ends of an angle interval can represent similar directions. Compare angles modulo that period and use a cyclic display mapping. Also mask low-confidence regions, where weak polarization makes the angle unstable.

Which file format guarantees that polarization exports remain correct?

No single extension guarantees reproducibility. The export must preserve the required sample type, signed values where applicable, dimensions and measurement units. It also needs calibration and display metadata. Confirm that both the writer and reader support the chosen representation without silently reducing precision.