Investigation of optimal conditions for recording intensity holograms and optical images