Hybrid Images

 

Two images are combined to form a hybrid image; one has only its low frequency components the other only high frequency. This results in an illusion where you see one image up close and the other from further away (or if while squinting). The low frequency image is created by filtering the original image with a Gaussian. The high frequency image is created by filtering with a Gaussian then subtracting the blurred image from the original image.

Bill Gates – Elvis

elvis_bwelvis_lowelvis_fft

The original image of Elvis followed by the Gaussian blurred image. The Fourier transform to the right of the blurred image shows that most of the high frequencies have been removed.

gates_bwgates_highgates_fft

The original image of Bill Gates followed by the laplacian filtered image (in practice the original image minus a Gaussian blurred image). The Fourier transform to the right shows that there are lots of high frequency components.

gates-elvis-hybridfft_gates-elvis-hybrid

The hybrid image. The Fourier transform shows components from the whole frequency spectrum, the high frequency regions are from Gates and the low frequency regions are from Elvis.

 

Choosing Parameters

The size of the Gaussian used to make the high and low frequency images can be tuned to make the hybrid image look right. Increasing the size of the Gaussian on the low frequency image makes it appear less strongly in the hybrid image as more frequencies are being removed. Increasing the size of the Gaussian for the high frequency image makes it appear more strongly in the hybrid image as less frequencies are being removed. These two numbers are set experimentally to balance the two images.

It is also important to align the images in a smart way. For the illusion to work well the objects in each image should occupy roughly the same space in the image so they can mask each other. Blank areas of either image will have very little frequency information and won’t cover the other image when it is meant to.

 

Weeping Angels

 

This example comes courtesy of one of my favourite Dr. Who episodes featuring the weeping angels.

weeping_bwscary_bw

hybrid_weeping

Failure Case

dead_bwtree_bw

hybrud_tree

The hybrid image doesn’t work because the objects are not covering each other and the threshold used for the high frequency image (the dead tree) is too high making it difficult to make it disappear.

 

Glass Half Full – Glass Half Empty

hybrid_glass

A final thought, it doesn’t work if they are both the same...