Categories
Computer Vision

Computer Vision Enhanced Stereograms: From Flat Images to Dynamic 3D Illusions


Stereograms are an old trick that has existed for centuries and consistently amused viewers. Over time, however, stereograms lost their shine and are not as popular. Frankly, prior to exploring the potential applications of computer vision algorithms across different domains, we were entirely unaware of the existence of stereograms.. A fascinating thing about stereograms is that they can create a three-dimensional image from a two-dimensional one. Their remarkable feature lies in how they manipulate depth perception, fooling the brain into perceiving depth and conjuring a vivid 3D image from what was once a mere flat picture. It’s akin to a mesmerizing optical illusion that enchants the eyes!

But, as is the case with everything that has existed for decades, almost every image has been used as a depth map for stereograms. We provided three images: one featuring a black hole, another depicting a camel, and the third showcasing a coke glass bottle. We selected these images for various reasons. Firstly, the black hole image was chosen to challenge viewers and provide a unique experience. We thought it would be really unique to see a black hole in 3D, mainly because we can’t forever wait on NASA to show us a 3D rendering of a black hole. So we decided to take matters into our own hands. Secondly, we utilized DALLE to generate an image of a camel in a desert at sunset, which we found particularly striking and engaging. This choice was made to create a scenic and captivating depiction of a camel in its natural habitat. The third image is a straightforward depiction of a bottle. Our curiosity led us to explore how a bottle would appear in a stereographic 3D image. So we have implemented a computer vision algorithm to create a stereographic image for these three images.

Blackhole image
Camel Image generated by DALLE
A Image of a Bottle

We first started trying to create the stereogram with gusto and our first one was not quite right as we did not grasp the intricacies on how to create one. This led to us not having a stereogram (which consists of depth map and a pattern) but just a patterned image:

We then delved further into understanding the mechanics behind stereogram generation by referencing Frolian’s blog post titled “Making Your Own Autostereograms using Python.” Through this exploration, we gained insights into identifying optimal patterns, ultimately leading us to produce a stereogram featuring a bottle.

Please allow a moment or two for the 3D image of the bottle to fully materialize.

We then followed it up with the AI generated image of the camel and created a stereographic image of a camel:

Please allow a moment or two for the 3D image of a camel to fully materialize.

And then finally the blackhole:

Please allow a moment or two for the 3D image of the blackhole to fully materialize.

The images can be seen in 3D if you give a minute or two you can see the 3D image. It is really easy to figure out the images in 3D in from the stereographic images provided above. A popular method involves employing a depth map, where diverse shades or colors signify different depths in the image. When observed using suitable techniques like cross-eyed or parallel viewing, the brain processes these depth cues to construct a three-dimensional impression. Another approach utilizes repeating patterns known as “random dot autostereograms,” where in the pattern itself holds depth details, and the brain decodes it to perceive the 3D effect. In essence, the crucial aspect is embedding depth cues in the image that the brain can interpret, thus generating the illusion of depth perception.

To enhance the challenge of finding the stereographic image, we opted to transform the original images into ASCII characters before converting them into stereographic images. This additional step renders it even more challenging to uncover the hidden stereographic 3D image. We employed an algorithm to convert each original image into its corresponding ASCII representation. The resulting ASCII images are provided below:

ASCII image of a Blackhole
ASCII image of a camel in a desert
ASCII image of a bottle

Following the conversion of the original images into their respective ASCII representations, we utilized the same computer vision algorithm employed for the previous images to convert the ASCII images into stereographic images.
The ASCII converted stereographic images are listed below.

Stereographic image of a bottle ASCII image
Stereographic image of a camel ASCII image
Stereographic image of a blackhole ASCII image

Now, discerning the hidden stereographic image within the ASCII character converted images is truly challenging, requiring a few minutes to decipher the hidden pattern and identify the 3D stereographic image. This heightened difficulty level adds complexity to determining the actual image when original images are converted into ASCII characters.


The results of our approach involve the successful transformation of original images into ASCII representations and subsequent conversion into stereographic images using computer vision algorithms. In comparison with alternative methods, such as the way of generating a stereographic images through computer vision algorithms, our methods adds an additional layer of complexity by first converting the images into ASCII character representations. The way of generating the stereographic images through computer vision algorithms primarily rely on depth maps or repeating patterns, out approach offers a unique twist by incorporating ASCII characters, making it more challenging to discern the hidden stereographic images.

Throughout this project, we made use of a diverse range of tools and resources, which encompassed computer vision algorithms tailored for image processing and conversion. We drew inspiration from existing stereogram generation techniques and explored innovative ways to incorporate ASCII representations into the process. Additionally, online repositories and tutorials on computer vision techniques served as valuable resources for developing and implementing our approach.

By incorporating computer vision algorithms, we have explored new dimensions of creativity and visual perception, elevating the art of stereograms to a new level of complexity and intrigue. Whether deciphering the subtle patterns within ASCII characters or marveling at the illusion of depth perception in stereographic images, this fusion of technology and artistry offers endless opportunities for exploration and discovery.

This blog post was created by Parithosh Dharmapalan and Pooja Srinivasan.

Leave a Reply

Your email address will not be published. Required fields are marked *