メインコンテンツ

refreshImage

R2026b

Apply postprocess gain to rendered test chart

Since R2026b

Description

Add-On Required: This feature requires the Optical Design and Simulation Library for Image Processing Toolbox add-on.

refreshImage(chart) applies an automatically computed gain to the rendered chart as a postprocessing step. The function does not re-render the entire chart.

refreshImage(chart,Gain=g) recomputes the Image property of the chart using the specified gain value g.

example

Examples

collapse all

Import a double Gauss lens from a ZMX file into the workspace.

opsys = zmximport("DoubleGaussLens.zmx");

Add an image sensor to the optical system.

addImageSensor(opsys);

Render a ColorChecker test chart through the focused optical system.

ccAperture1 = renderChart(opsys,MaxSampleVariance=1,Focus=true);

Modify the aperture size of the ninth surface.

opsys.Surfaces(9).Shape.SemiDiameter = opsys.Surfaces(9).Shape.SemiDiameter/2;

Re-render the test chart to compute a new gain based on the updated system.

ccAperture2 = renderChart(opsys,MaxSampleVariance=1,Focus=true);

Reuse the original gain using the refreshImage function. Otherwise, the second render uses a higher gain and produces images with similar brightness.

refreshImage(ccAperture2,Gain=ccAperture1.Gain);

Compare the image brightness after aperture change using consistent gain.

montage({ccAperture1.Image,ccAperture2.Image})

Figure contains an axes object. The hidden axes object contains an object of type image.

Input Arguments

collapse all

Simulated test chart, specified as a SimulatedESFRChart object or a SimulatedColorCheckerChart object.

The refreshImage function recomputes the Image property of the chart object using the optical throughput value set by the OpticalThroughput property, and updates the Gain property.

Multiplicative gain factor applied to the image for exposure adjustment, specified as a positive scalar. By default, the refreshImage function automatically uses the maximum value for gain that prevents clipping in the sRGB space.

Specify this argument to ensure consistent exposure when comparing rendered images across system configurations.

Data Types: double

Version History

Introduced in R2026b