Introduction
OpenHolo is an open source library which contains algorithms and their software implementation for generation of holograms to be applied in various fields. The goal behind the library development is facilitating production of digital holographic contents and expanding the area of their application. The developed by us open source library is a tool for computer generation of holograms, simulations and signal processing at various formats of 3D input data and properties of the 3D displays. Based on this, we want to lay the foundation for commercializing digital holographic service in various fields.
Examples
Generation Hologram - Point Cloud Example
: Implementation of the hologram generation method using point cloud data.
#include "ophPointCloud.h"
Hologram->
readConfig(
"config/TestSpecPointCloud.xml");
Hologram->
loadPointCloud(
"source/PointCloud/TestPointCloud_Plane.ply");
Hologram->
saveAsOhc(
"result/PointCloud/Result_PointCloudSample_Plane.ohc");
Hologram->
save(
"result/PointCloud/Result_PointCloudSample_Plane.bmp");
PointCloud based CGH Example
Generation Hologram - Depth Map Example.
: Implementation of the hologram generation method using depth map data.
#include "ophDepthMap.h"
Hologram->
readConfig(
"config/TestSpecDepthMap.xml");
Hologram->
saveAsOhc(
"result/DepthMap/Result_DepthmapSample.ohc");
Hologram->encodeHologram();
Hologram->
save(
"result/DepthMap/Result_DepthmapSample.bmp");
DepthMap based CGH Example
Generation Hologram - Triangle Mesh Example
#include "ophTriMesh.h"
Hologram->
loadMeshData(
"source/TriMesh/mesh_teapot.ply",
"ply");
Hologram->
saveAsOhc(
"result/TriMesh/Mesh_complexField.ohc");
Hologram->
save(
"result/TriMesh/Mesh_0.1m_ni_-0.3deg.bmp",
8,
nullptr, m_vecEncodeSize[
_X], m_vecEncodeSize[
_Y]);
Triangle Mesh based CGH Example
Generation Hologram - Light Field Example
#include "ophLightField.h"
Hologram->
loadLF(
"source/LightField/sample_orthographic_images_5x5",
"bmp");
Hologram->
saveAsOhc(
"result/LightField/LF_complexField.ohc");
Hologram->
save(
"result/LightField/Light_Field_NI_carrier.bmp",
8,
nullptr, m_vecEncodeSize[
_X], m_vecEncodeSize[
_Y]);
LightField based CGH Example
Generation Hologram - Wavefront Recording Plane(WRP) Example
#include "ophWRP.h"
Hologram->
saveAsOhc(
"result/LightField/LF_complexField.ohc");
Hologram->
save(
"result/WRP/Result_WRP.bmp");
Wave Aberration Example
#include "ophWaveAberration.h"
wa->
saveAsOhc(
"result/WaveAberration/aberration.ohc");
Cascaded Propagation Example
#include "ophCascadedPropagation.h"
pCp->
save(L
"result/CascadedPropagation/intensityRGB.bmp", pCp->
getNumColors() * 8);
pCp->
saveAsOhc(
"result/CascadedPropagation/intensityRGB");
Hologram signal processing - Off-axis hologram transform Example
#include "ophSig.h"
return false;
}
if (!holo->
load(
"source/OffAxis/3_point_re.bmp",
"source/OffAxis/3_point_im.bmp", 8)) {
return false;
}
holo->
save(
"result/OffAxis/Off_axis.bmp", 8);
holo->
saveAsOhc(
"result/OffAxis/Off_axis.ohc");
Signal processing Off-axis Example
Hologram signal processing - CAC transform Example
#include "ophSig.h"
return false;
}
if (!holo->
load(
"source/CAC/ColorPoint_re.bmp",
"source/CAC/ColorPoint_im.bmp", 24)) {
return false;
}
holo->
save(
"result/CAC/CAC_re_C.bin",
"result/CAC/CAC_im_C.bin", 24);
Signal processing CAC Example
Hologram signal processing - HPO transform Example
#include "ophSig.h"
return false;
}
if (!holo->
load(
"source/HPO/3_point_re.bmp",
"source/HPO/3_point_im.bmp", 8)) {
return false;
}
holo->
save(
"result/HPO/HPO_re.bmp",
"result/HPO/HPO_im.bmp", 8);
Signal processing HPO Example
Hologram signal processing - get parameter using axis transformation Example
#include "ophSig.h"
float depth = 0;
return false;
}
if (!holo->
load(
"source/AT/0.1point_re.bmp",
"source/AT/0.1point_im.bmp", 8)) {
return false;
}
std::cout << depth << endl;
holo->
save(
"result/AT/AT_re.bmp",
"result/AT/AT_im.bmp", 8);
Signal processing AT Example
Hologram signal processing - get parameter using SF Example
#include "ophSig.h"
float depth = 0;
return false;
}
if (!holo->
load(
"source/SF/3_point_re.bmp",
"source/SF/3_point_im.bmp", 8)) {
return false;
}
std::cout << depth << endl;
holo->
save(
"result/SF/SF_re.bmp",
"result/SF/SF_im.bmp", 8);
Signal processing SF Example
Hologram signal processing - get parameter using Phase Shift Digital Hologram Example
#include "ophSig.h"
const char *f0 = "source/PhaseShiftedHolograms/0930_005_gray.bmp";
const char *f90 = "source/PhaseShiftedHolograms/0930_006_gray.bmp";
const char *f180 = "source/PhaseShiftedHolograms/0930_007_gray.bmp";
const char *f270 = "source/PhaseShiftedHolograms/0930_008_gray.bmp";
holo->
save(
"result/PhaseShift/PSDH_re_C.bmp",
"result/PhaseShift/PSDH_im_C.bmp", 8);
holo->
saveAsOhc(
"result/PhaseShift/PSDH.ohc");
Phase shifting digital hologram Example
Hologram signal processing - get parameter using Phase Unwrapping Example
#include "ophSigPU.h"
if (!holo->
loadPhaseOriginal(
"source/PhaseUnwrapping/phase_unwrapping_example.bmp", 8)) {
return false;
}
int maxBoxRadius = 4;
holo->
saveAsOhc(
"result/PhaseUnwrapping/PU.ohc");
Phase Unwrapping Example
Hologram signal processing - get parameter using Compressive Holography Example
#include "ophSigCH.h"
return false;
}
if (!holo->
loadCHtemp(
"source/CompressiveHolo/sampleComplexH_re.bmp",
"source/CompressiveHolo/sampleComplexH_im.bmp", 8)) {
return false;
}
holo->
saveNumRec(
"result/CompressiveHolo/CH_Test.bmp");
Index will be appended for each reconstruction distance.
holo->saveAsOhc("result/PhaseUnwrapping/PU.ohc");
Compressive Holography Example