public void Process() { if (Input == null) { return; } CreateOrUpdateOutputWithSameParametres(Input, _title, ImagePixelFormat.Float, ImageFormat.RealImaginative); if (Input != null && Output != null && Input.Ready && Output.Ready) { using (new Timer("Freshnel")) { using (StartOperationScope(Input, Output)) { try { Freshnel.Transform(Input, Output, Wavelength, Distance, ObjectSize, true); } catch (Exception ex) { DebugLogger.Log(ex, DebugLogger.ImportanceLevel.Exception); } } } } }
public void Compute() { if (Input == null) { return; } CreateOrUpdateOutputWithSameParametres(Input, _title); CreateOrUpdateImageWithSameParametres(Input, _title, ref _temp); CreateOrUpdateImageWithSameParametres(Input, _title, ref _inputFreshnelTransform); using (StartOperationScope(Input, Output, _temp, _inputFreshnelTransform)) { int dx = 0, dy = 0; Freshnel.Transform(Input, _inputFreshnelTransform, Wavelength, Distance, ObjectSize, true); for (dx = 0; dx <= 2; dx++) { for (dy = 0; dy <= 2; dy++) { if (dx == 0 && dy == 0) { continue; } ImageProcessing.Shift(Input, _temp, dx * (int)Shift, dy * (int)Shift, true); Freshnel.Transform(_temp, _temp, Wavelength, Distance, ObjectSize, true); ImageProcessing.Divide(_inputFreshnelTransform, _temp, _temp); ImageProcessing.Sum(_temp, Output, Output); } } ImageProcessing.Divide(Output, 8, Output); } }