Stereo Pixel MOVER

By Charles Douglas Wehner

The author`s first attempt at resurrecting Sir Charles Wheatstone in 3D was based on the moving of individual image areas by hand.

It was obvious from the start that this could only result in a kind of cardboarding, because the image can only be moved by a complete pixel at a time.

When Gutenberg invented movable type, a huge typeface industry developed in France and the Netherlands. It was based on the idea that if a needle is blunted to at least one seventy-second of an inch, it can no longer puncture the paper, and can be used for printing.

This, then, was the STANDARD POINT, and even when computers arrived, ir remained a standard. The Centronics and Epson print-heads had needles one point apart, and the standard Postscript graphics are based upon a one-point array.

Sharper graphics have since arrived, but we must consider firstly whether we wish to manipulate vast arrays of dots, and secondly whether the eye will see the benefit. Thirdly, the bleeding of the printed dots may make the actual definition much lower than the advertised quality.

Human eyes are typically two-and-a-quarter inches apart, and on the point standard this would be 162 dots.

When we stare towards the horizon past a one-point image, the axis of each eye will land on a pixel 162 dots apart. When we stare at the plane of the image, the axis of each eye will land on the SAME dot.

This leads to the realisation that if we stand ONE (metre/yard) from the printed stereo image, the perceived position of the subject on the point standard will be, in units of metres or yards, 162 divided by the pixel offset.

For example, if part of the image is depicted ONE pixel offset from where it would be for infinity, the distance will appear to be 162 divided by 1. That is, 162 metres or yards when one views from a metre or a yard.

Here is a table of the quantized depth-planes for the point standard. Note that when viewed from TWO metres/yards the distances must be DOUBLED:

1 162 2 81 3 54 4 40.5 5 32.4 6 27
7 23.14286 8 20.25 9 18 10 16.2 11 14.72727 12 13.5
13 12.46154 14 11.57143 15 10.8 16 10.125 17 9.529411 18 9
19 8.526316 20 8.1 21 7.714286 22 7.363636 23 7.043478 24 6.75
25 6.48 26 6.230769 27 6 28 5.785714 29 5.586207 30 5.4
31 5.225806 32 5.0625 33 4.909091 34 4.764706 35 4.628572 36 4.5
37 4.378378 38 4.263158 39 4.153846 40 4.05 41 3.95122 42 3.857143
43 3.767442 44 3.681818 45 3.6 46 3.521739 47 3.446809 48 3.375
49 3.306123 50 3.24 51 3.176471 52 3.115385 53 3.056604 54 3
55 2.945455 56 2.892857 57 2.842105 58 2.793103 59 2.745763 60 2.7
61 2.655738 62 2.612903 63 2.571429 64 2.53125 65 2.492308 66 2.454545
67 2.41791 68 2.382353 69 2.347826 70 2.314286 71 2.28169 72 2.25
73 2.219178 74 2.189189 75 2.16 76 2.131579 77 2.103896 78 2.076923
79 2.050633 80 2.025 81 2 82 1.97561 83 1.951807 84 1.928571
85 1.905882 86 1.883721 87 1.862069 88 1.840909 89 1.820225 90 1.8
91 1.78022 92 1.76087 93 1.741935 94 1.723404 95 1.705263 96 1.6875
97 1.670103 98 1.653061 99 1.636364 100 1.62 101 1.60396 102 1.588235
103 1.572816 104 1.557692 105 1.542857 106 1.528302 107 1.514019 108 1.5
109 1.486238 110 1.472727 111 1.459459 112 1.446429 113 1.433628 114 1.421053
115 1.408696 116 1.396552 117 1.384615 118 1.372881 119 1.361345 120 1.35
121 1.338843 122 1.327869 123 1.317073 124 1.306452 125 1.296 126 1.285714
127 1.275591 128 1.265625 129 1.255814 130 1.246154 131 1.236641 132 1.227273
133 1.218045 134 1.208955 135 1.2 136 1.191176 137 1.182482 138 1.173913
139 1.165468 140 1.157143 141 1.148936 142 1.140845 143 1.132867 144 1.125
145 1.117241 146 1.109589 147 1.102041 148 1.094595 149 1.087248 150 1.08
151 1.072848 152 1.065789 153 1.058824 154 1.051948 155 1.045161 156 1.038462
157 1.031847 158 1.025316 159 1.018868 160 1.0125 161 1.006211 162 1

Plane of screen.

163 .993865 164 .9878049 165 .9818182 166 .9759036 167 .9700599 168 .9642857
169 .9585799 170 .9529412 171 .9473684 172 .9418604 173 .9364162 174 .9310345
175 .9257143 176 .9204546 177 .9152542 178 .9101124 179 .9050279 180 .9
181 .8950276 182 .8901099 183 .8852459 184 .8804348 185 .8756757 186 .8709677
187 .8663102 188 .8617021 189 .8571429 190 .8526316 191 .8481675 192 .84375
193 .8393782 194 .8350515 195 .8307692 196 .8265306 197 .822335 198 .8181818
199 .8140703 200 .81 201 .8059701 202 .8019802 203 .7980295 204 .7941176
205 .7902439 206 .7864078 207 .7826087 208 .7788461 209 .7751196 210 .7714286
211 .7677725 212 .7641509 213 .7605634 214 .7570093 215 .7534884 216 .75
217 .7465438 218 .7431192 219 .739726 220 .7363636 221 .7330317 222 .7297297
223 .7264574 224 .7232143 225 .72 226 .7168142 227 .7136564 228 .7105263
229 .7074236 230 .7043478 231 .7012987 232 .6982759 233 .6952789 234 .6923077
235 .6893617 236 .6864407 237 .6835443 238 .6806723 239 .6778243 240 .675
241 .6721992 242 .6694215 243 .6666667 244 .6639344 245 .6612245 246 .6585366
247 .6558704 248 .6532258 249 .6506024 250 .648 251 .6454183 252 .6428571
253 .6403162 254 .6377953 255 .6352941 256 .6328125 257 .6303502 258 .627907
259 .6254826 260 .6230769 261 .6206896 262 .6183206 263 .6159696 264 .6136364
265 .6113207 266 .6090226 267 .6067415 268 .6044776 269 .6022305 270 .6
271 .5977859 272 .5955882 273 .5934066 274 .5912409 275 .5890909 276 .5869565
277 .5848376 278 .5827338 279 .5806451 280 .5785714 281 .5765125 282 .5744681
283 .5724382 284 .5704225 285 .5684211 286 .5664335 287 .5644599 288 .5625
289 .5605536 290 .5586207 291 .556701 292 .5547945 293 .552901 294 .5510204
295 .5491526 296 .5472973 297 .5454546 298 .5436242 299 .541806 300 .54
301 .538206 302 .5364239 303 .5346535 304 .5328947 305 .5311475 306 .5294118
307 .5276873 308 .525974 309 .5242718 310 .5225806 311 .5209003 312 .5192308
313 .5175719 314 .5159236 315 .5142857 316 .5126582 317 .511041 318 .509434
319 .507837 320 .50625 321 .5046729 322 .5031056 323 .501548 324 .5

Such data can, of course, be recomputed for other standards such as 120 or 300 dots per inch.

The essential feature is that at important distances such as two metres, with offsets of 80, 81 or 82 points, there will be about a fortieth of a metre/yard between planes. There are about 39.5 inches to a metre, so we can see that a stereo image on the point standard cannot resolve to better than about an INCH at six feet.

Fortunately, it is possible to SIMULATE positions between the dots. Consider the next image.
Here the lines are not at forty-five degrees. The larger blocks on the right show the action.

When an image can "blend" slowly from one plane to the next, an effect known as "stereo in the round" can be achieved. However, this requires automation. That was the reasoning behind the creation of the MoveR program.

The technical term for this process is ANTI-ALIASING, which is a variant of INTERPOLATION.

Stereo Reconstruction

The process begins by finding a suitable image of the subject and cleaning it up. The author has standardised on keeping the image for the right eye unchanged, and making a copy for the left eye in which pieces are moved right to bring them forward.

This leads at once to the realisation that something must replace those pieces that are moved right. For example, in a woodland scene a tree can be moved right to make it smaller and nearer - but one cannot leave the original in place unless one WANTS a small tree in front of a bigger similar tree.

There is a need to INVENT, therefore, those parts of the image that were not recorded. If a photo is said to be the RIGHT image, one has to invent what a camera WOULD HAVE SEEN if it had been two-and-a-quarter inches (62 to 64 mm) to the left.

Fortunately, with faces, the nose would be seen further to the right and the exposed area would simply be a wider expanse of the hidden cheek.

When working on the stereo reconstruction of a scene with humans and background, the people are best removed from the scene and reinserted after manipulation.

MoveR has a width restriction of 2048 pixels. However, this should be adequate for most purposes.

The first thing to do it to find a suitable image.

This image is then cleaned up, and a copy is kept for the right eye.

A certain amount of "cardboarding" exists in nature - for example, in photos of cardboard! So the tip of the nose and the edge of the ear must be shifted by a dot or two to create this effect. Also, the edges of the spectacles.

Thereafter, we want to stretch the image around a curved surface. So we take Wehner`s QUARTER.COM and a blank 256-shade GREYSCALE bitmap that is exactly 256 by 256 pixels in size (66614 bytes). This must be called 1.BMP. From the DOS prompt, we run QUARTER, and the program will take its inbuilt sine-table and create an image that has a sinusoidal rise in brightness vertically and horizontally.


