OptrisOptrisDocumentation

Documentation/OTC SDK/Optris.Sdk — C# API referencev12.0

PictureCorrection

public readonly record struct PictureCorrection : IEquatable<PictureCorrection>

What the two optical corrections are actually doing right now.

ThermalCamera.DistortionCorrection and ThermalCamera.SizeOfSourceCorrection say what was asked for. Neither says what is happening, and for these two the difference is not a detail: both depend on calibration data a given camera and its optics may simply not carry.

Asking for a correction the camera cannot do is not an error. Both default to on, so refusing the default configuration would make every such camera fail to open. That is why this query exists: a named reason per correction, rather than a silent no-op or a generic I/O failure.

A snapshot, not a handle. Read it again after changing either correction and after an operation mode change; both rebuild the tables these describe.

PictureCorrection: properties

public DistortionCorrectionStatus Distortion { get; init; }

Whether distortion correction is reshaping the picture.

public bool IsDistortionActive { get; }

Whether distortion correction is actually reshaping the picture.

A property rather than a comparison you write yourself, because the tempting shorthand is Distortion != DistortionCorrectionStatus.Off, and that counts DistortionCorrectionStatus.NoCoefficients -- a camera that was asked and cannot -- as corrected.

public bool IsSizeOfSourceActive { get; }

Whether size-of-source correction is actually changing pixels.

The same caution as PictureCorrection.IsDistortionActive, and it bites harder here: the majority state on a camera that has a table is SizeOfSourceStatus.ZeroStrength, which is an exact identity.

public bool IsValid { get; init; }

Whether this record was populated at all. false when the source has no processing adapter to read the correction through -- a simulated camera, a recording being replayed -- in which case both statuses are Unknown and the strength is meaningless.

public SizeOfSourceStatus SizeOfSource { get; init; }

Whether size-of-source correction is subtracting the halo.

public float SizeOfSourceStrength { get; init; }

The size-of-source strength in force, 0 to 0.95. Clamped to that range on the way in, so this is what the pipeline is using and not necessarily what was assigned to ThermalCamera.SizeOfSourceStrength.

PictureCorrection: methods

public static string Explain(DistortionCorrectionStatus status)

What a distortion-correction status means, as a sentence to show or log.

  • status: The status to explain.

Returns: The SDK's own sentence, the same one C++, C, Python and Rust callers get. It names the recovery where there is one, and says plainly when there is nothing to do: DistortionCorrectionStatus.NoCoefficients is not a fault. A value this SDK does not know gives "unknown" rather than throwing.

The enum is for a program to branch on; this is for a person.

Example

PictureCorrection now = camera.GetPictureCorrection();
Console.WriteLine(PictureCorrection.Explain(now.Distortion));
public static string Explain(SizeOfSourceStatus status)

What a size-of-source status means, as a sentence to show or log.

  • status: The status to explain.

Returns: The SDK's own sentence, the same one C++, C, Python and Rust callers get. A value this SDK does not know gives "unknown" rather than throwing.

The one of the pair that earns its keep: SizeOfSourceStatus.ZeroStrength is the default on every camera that has a table, and the bare value does not tell a reader that the correction is switched on, has its table, and still changes nothing. The sentence says so, and names what to set to make it do something.

Example

PictureCorrection now = camera.GetPictureCorrection();
Console.WriteLine(PictureCorrection.Explain(now.SizeOfSource));