![]() | SingleWavelengthReconstructionUseCurrentHoloAsRef Method |
Namespace: LynceeTec.Processing.Holography
public virtual void UseCurrentHoloAsRef( bool autoFilt, int autoFiltRadius, bool amplDiv, int nAvg )
//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);
//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);