Click or drag to resize

IReconstructionUseCurrentHoloAsRef Method

Define how to use the reference hologram. Call CopyHoloToRH(Int32) or SetHoloRHListSize(Int32) and Array.Copy before. (See example code below)

Namespace:  LynceeTec.Interfaces
Assembly:  LynceeTec.Interfaces (in LynceeTec.Interfaces.dll) Version: 9.0.26418.0 , built 2021-10-22 08:45:14 UTC
Syntax
void UseCurrentHoloAsRef(
	bool autoFilt,
	int autoFiltRadius,
	bool amplDiv,
	int nAvg
)

Parameters

autoFilt
Type: SystemBoolean
If set to false, will use Fourier filtering on the reference hologram in a circle centered on the central frequency of radius autoFiltRadius. If set to true, the reference hologram will be filtered with the current Fourier filtering.
autoFiltRadius
Type: SystemInt32
Radius of the circular Fourier filter centered around the central frequency, in [pix]. autoFilt must be set to true.
amplDiv
Type: SystemBoolean
If set to true, enables the normalization for each pixel of the reconstructed intensity images with the intensity of each corresponding pixel of the reference hologram
nAvg
Type: SystemInt32
Number of holograms which are averaged to produce the reference hologram. Must be equal or greater to one.
Examples
This example shows how to set a single hologram as reference hologram (no averaging)
//Resize the reference holograms list
reconstruction.SetHoloRHListSize(1);

//Copy the current hologram to the reference hologram memory
reconstruction.CopyHoloToRH(0);

//Configure how the reference hologram will be used
reconstruction.UseCurrentHoloAsRef(useAutoFilterForRefHolo, autoFilterRadiusForRefHolo, useAmplitudeDivisionForRefHolo, numberOfAveragedImagesForRefHolo);
Examples
This example shows how to use the average of several holograms to produce the reference hologram
//Resize the reference holograms list
reconstruction.SetHoloRHListSize(numberOfAveragedImagesForRefHolo);

int holoBufferSize = dhmDevice.Camera.Stride * dhmDevice.Camera.Height;
for (int i = 0; i<numberOfAveragedImagesForRefHolo; i++) 
{
    //Copies the holograms to the correct memory space
    //In this simplified example, the same hologram is used several time. Of course in a real life usage, a different hologram is acquired for each image!
    Array.Copy(hologramToUseAsRef.Data, 0, reconstruction.GetAvgRHBufHolo(i), 0, holoBufferSize);
}

//Special case for non-simultaneous sources, each source grabs an hologram independently, the holograms are saved one after the other in memory
if (dhmDevice.CurrentConfiguration.NumLambda == 2 && !dhmDevice.CurrentConfiguration.SimultSources) 
{
    for (int i = 0; i<numberOfAveragedImagesForRefHolo; i++)
    {
        Array.Copy(hologramToUseAsRef.Data, 0, reconstruction.GetAvgRHBufHolo(i), holoBufferSize, holoBufferSize);
    }
}

//Configure how the reference hologram will be used
reconstruction.UseCurrentHoloAsRef(useAutoFilterForRefHolo, autoFilterRadiusForRefHolo, useAmplitudeDivisionForRefHolo, numberOfAveragedImagesForRefHolo);
See Also