Skip to content

sfs_mod_lrSfsModLrSfsModLrsfs_mod_lrsfs_mod_lr🔗

Short description🔗

sfs_mod_lrSfsModLrSfsModLrsfs_mod_lrsfs_mod_lr — Reconstruct a surface from a gray value image.

Signature🔗

sfs_mod_lr( image Image, out image Height, angle.deg Slant, angle.deg Tilt, number Albedo, number Ambient )void SfsModLr( const HObject& Image, HObject* Height, const HTuple& Slant, const HTuple& Tilt, const HTuple& Albedo, const HTuple& Ambient )static void HOperatorSet.SfsModLr( HObject image, out HObject height, HTuple slant, HTuple tilt, HTuple albedo, HTuple ambient )def sfs_mod_lr( image: HObject, slant: Union[float, int], tilt: Union[float, int], albedo: Union[float, int], ambient: Union[float, int] ) -> HObject

Herror sfs_mod_lr( const Hobject Image, Hobject* Height, double Slant, double Tilt, double Albedo, double Ambient )

Herror T_sfs_mod_lr( const Hobject Image, Hobject* Height, const Htuple Slant, const Htuple Tilt, const Htuple Albedo, const Htuple Ambient )

HImage HImage::SfsModLr( const HTuple& Slant, const HTuple& Tilt, const HTuple& Albedo, const HTuple& Ambient ) const

HImage HImage::SfsModLr( double Slant, double Tilt, double Albedo, double Ambient ) const

HImage HImage.SfsModLr( HTuple slant, HTuple tilt, HTuple albedo, HTuple ambient )

HImage HImage.SfsModLr( double slant, double tilt, double albedo, double ambient )

Description🔗

sfs_mod_lrSfsModLr reconstructs a surface (i.e. the relative height of each image point) using the modified algorithm of Lee and Rosenfeld. The surface is reconstructed from the input image Imageimageimage, and the light source given by the parameters Slantslantslant, Tilttilttilt, Albedoalbedoalbedo and Ambientambientambient, and is assumed to lie infinitely far away in the direction given by Slantslantslant and Tilttilttilt. The parameter Albedoalbedoalbedo determines the albedo of the surface, i.e. the percentage of light reflected in all directions. Ambientambientambient determines the amount of ambient light falling onto the surface. It can be set to values greater than zero if, for example, the white balance of the camera was badly adjusted at the moment the image was taken.

Attention🔗

sfs_mod_lrSfsModLr assumes that the heights are to be extracted on a lattice with step width 1. If this is not the case, the calculated heights must be multiplied with the step width after the call to sfs_mod_lrSfsModLr. A Cartesian coordinate system with the origin in the lower left corner of the image is used internally. sfs_mod_lrSfsModLr can only handle byte-images.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on tuple level.

Parameters🔗

Imageimageimage (input_object) singlechannelimage(-array) → object (byte)HObject (byte)HImage (byte)HObject (byte)Hobject (byte)

Shaded input image.

Heightheightheight (output_object) image(-array) → object (real)HObject (real)HImage (real)HObject (real)Hobject * (real)

Reconstructed height field.

Slantslantslant (input_control) angle.deg → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[float, int]Htuple (double / Hlong)

Angle between the light source and the positive z-axis (in degrees).

Default: 45.045.0
Suggested values: 1.0, 5.0, 10.0, 20.0, 40.0, 60.0, 90.01.0, 5.0, 10.0, 20.0, 40.0, 60.0, 90.0
Value range: 0.0 ≤ Slant ≤ 180.0 (lin)
Minimum increment: 0.01
Recommended increment: 10.0

Tilttilttilt (input_control) angle.deg → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[float, int]Htuple (double / Hlong)

Angle between the light source and the x-axis after projection into the xy-plane (in degrees).

Default: 45.045.0
Suggested values: 1.0, 5.0, 10.0, 20.0, 40.0, 60.0, 90.01.0, 5.0, 10.0, 20.0, 40.0, 60.0, 90.0
Value range: 0.0 ≤ Tilt ≤ 360.0 (lin)
Minimum increment: 0.01
Recommended increment: 10.0

Albedoalbedoalbedo (input_control) number → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[float, int]Htuple (double / Hlong)

Amount of light reflected by the surface.

Default: 1.01.0
Suggested values: 0.1, 0.5, 1.0, 5.00.1, 0.5, 1.0, 5.0
Value range: 0.0 ≤ Albedo ≤ 5.0 (lin)
Minimum increment: 0.01
Recommended increment: 0.1
Restriction: Albedo >= 0.0

Ambientambientambient (input_control) number → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[float, int]Htuple (double / Hlong)

Amount of ambient light.

Default: 0.00.0
Suggested values: 0.1, 0.5, 1.00.1, 0.5, 1.0
Value range: 0.0 ≤ Ambient ≤ 1.0 (lin)
Minimum increment: 0.01
Recommended increment: 0.1
Restriction: Ambient >= 0.0

Result🔗

If all parameters are correct sfs_mod_lrSfsModLr returns the value 2 (H_MSG_TRUE). Otherwise, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

estimate_al_amEstimateAlAm, estimate_sl_al_lrEstimateSlAlLr, estimate_sl_al_zcEstimateSlAlZc, estimate_tilt_lrEstimateTiltLr, estimate_tilt_zcEstimateTiltZc, optimize_fft_speedOptimizeFftSpeed

Possible successors

shade_height_fieldShadeHeightField

Module🔗

3D Metrology