BSc module project. Written in MATLAB script in 2001.

This program creates a stereogram from a depth map.

  • sg.m - The command-line interface.
  • mystereogram.m - The bulk of the code. Run sg and follow the prompts. Here's an example using the depth map provided below (any greyscale bitmap can be used)...
     » sg 
     -- sg.m -- create a stereogram -- 
     depth image (greyscale indexed format) selection 
     please enter filename (surrounded by single quotes): 'ripple.bmp' 
     loading depth image... 
     please enter max. depth (0-1): 0.98 
     calculating depth information... 
     creating stereogram... 
     colour selection 
     0: all colours 
     1: reds 
     2: greens 
     3: blues 
     please enter 0-3: 1 
     please enter number of colours (>=2): 4 
     please enter distance of eyes from image (in cm >=10): 40 
     please enter pixel size (in mm >0): 1 
     -- end -- 
    It generates this stereogram. For those that don't know how to view a stereogram, focus past the image (in this case with your head 40cm away). I find that for this particular sterogram looking slightly right of the centre helps.
  • ripple.bmp - Example of a depth map (bmp format).


  • Update 08/12/2011: Moved location of some files.

Last modified: 30/04/2006 (most likely earlier as a site migration in 2006 reset some dates) Tags: (none)

This website is a personal resource. Nothing here is guaranteed correct or complete, so use at your own risk and try not to delete the Internet. -Stephan

Site Info

Privacy policy

Go to top