By turning and pasting, we can turn this by means of image-manipulating software into a 512 by 512 pixel image.

This image in turn can be pulled and stretched until it represents the desired DEPTH of the image. It is a Z-AXIS specification. Without it, MoveR would not know how to manipulate the dots.

The manipulated shaded image is laid on top of a copy of the left-eye image. We have to bear in mind that WHITE means NEAR, and BLACK means FAR.


Then we adjust the brightness of the shaded area, bearing in mind that WHITE means AS NEAR AS POSSIBLE. So the correct distance for Wheatstone`s cheek would be about two thirds of 255, or 170. That is the desired shade of grey at this point..

We continue in this way until we have created a reasonable representation of the depth information:


We should now have a left-eye image that we CONVERT TO 16 MILLION (16,777,216) COLOURS and save as XY.BMP, as well as a 256-SHADE GREYSCALE Z.BMP.

These two files can be put into a directory C:/WEHNER/MOVER together with MOVER.COM.

One can now use WINDOWS to go to MOVER.COM and create a shortcut. This is done by right-clicking on MOVER.COM. When the shortcut is created, one can alter the icon to MOVEICON, MIDICON or BIGICON. It may be necessary to rename the icon - eg. to STEREO.ICO - if it clashes with other icons in the system.

There is just one thing left to do. You have to load Z.BMP, and go to the BOTTOM LEFT-HAND pixel. This has to be redefined as the MAXIMUM EXTENT of the right shift.

For example, you count out colour number 20 from the palette, and insert it in the bottom left-hand pixel. Then you save Z.BMP in this form.

WHY?

Because we want MoveR to interface with Windows. We want the command to be "MOVER", not "MOVER 20". In this way, we do not have to pass the parameter 20, so we do not need to type at the DOS prompt.

Also, if we have overdone or underdone the perspective, we do not have to re-work the whole Z.BMP. We have just one overall parameter to adjust to reduce or increase the stereo depth.

An additional benefit is that the parameter is RECORDED in the Z.BMP file, so the information does not become forgotten.

You can always check that PARAMETER PIXEL by means of the "eye-dropper" control - here shown for parameter 255:


So, because Bill Gates used mathematicians rather than engineers to design the BMP format, the Y-axis has its ORIGIN (Y=0) at the bottom, and the bottom left pixel is the first one encountered in the file.

With XY.BMP (16 million colours) and the same-size Z.BMP (256 grays) together with MOVER.COM in the MOVER directory, you go to the icon and click.

If all goes well, a DOS window should appear, to deliver the messages from the MOVER program. It should say "DONE". You can go to the "X" - top right of the window - and close it. MOVER.BMP should have been made.


MoveR will not overwrite an existing MOVER.BMP, so previous work should be saved under a new name. Then MOVER.BMP can be erased.

It is good practice to use an EXCESSIVE parameter pixel - say, 64, whilst developing the image. It helps you to visualise the roundness of the picture. Then, for the final result, you change to a lower value such as 16. The picture below had a PARAMETER PIXEL of 16.

XY was the LEFT eye image. It has now been turned into MOVER.BMP. You paste the RIGHT eye image on the left, and MOVER.BMP to its right. If all is correct, you finish off - such as by colouring:


This image is suitable for cross-eyed viewing.

The picture was quickly made to test the system. There really ought to be a competition in stereoscopic circles to create the most lifelike resurrection of Sir Charles Wheatstone.

There appear to have been a few shoddy attempts at making an image for each eye prior to Wheatstone. However, his 1838 lecture showed what vast effort he put into the study of visual perception. This was the moment that launched the 3D craze onto an unsuspecting world. He is truly the father of 3D.

For the best results, it is possible to use MOVER to move LEFT as well as right. In this way, the burden of dot-shifting can be divided equally between each image using the same Z-axis file.

You take the RIGHT-eye image and create a MIRROR copy as XY.BMP. You also turn Z.BMP into a mirror-image of itself. The PARAMETER PIXEL will have to be copied from the extreme right to the left.

That parameter will, of course, be HALF of what it would have been with only one image shifted.

After using MoveR, you turn MOVER.BMP into its mirror image.

Here is what happens when the entire sinusoidal shade image, with PARAMETER 144, is used for both a left and a right shift:


You can also use ANNA to create an anaglyph, but the image reverts to black and white.

Images can be saved as GIF or JPEG - the two main systems at the time of writing. GIF will reduce the number of separate colours to 256, but can be opened up and reworked over and over. JPEG will degrade the image - more so when the compression is high. It should be used ONLY ONCE - at the time of completion of the image.

Archive copies of finished images should be kept as BMP. Expanded GIF or JPEG saved as BMP will not do - the information loss CANNOT be reversed by expanding to BMP.

BMP files are BIG - so they should be stored on a Compact Disk (CD).

Here are the hot-links for the ZIP files. Go on the Internet to the WINZIP DOWNLOAD PAGE to install Winzip if you do not have it. Then EXTRACT to a directory such as C:\WEHNER

WINZIP ZIPPED FILE
http://wehner.org/tools/mover.zip

It is even possible to make stereoscopic MOVIES, when one combines binocular GIF with Wehner`s ANIMATE:

WINZIP ZIPPED FILE
http://wehner.org/tools/animate.zip

Go to http://wehner.org/tools/animate to see how to make animations.

Home

(C) 2003 Charles Douglas Wehner.
Use freely but do not plagiarise.