Introduction
Diffraction calculation, such as the angular spectrum method and Fresnel diffraction, are used in wide-ranging optics fields, ultrasonic, X-ray and electron beam to calculate scalar wave propagation. For example, in optics field, these calculations are useful for computer-generated holograms (CGHs), digital holography, the design of diffractive optical elements, microscopy, image encryption and decryption, three-dimensional analysis for optical devices and so on. We develop a C++ class library, which is referred to as Computational Wave Optics library for C++ (CWO++), for diffraction and useful auxiliary functions. The diffraction caluclations are Fresnel diffraction, angular spectrum method, scaled diffractions, tilted diffractions and so forth. This library can run on both CPUs and NVIDIA GPUs.
- Author:
- Tomoyoshi Shimobaba
- Version:
- CWO++ library ver 0.32
- Date:
- 2011-2018
Features
- fixed some bugs
- improve calculation performance
- improve arithmetric operators
- CUDA 8.0 supprot
- adding wavelet transform (under testing)
- etc....
Examples
This library is designed for easily programming wave optics phenomena. For example, the following sample code shows the calculation of a diffracted field using the angular spectrum method on a CPU.
If you want to execute the above source code on a GPU, you only rewrite class CWO with class GWO as the following source code. Other code rewritings are not necessary. This feature improves portability from a CPU source code to GPU one. The data communication between a host computer and GPU is implicitly done by class GWO.
You can also use the following sample code if you need explicitly data communication.
The left and right images are the original image and diffracted image, respectively.
For more sample codes, please see example page.
Gallary
The following CGHs and the reconstructed images were obtained by CWO++ library.
Reconstructed images from CGHs. (original data : The Stanford 3D Scanning Repository)
Reconstructed images from CGHs. (original data : S.Wanner, S. Meister, and B. Goldluecke, "Datasets and Benchmarks for Densely Sampled 4D Light Fields," Vision, Modeling & Visualization, 225?226 (2013))
Downloads
You can download this library from here.
Environment
- Windows XP or higher
- CPU version is available in 64 bit version OS
- GPU version is only available in 64 bit version OS
- Linux (Cent OS) version is comming soon
- If using NVIDIA GPUs, CWO++ requires CUDA 8.0 (64bit version is required)
Installation for Windows
- Please download latest CWO library from here.
- The library file "cwo.lib" and dll file "cwo.dll" is placed in arbitrary directory. Please set to the PATH in your system. Or, please place these files on your C++ project directory.
- The directory "src" includes C++ source codes for CWO library. Please set the PATH in your system.
- In your C++ source code, please include the header file "cwo.h"
- If you want to use jpeg format etc., except for bitmap format, you need to install ImageMagick.
Installation for Linux
Coming soon...
How to update new CWO++ library to existing code using the old version
If you have already used CWO++ library and want to update new version of CWO++ library, please overwrite the existing directory "src" and files "cwo.dll" "cwo.lib" "gwo.dll" and "gwo.lib" by the new version of them.
If you have problems...
- Cannot open include file: 'omp.h'
"omp.h" is the header file of OpenMP. If you use Visual Studio C++ express version, you may find the error of "cannot find omp.h" because the VISUAL C++ express version did not use OpenMP. Please check that "Properties -> C/C++ -> Language -> OpenMP Support" is "no".
Reference
- T. Shimobaba, J. Weng, T. Sakurai, N. Okada, T. Nishitsuji, N. Takada, A. Shiraki, N. Masuda and T. Ito, "Computational wave optics library for C++: CWO++ library", Computer Physics Communications, 183, 1124-1138 (2012)
Academic achievements using CWO++ library
Please contact me when you can obtain academic / commercial achievements using CWO library.
- T. Shimobaba, Y. Endo, T. Nishitsuji, T. Takahashi, Y. Nagahama, S. Hasegawa, M. Sano, R. Hirayama, T. Kakue, A. Shiraki, T. Ito, "Computational ghost imaging using deep learning", Optics Communications, 413, 147-151 (2018)
- T. Shimobaba, K. Matsushima, T. Takahashi, Y. Nagahama, S. Hasegawa, M. Sano, R. Hirayama, T. Kakue, T. Ito, "Fast, large-scale hologram calculation in wavelet domain", Optics Communications, 412, 80-84 (2018)
- T. Shimobaba, N. Kuwata, M. Honma, T. Takahashi, Y. Nagahama, M. Sano, S. Hasegawa, R. Hirayama, T. Kakue, A. Shiraki, N. Takada, T. Ito, "Convolutional neural network-based data page classification for holographic memory", Applied Optics, 56, 7327-7330 (2017)
- D. Arai, T. Shimobaba, T. Nishitsuji, T. Kakue, N. Masuda, T. Ito, "An accelerated hologram calculation using the wavefront recording plane method and wavelet transform" Optics Communications, 393, 15, 107?112 (2017)
- T. Shimobaba, Y. Endo, R. Hirayama, Y. Nagahama, T. Takahashi, T. Nishitsuji, T. Kakue, A. Shiraki, N. Takada, N. Masuda, T. Ito, "Autoencoder-based holographic image restoration", Applied Optics, 56, pp. F27-F30 (2017)
- T. Shimobaba, Y. Endo, R. Hirayama, D. Hiyama, Y. Nagahama, S. Hasegawa, M. Sano, T. Takahashi, T. Kakue, M. Oikawa, T. Ito, "Holographic micro-information hiding", Applied Optics, 56, 833-837 (2017)
- T. Shimobaba, T. Ito, "Fast generation of computer-generated hologram using wavelet shrinkage", Optics Express, 25, 77-87 (2017)
- T. Shimobaba, M. Makowski, Y. Nagahama, Y. Endo, R. Hirayama, D. Hiyama, S. Hasegawa, M. Sano, T. Kakue, M. Oikawa, T. Sugie, N. Takada, T. Ito, "Computer-generated hologram using random phase-free method and color space conversion", Applied Optics, 55, 4159-4165 (2016)
- Y. Nagahama, T. Shimobaba, T. Kawashima, T. Kakue, T. Ito,"Holographic multi-projection using random phase-free method", Applied Optics, 55, 1118-1123 (2016)
- T. Shimobaba, T. Kakue, Y. Endo, R. Hirayama, D. Hiyama, S. Hasegawa, Y. Nagahama, M. Sano, M. Oikawa, T. Sugie, T. Ito, "Improvement of the image quality of random phase-free holography using an iterative method", Optics Communications, 355, 596-601 (2015)
- T. Shimobaba, T. Kakue, Y. Endo, R. Hirayama, D. Hiyama, S. Hasegawa, Y. Nagahama, M. Sano, M. Oikawa, T. Sugie, T. Ito,"Random phase-free kinoform for large objects", Optics Express, 23, 17269-17274 (Jun. 2015)
- T. Oshima, Y. Matsudo, T. Kakue, D. Arai, T. Shimobaba and T. Ito, "Twin-image reduction method for in-line digital holography using periphery and random reference phase-shifting techniques", Optics Comminications, 350, 270-275 (Sep. 2015)
- T. Shimobaba, T. Ito, "Random phase-free computer-generated hologram", Optics Express, 23, 9549-9554 (2015)
- I. Ducin, T. Shimobaba, M. Makowski, K. Kakarenko, A. Kowalczyk, J. Suszek, M. Bieda, A. Kolodziejczyk, M. Sypek, "Holographic projection of images with step-less zoom and noise suppression by pixel separation", Optics Communications, 340, 131-135 (2015)
- D. Hiyama, T. Shimobaba, T. Kakue and T. Ito, "Acceleration of color computer-generated hologram from RGB-D images using color space conversion", Optics Communications, 340, 121-125 (2015)
- D.V. Pantelic, D.Z. Grujic, D.M. Vasiljevic, "Single-beam, dual-view digital holographic interferometry for biomechanical strain measurements of biological objects", J. Biomed. Opt. 19, 127005 (2014)
- T. Shimobaba, M. Makowski, T. Kakue, N. Okada, Y. Endo, R. Hirayama, D. Hiyama, S. Hasegawa, Y. Nagahama, T. Ito, "Numerical investigation of lensless zoomable holographic projection to multiple tilted planes", Optics Communications, 333, 274-280 (2014)
- T. Shimobaba, T. Kakue, N. Okada, Y. Endo, R. Hirayama, D. Hiyama, and T. Ito, "Ptychography by changing the area of probe light and scaled ptychography", Optics Communications, 331, 189-193 (2014)
- T. Shimobaba, T. Kakue, M. Oikawa, N. Takada, N. Okada, Y. Endo, R. Hirayama, T. Ito, "Calculation reduction method for color computer-generated hologram using color space conversion", Optical Engineering (accepted)
- T. Shimobaba, T. Kakue, M. Oikawa, N. Okada, Y. Endo, R. Hirayama, N. Masuda, T. Ito, "Non-uniform sampled scalar diffraction calculation using non-uniform Fast Fourier transform", Optics Letters, 38, 5130-5133 (2013)
- T. Shimobaba, M. Makowski, T. Kakue, M. Oikawa, N. Okada, Y. Endo, R. Hirayama, T. Ito, "Lensless zoomable holographic projection using scaled Fresnel diffraction", Optics Express, 21, 25285-25290 (2013)
- T. Shimobaba, H. Yamanashi, T. Kakue, M. Oikawa, N. Okada, Y. Endo, R. Hirayama, N. Masuda, T. Ito, "Inline digital holographic microscopy using a consumer scanner", Scientific Reports, 3, 2664 (2013)
- T. Shimobaba, T. Kakue, N. Okada, M. Oikawa, Y. Yamaguchi, T. Ito, "Aliasing-reduced Fresnel diffraction with scale and shift operations", Journal of Optics, 15, 075302(5pp) (2013)
- N. Okada, T. Shimobaba, Y. Ichihashi, R. Oi, K. Yamamoto, M. Oikawa, T. Kakue, N. Masuda, T. Ito, "Band-limited double-step Fresnel diffraction and its application to computer-generated holograms," Opt. Express 21, 9192-9197 (2013)
- T. Shimobaba, T. Kakue, Nobuyuki Masuda and Tomoyoshi Ito, "Numerical investigation of zoomable holographic projection without a zoom lens", Journal of the Society for Information Display, 20, 9, 533-538 (2012)
- T. Shimobaba, K. Matsushima, T. Kakue, N. Masuda, T. Ito, "Scaled angular spectrum method", Optics Letters, 37, 4128-4130 (2012.09)
- T. Shimobaba, N. Masuda and T. Ito, "Arbitrary shape surface Fresnel diffraction", Optics Express 20, 9335-9340 (2012.04)
- T. Shimobaba, T. Takahashi, N. Masuda, T. Ito, "Numerical study of color holographic projection using space-division method", Optics Express 19, 10287-10292 (2011)
- T. Shimobaba, H. Nakayama, N. Masuda, T. Ito, "Rapid calculation of Fresnel computer-generated-hologram using look-up table and wavefront-recording plane methods for three-dimensional display", Optics Express, 18, 19, 19504-19509 (2010)
- T. Shimobaba, N. Masuda, Y. Ichihashi, T. Ito, "Real-time digital holographic microscopy observable in multi-view and multi-resolution", Journal of Optics, 12, 065402 (4pp) (2010)
- T. Shimobaba, N. Masuda, T. Ito, "Simple and fast calclulation algorithm for computer-generated hologram with wavefront recording plane", Optics Letters, 34, 20, 3133-3135 (2009)
- H. T. Dai, X. W. Sun, D. Luo, and Y. J. Liu, "Airy beams generated by a binary phase element made of polymer-dispersed liquid crystals," Opt. Express 17, 19365-19370 (2009)
- D. Luo, H. T.Dai, X. W. Sun, H. V. Demir, "Electrically switchable finite energy Airy beams generated by a liquid crystal cell with patterned electrode", Optics Communications, 283(20), 3846-3849 (2010).