From kpc!news.kpc.com!sgiblab!spool.mu.edu!howland.reston.ans.net!vixen.cso.uiuc.edu!newsrelay.iastate.edu!dunix.drake.edu!acad.drake.edu!pk6811s Tue Dec 28 16:03:17 PST 1993 Article: 2474 of comp.graphics.algorithms Newsgroups: comp.graphics.algorithms Path: kpc!news.kpc.com!sgiblab!spool.mu.edu!howland.reston.ans.net!vixen.cso.uiuc.edu!newsrelay.iastate.edu!dunix.drake.edu!acad.drake.edu!pk6811s From: pk6811s@acad.drake.edu Subject: Computer-Generated Holograms Message-ID: <1993Dec28.144435.1@acad.drake.edu> Lines: 142 Sender: news@dunix.drake.edu (USENET News System) Nntp-Posting-Host: acad.drake.edu Organization: Drake University, Des Moines, Iowa, USA Date: Tue, 28 Dec 1993 20:44:35 GMT This is a DRAFT of an article describing how to computer-generate a hologram. Your _helpful_ suggestions and corrections are very much desired. INTRODUCTION. After long procrastination I decided to sit down and work out the necessary Basic code to generate a diffraction pattern suitable for photo-reducing to make a hologram. I am not a physicist or holographic expert. In fact, I have not even produced a hologram with this code (yet). But I love coding challenges, and there have been sufficient requests for this kind of code with insufficient answers available. This posting is primarily based on the following article, which includes several plots and photographed holo-images: Article: Computer-Generated Holographic Images Magazine: Circuit Cellar Ink Author: Dale Nassar Date: April/May 1990, pp. 22-37 Your library may be able to obtain a copy. These are 'binary' holograms, meaning they are two-color images ie. black-and-white, and no gray-scale or color plotting is needed. The plot may be displayed on a monitor, printer, or plotting device and photo-reduced to create the hologram. FIRST THINGS. In preparation for the algorithm you need to consider these variables: LC: Color of your light source (wavelength) 6328 * (10^-10) = HeNe laser red PM: Pixels per meter on your plot (screen, paper, ...) PM=39.37 * DotsPerInch RD: Photographic reduction factor EffectivePlotSize / ExposedFilmSize PS: Plot size - measured across diagonal measure portion of plot that is actually photographed OW: Object Width or Height or Diagonal, whichever is largest (before reduction) AA: Anti-alias factor - reduces artifacts larger is better, 2.5 is ok All measurements are in meters. The above variables are used to determine the depth of your object. This is likely to be disappointing for many projects as you may need a telescope to find your image behind the holograph. The reason is that the resolving power of the hologram is determined by the spacing between the lines making up the diffraction pattern. A real, laser-produced holograph will produce spacing on the order of 1000 line-pairs per mm, while these computer-generated versions are only about 10. To calculate the minimum depth of your object, OD, at its plane of maximum width: AS = arcsin(PM*LC*RD/(AA*2)) TW = PS+OW HT = TW/sin(AS) OD = sqr(HT*HT + TW*TW) You can place the object at greater depth with no problem, but placing it closer will cause artifacts and blurriness in the final image - you'll have enough of those anyway :-) PLOTTING THE HOLOGRAM: You need to create a pixel-map of the object. If your object is a simple two-dimensional image, like a silhouette or line-drawing, just record the X, Y, and Z coordinates in an array, where Z is the constant OD. If your object is three-dimensional, you need to create an array from the perspective of each pixel in the plot - a major rendering task. This can be simplified by rendering once for each column of pixels, eliminating the vertical parallax but preserving the horizontal. Now for every plot pixel we want to sum the amplitudes of the light rays received from each pixel in the object. If the total is greater than zero, then plot that point. DEFDBL A-Z DIM OX(nmax),OY(nmax),OZ(nmax) ' #pixels in object NMAX=? PXMAX=? ' plot width in pixels PYMAX=? ' plot height in pixels LC=6328/10000000000 ' wavelength of light RD=plotsize/photosize ' reduction factor P2L=3.1415926535898*2/(LC*RD) ' phase factor PM=? ' plot pixels per mm MPP=1/(1000*PM) ' meters per plot pixel GOSUB ImportImageMap ' if 2D image FOR X = 1 TO PXMAX PX=X*MPP FOR Y = 1 TO PYMAX PY=Y*MPP TL=0 GOSUB ImportRenderedImage ' if 3D image FOR N = 1 TO NMAX TX=OX(N)-PX TY=OY(N)-PY TZ=OZ(N) PD=SQR(TX*TX + TY*TY + TZ*TZ) ' distance to object pixel PH=TD*P2L ' phase of wave at plot pixel TL=TL+SIN(PH) ' add amplitude of wave NEXT N IF TL>0 THEN PLOT X,Y ' plot positive totals NEXT Y NEXT X GOSUB SavePlot ' save all that work GOSUB PrintPlot ' print a copy PHOTOGRAPHING AND VIEWING: To photograph the plot, you need a high-res film. Nassar used technical pan film which can resolve up to 400 line-pairs/mm, but also mentions Ektagraphic HC slide film (750 lp/mm) and Kodak 649F Spectroscopic (7000 lp/mm). I haven't tested any of these (yet). These are transmission holograms, requiring illumination from behind. Traditionally a laser is used as a light source, and that will give the sharpest image. They can, however, be illuminated with any point-source, such as a high-intensity bulb, or even the sun. You will have to find the image at the calculated depth, or project it from that depth onto a screen. White light will give a blurry image as its color components are each diffracted at slightly different angles. This can be compensated for by photographing the image with a single-color filter, or by plotting a single-color image on a black background, or plotting a reverse-color image on a white background and using the photo-negative. I strongly suspect that a full-color image could be created by overlaying separate plots for each of three colors - red, green, and blue. Just remember to use the minimum depth calculated from all three wavelengths, calculate a separate plot for each color, and combine them into an eight-color plot for final output. An eight-color plot should be capable of recreating a 24-bit color image. Paul Kline pk6811s@acad.drake.edu