Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 


Submitted by Sean Wilson, posted on August 31, 2001




Image Description, by Sean Wilson



I thought I'd send in something a little bit different. I've written a Java applet that combines a depth-map and a pattern to produce stereogram/"magic-eye" images. If you've never heard of them before, they are pictures that hide a 3D image which can been seen by focusing your eyes in a certain way. The algorithm for producing these is actually very simple to implement.

Here is a diagram of light-rays bouncing off a point on a object and into an observer's eyes, who is focused on that point:

      Object point
      /
     /  
    /    
   /      
  /        
 /          
/            
Left eye     Right eye
The way you see is very complex, but basically both eyes are seeing the same image so your brain can tell how far away the object is based on you focus. Now, imagine placing a piece of paper between yours eyes and the object and colouring in where the light-rays intersect it:

      Object point
      /
     /  
    /    
---x------x--- Paper
  /        
 /          
/            
Left eye     Right eye
As long as your eyes are still focusing at the same point (*not* on the paper) your brain is fooled into thinking that the light coming from the two nearby points is actually from one point further away. Also, observe that if the object was to be moved closer, the intersections would be closer together. So, by placing matching pairs of points in an image and focusing differently, you can fool the brain into seeing a 3D image from a 2D one.

If you have trouble seeing stereograms, I'll give you some tips. Make sure your eyes are parallel to the horizontal edge of your monitor and you are positioned in the middle of it, otherwise the matching points won't align properly. Focus behind the screen to start with by going slightly cross-eyed and keep adjusting focus until another image begins to appear. If you don't have this much control on your focus (some people find that difficult), just stick your eyes against the monitor and slowly move your head back without trying to focus on the monitor. There's no reason why anyone can't see them, so just keep trying.

Also, viewing this image at a 1280x1024 resolution, I can see the stereogram easily at sitting distance from my monitor. If the image appears bigger on your screen, you will have to move further away to see it (which most people will find much harder).

If you want to try out some more stereograms and view the source code for producing them, along with some other applets, go to www.smiley-face.freeserve.co.uk/programming/


[prev]
Image of the Day Gallery
www.flipcode.com

[next]

 
Message Center / Reader Comments: ( To Participate in the Discussion, Join the Community )
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
AtheistGod

September 01, 2001, 10:55 AM

Are you sure about this?

I always thought Magic Carpet could only do this to static screen shots, and that you couldn't actually play in this mode? I guess it would take too long to render each frame and then convert it to Magic Eye.

I could be wrong, I did only hear about the feature and never tried it mysef.

Andrew.

 
Thowllly

September 01, 2001, 11:47 AM

Nope, the wrench is definitly in front of the hammer. You must be crossing your eyes the wrong way :)

 
Thunderbird

September 01, 2001, 12:59 PM

I assure you guys that it is not a hoax. btw, I also got the inverted thing a few times. Even though I knew it was inverted, it took me about a minute to uninvert it. Something else interesting about the house to note. Besides the obvious house and open space for a door and a window, there is a bush or walkway thingy going up to the door. Also, there is a plane behind the house. It took me a while to see the whole plane, but there is an elevated plane sticking out behind the house (but in front of the background).

 
disableddan

September 01, 2001, 02:33 PM

Holy crap, man! That kicks ass!!!

 
Squint

September 01, 2001, 02:52 PM

Magic carpet I definitely did this, and you could play it like that, but the depth resolution you get is dreadful so it wasn't very effective... you can't colour the image in in any way so depth was all you had to go off, and when a monster in front of a house looks the same distance away as the house . . .

You can't colour it in because you'd need different colours for each eye on the same pixel, but Im just wondering if I can see a way around that (aka 'cheating') but none occurs to me :/

 
Mateo

September 01, 2001, 03:01 PM

My A.D.D. is way to be able to bad to see that stuff. I'm sure it's cool though.

 
BobTheBuilder

September 01, 2001, 03:11 PM

Wow, I really liked this IOTD! I've been playing with it all evening.

I came accross this the other night, too. I'm not sure if it's technically the same process, but it looks cool.

3D Sprong: http://www.dtek.chalmers.se/~d3rebas/creative/martinsoft/spong.html

 
IOHazard

September 01, 2001, 08:36 PM

Cool image. I always see them backwards (cross eyed) but still impressive.

About three years ago I wrote a screen saver that ran moving 3D shapes around the screen. My stereograms used noise stripes rather than tiled images (SIRDS). It ran at ~15fps for 1024x768 on a Pentium II 233 with a crummy old 2D card and regenerating the random values every frame.

Real time 3D stereograms should defnately be possible with modern hardware. The biggest problem I saw with it is that the SIRDS don't look so good when objects are too close to the edge of the usable screen so fully 3D environments with walls and things moving past the user don't look great. For Pong or a scroller it might be okay though.

BTW I installed the screen saver at work and it drove half the engineering staff nuts. :)

 
remo

September 02, 2001, 03:05 PM

i reckon it's a conspiracy.

first poster says 'nice house' and suddenly everyone sees a house. coincidence? i think not.

i've figured you all out.

 
henry ludemann

September 03, 2001, 01:06 AM

You need access to the z buffer. The color of each pixel is then just picked x pixels from the left, where x=f(z). Problem is you need to pick pixels between other pixels, (ie : 3.4 pixels to the left) or the depth of the final image becomes limited to certain depths (ie : no smooth transition from near to front).

The problem with doing the offset part in hardware is that the picture needs to reference itself... ie: the source and destination texture are the same.

 
Rui Martins

September 03, 2001, 11:58 AM

In Fact, you can have colors, but not Exactly with this type of stereogram, because, it's intrinsic contruction disallows it.

The problem is in the fact that the Left and Right Image are superimposed over each other, that is why you can't put the correct color for each eye.

But if you Actually separate the Left & Right Images, you can use the right colors, you can even have a special camera to take stereo photographs.

A really cool Site to check Stereo Images is:
HTTP://www.3DExpo.com/

And when there, you can download the Depth Charge Pluggin, which will help you to see the Stereo Images, in almost any Stero Format known.

Do you have those AnaGlyph Glasses (Red/Blue) which were used for viewing some horror movies in the late 80's, Early 90's.
The Plugin Supports those too !

You can check out the Gallery:
HTTP://www.3DExpo.com/gallery.htm

For the Luky Bastards (like me) who have 3D Eye Wear, the Plugin also supports some.

Note:
For everybody which doesn't have 3D Eye Wear (Like me, when at work), just setup the Plugin (Use Right Mouse Button over the Stereo Image), like:

inBrowser View -> 2D (Default)
FullScreen View -> Crosseye OR Parallel, what ever suits you better.

Enjoy.

See ya



 
This thread contains 71 messages.
First Previous ( To view more messages, select a page: 0 1 2 ... out of 2) Next Last
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.