How to get an inline hologram of the MNIST dataset? #19
-
Hey there, thanks for creating such a helpful library. I am working on numerical simulation of a paper including use of deep learning neural networks for reconstruction of holograms. I am trying to prepare the training dataset by producing inline-holograms of the images in the MNIST handwritten digits dataset. This is what I am trying to achieve:- "The object aperture (transverse Credits-https://doi.org/10.1021/acsphotonics.1c01365?urlappend=%3Fref%3DPDF&jav=VoR&rel=cite-as Here is my attempt at the problem:-
Please suggest what I am doing wrong. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi Sud11111, Your holograms are amplitude holograms, and they are recorded from [-1,1] amplitude range. You need to specify this ApertureFromImage object because the default is [0,1]: import diffractsim
diffractsim.set_backend("CPU")
from diffractsim import MonochromaticField,ApertureFromImage, mm, cm, nm
λ = 600 * nm
F = MonochromaticField(
wavelength=600*nm, extent_x=70*λ, extent_y=70*λ, Nx=1024, Ny=1024, intensity = 0.01
)
F.add(ApertureFromImage("9.png", image_size=(25*λ, 25 *λ), simulation = F, amplitude_mask_extent = [-1,1]))
F.propagate(z=30*λ)
rgb = F.get_colors()
F.plot_colors(rgb) This example would reconstruct the number 9 hologram: Note that the holograms don't have good quality, at least by using the resolution of the image you attached. |
Beta Was this translation helpful? Give feedback.
Hi Sud11111,
Your holograms are amplitude holograms, and they are recorded from [-1,1] amplitude range. You need to specify this ApertureFromImage object because the default is [0,1]:
This example would reconstruct the number 9 hologram:
Note that the holograms don't hav…