Openholo  beta 2.0
Open Source Digital Holographic Library

Functions

bool ophSig::sigConvertOffaxis ()
 Function for Convert complex hologram to off-axis hologram . More...
 

Detailed Description

This module is related method which convert to off-axis hologram.

Introduction

Algorithm

Reference

Function Documentation

◆ sigConvertOffaxis()

bool ophSig::sigConvertOffaxis ( )

Function for Convert complex hologram to off-axis hologram .

Returns
if works well return 0 or error occurs return -1

Definition at line 653 of file ophSig.cpp.

653  {
654  OphRealField H1;
655  int nx = context_.pixel_number[_X];
656  int ny = context_.pixel_number[_Y];
657 
658  double x, y;
659  int i, j;
660  Complex<double> temp;
661  H1.resize(nx, ny);
662 
663  for (i = 0; i < nx; i++)
664  {
665  y = (_height / (nx - 1)*i - _height / 2);
666  for (j = 0; j < ny; j++)
667  {
668  x = (_width / (ny - 1)*j - _width / 2);
669 
670  temp._Val[_RE] = cos(((2 * M_PI) / *context_.wave_length)*(x*sin(_angleX) + y *sin(_angleY)));
671  temp._Val[_IM] = sin(((2 * M_PI) / *context_.wave_length)*(x*sin(_angleX) + y *sin(_angleY)));
672  H1(i, j) = (ComplexH[0](i, j)*temp)._Val[_RE];
673  }
674  }
675  double out = minOfMat(H1);
676  H1 - out;
677  out = maxOfMat(H1);
678 
679  for (i = 0; i < nx; i++)
680  {
681  for (j = 0; j < ny; j++)
682  {
683  ComplexH[0](i, j)._Val[_RE] = H1(i, j) / out;
684  ComplexH[0](i, j)._Val[_IM] = 0;
685  }
686  }
687  return true;
688 }
Real maxOfMat(matrix< T > &src)
Function for extracts max of matrix.
Definition: ophSig.cpp:146
Real minOfMat(matrix< T > &src)
Function for extracts min of matrix.
Definition: ophSig.cpp:177