A method for detecting objects in a holographic image, comprising: obtaining a holographic image having one or more objects depicted therein and a focal depth ( z) of the holographic image; obtaining a set of object templates { d} representing objects to be detected in the holographic image, wherein the set includes a known number ( j) of object templates; and detecting one or more objects in the holographic image using the set of object templates by iteratively computing a phase ( θ) of the optical wavefront at the hologram plane, background illumination ( μ), and encoding coefficients for the set of object templates, until converged, wherein each encoding coefficient gives locations of objects resembling an object template of the set of object templates associated with said encoding coefficient; wherein the step of detecting one or more objects comprises: initializing the encoding coefficients and background illumination, computing the phase of the optical wavefront at the hologram plane using the focal depth, encoding coefficients and background illumination as θ = angle( T ( z) ★ Σ j d j ★ A j + μ 11 T), wherein T ( z) is a wide angular spectrum transfer function, computing background illumination based on the holographic image with phase and the optical wavefront at the hologram plane as μ = mean H ∘ e iθ − T z * ∑ j d j * A j, computing encoding coefficients based on phase and background illumination, and repeating the computational steps until convergence of the respective value for each of the phase, background, and encoding coefficients. obtaining a holographic image having one or more objects depicted therein and a focal depth ( z) of the holographic image; obtaining a set of object templates { d} representing objects to be detected in the holographic image, wherein the set includes a known number ( j) of object templates; and detecting one or more objects in the holographic image using the set of object templates by iteratively computing a phase ( θ) of the optical wavefront at the hologram plane, background illumination ( μ), and encoding coefficients for the set of object templates, until converged, wherein each encoding coefficient gives locations of objects resembling an object template of the set of object templates associated with said encoding coefficient; wherein the step of detecting one or more objects comprises: initializing the encoding coefficients and background illumination, computing the phase of the optical wavefront at the hologram plane using the focal depth, encoding coefficients and background illumination as θ = angle( T ( z) ★ Σ j d j ★ A j + μ 11 T), wherein T ( z) is a wide angular spectrum transfer function, computing background illumination based on the holographic image with phase and the optical wavefront at the hologram plane as μ = mean H ∘ e iθ − T z * ∑ j d j * A j, computing encoding coefficients based on phase and background illumination, and repeating the computational steps until convergence of the respective value for each of the phase, background, and encoding coefficients. initializing the encoding coefficients and background illumination, computing the phase of the optical wavefront at the hologram plane using the focal depth, encoding coefficients and background illumination as θ = angle( T ( z) ★ Σ j d j ★ A j + μ 11 T), wherein T ( z) is a wide angular spectrum transfer function, computing background illumination based on the holographic image with phase and the optical wavefront at the hologram plane as μ = mean H ∘ e iθ − T z * ∑ j d j * A j, computing encoding coefficients based on phase and background illumination, and repeating the computational steps until convergence of the respective value for each of the phase, background, and encoding coefficients.