Sunday, April 22, 2007

Extracting the magnitude component of an image Fourier transform

New result!

I finally succeeded in extracting the magnitude component of the image Fourier transform (shown at right).


Recapping the story so far

I previously created a picture of a bird, and a slightly translated version of the same image. I intend to use these images to test ideas about using the Fourier transform to automatically align pairs of images to create aligned stereoscopic pairs.

The input images, show in the previous post, are summarized below:



Original image


Translated version of the original image, for testing my hypothesis.


Fourier transform of original, masked image.


Fourier transform of translated, masked image


I took the plunge and learned to write a filter using the pbmplus environment (see previous post). Here is the program as I wrote and used it for this post:


The new PGM filter I made

I understand that it is tedious to mix GIMP and PBM tools in an image processing pipeline. Perhaps I will port the FFT image processing to PBM later...

What follows next is C language source code I just now wrote for a new image filter in the PBMPlus or NetPBM image processing tool kit:

/* pgm_fourier_recast.c - read a portable graymap produced by the
** GIMP Fourier plug-in, and extract magnitude and phase components
**
** Copyright (C) 2007 by biospud@blogger.com
**
** Permission to use, copy, modify, and distribute this software and its
** documentation for any purpose and without fee is hereby granted, provided
** that the above copyright notice appear in all copies and that both that
** copyright notice and this permission notice appear in supporting
** documentation. This software is provided "as is" without express or
** implied warranty.
*/


/*
** 1) Place source file pgm_fourier_recast.c in directory with working build of netpbm/editor
** 2) Add "pgm_fourier_recast" to list of files in Makefile
** 3) "make pgm_fourier_recast" from netpbm/editor directory
*/


#include <stdio.h>
#include <math.h>
#include "pgm.h"

typedef struct pgm_image_struct {
int height;
int width;
gray maximumValue;
gray** data;
} PgmImage;

PgmImage getInputImage( int argc, char *argv[] );
PgmImage convertFourierToPhaseMagnitude(PgmImage inputImage);
void writeImageAndQuit(PgmImage outputImage);
double gimpFourierPixelToDouble(PgmImage image, int x, int y);
double getNormalizationFactor(PgmImage image, int x, int y);
gray doubleToGimpFourierPixel(double value, PgmImage image, int x, int y);

int main( int argc, char *argv[] )
{
PgmImage inputImage;
PgmImage outputImage;

inputImage = getInputImage(argc, argv);
outputImage = convertFourierToPhaseMagnitude(inputImage);
writeImageAndQuit(outputImage);
}

PgmImage getInputImage( int argc, char *argv[] ) {
const char* const usage = "[pgmfile]";
int argn;
FILE* inputFile;

PgmImage answer;

pgm_init( &argc, argv );

argn = 1;

if ( argn < argc ) {
inputFile = pm_openr( argv[argn] );
++argn;
} else {
inputFile = stdin;
}

if ( argn != argc )
pm_usage( usage );

answer.data = pgm_readpgm(
inputFile,
&answer.width,
&answer.height,
&answer.maximumValue
);

pm_close( inputFile );

return answer;
}

double gimpFourierPixelToDouble(PgmImage image, int x, int y) {
/*
** based on source code at
** http://people.via.ecp.fr/~remi/soft/gimp/gimp_plugin_en.php3
*/


gray pixel = image.data[x][y];

/*
** renormalize
** from (range 0 -> 255)
** to range (-128 -> +127),
*/

double d128 = (double)(pixel) - 128.0; /* double128() */

double bounded = (d128 / 128.0); /* unboost() */
double unboosted0 = 160 * (bounded * bounded); /* unboost() */
double unboosted = d128 > 0 ? unboosted0 : -unboosted0; /* unboost() */

double answer = unboosted / getNormalizationFactor(image, x, y);

return answer;
}

/* Normalization factor that corrects scale of Fourier transform
** pixel based upon distance from origin
*/

double getNormalizationFactor(PgmImage image, int x, int y) {
/*
** based on source code at
** http://people.via.ecp.fr/~remi/soft/gimp/gimp_plugin_en.php3
*/

double cx = (double)abs(x - (image.width + 1)/2 + 1);
double cy = (double)abs(y - (image.height + 1)/2 + 1);
double energy = (sqrt(cx) + sqrt(cy));
return energy*energy;
}

gray doubleToGimpFourierPixel(double value, PgmImage image, int x, int y) {

double normalized = value * getNormalizationFactor(image, x, y);
double bounded = fabs( normalized / 160.0 );
double boosted0 = 128.0 * sqrt (bounded);
double boosted = (value > 0) ? boosted0 : -boosted0;

/*
** renormalize
** from range (-128 -> +127),
** to (range 0 -> 255)
*/

int answer = (int)boosted + 128;
if (answer >= 255) return 255;
if (answer <= 0) return 0;
return answer;
}

PgmImage convertFourierToPhaseMagnitude(PgmImage inputImage) {
PgmImage answer;
int outRows = inputImage.height;
int outCols = inputImage.width;
int row, col;

double realDouble, imaginaryDouble;
double magnitudeDouble, phaseDouble;
gray realPixel, imaginaryPixel;
gray magnitudePixel, phasePixel;

int doUsePhase = 0;

answer.height = outRows;
answer.width = outCols;
answer.maximumValue = inputImage.maximumValue;
answer.data = pgm_allocarray( outCols, outRows );

for ( row = 0; row < outRows; ++row ) {
for ( col = 0; col < outCols; col += 2) {
/* get pixel values from image */
realPixel = inputImage.data[row][col];
imaginaryPixel = inputImage.data[row][col + 1];

/* convert to doubles */
realDouble = gimpFourierPixelToDouble(inputImage, row, col);
imaginaryDouble = gimpFourierPixelToDouble(inputImage, row, col);

/* convert real/imaginary to magnitude/phase */
magnitudeDouble = sqrt(
realDouble * realDouble +
imaginaryDouble * imaginaryDouble
);

/* convert to pixel values */
magnitudePixel = doubleToGimpFourierPixel(
magnitudeDouble,
inputImage, row, col
);

if (doUsePhase) {
phaseDouble = atan2(imaginaryDouble, realDouble);

phasePixel = (int)(256.0 * phaseDouble / (2.0 * 3.14159));
while (phasePixel > 255) phasePixel -= 256;
while (phasePixel < 0) phasePixel += 256;
}

/*
i1 = inputImage.data[row][col];
v = gimpFourierPixelToDouble(inputImage, row, col);
i2 = doubleToGimpFourierPixel(v, inputImage, row, col);
printf("%.3g\t%.3g\t%.3g\t%.3g\n",
realDouble, imaginaryDouble, magnitudeDouble, phaseDouble);
*/


answer.data[row][col] = magnitudePixel;

if (doUsePhase)
answer.data[row][col + 1] = phasePixel;
else
answer.data[row][col + 1] = magnitudePixel;

}
}

return answer;
}

void writeImageAndQuit(PgmImage outputImage) {
/* Write resulting image */
pgm_writepgm(
stdout,
outputImage.data,
outputImage.width,
outputImage.height,
outputImage.maximumValue,
0
);

/* and clean up */
pm_close( stdout );
pgm_freearray(
outputImage.data,
outputImage.height
);

exit( 0 );
}


Original vs. translated images in Fourier magnitude space:

Phew! After writing this filter, I created the following "magnitude only" versions of the test images:


Original: Magnitude component of Fourier transform of original image


Translated: Magnitude component of Fourier transform of translated image

A superficial look suggests that the magnitude component is in fact very similar between the two images. But for automation, I need a quantitative measure to decide how similar two images are. More next time...

Thursday, April 19, 2007

Testing my Fourier transform hypothesis

In the past few posts I have repeatedly assumed that the magnitude component of the Fourier transform of an image will be relatively unchanged when the original image is translated vertically and/or horizontally. My next task should be either prove or disprove this hypothesis before going much further.

Let's start with two gray-scale images that differ only in horizontal alignment for testing. If my intuition is correct, the magnitude portion of the Fourier transform should differ only slightly between the two images.

I downloaded and installed NetPBM, to facilitate command line processing of images. I suspect that it will be easier for me to write new pbm filters than to write GIMP plug-ins.

One infuriating thing about NetPBM is that one of the maintainers has destroyed many of the original man pages in an effort to "simplify" the distribution. I genuinely appreciate this dude taking on the responsibility to maintain the code, but this one horrible documentation decision has caused me to curse out loud many times in the past several years. My feelings are neatly summed up by the observations of another user on the netbsd packaging discussion list:


"...I want the manual as released with the code I'm using, no changes after the fact. Release your manuals, don't blog them. it is *IMPOSSIBLE* for me to get that manual, no matter how many hoops I jump through, because you cannot (as they suggest) 'wget' an old version of the manual, one which still has manual pages instead of links to other non-Netpbm projects featured on the top page, one which has actual documentation for pnmscale rather than a three-page rant about why I should switch to Netpam..."


Hear hear.

In any case, here is a visual overview of the experiment set-up:



Original image

One thing I will need is a method to compare how similar two images are. As a control, I will be comparing the original image to itself.



Translated version of the original image, for testing my hypothesis.

If I am right about the Fourier transform, the magnitudes of the Fourier transform will be almost the same between the original image and the translated one. This will simulate the comparison of stereo pairs that do not perfectly line up.




Gray version of the translated image

To simplify the analysis, I created a gray-scale version of the images, so the issue of the color channels does not complicate the analysis.




The mask I used to "remove" the edges of the images

Recall from my earlier posting that the blurry circle mask is used to reduce edge artifacts in the Fourier transform.




Apply circle mask to untranslated image


Masked version of translated image

Finally, create the two Fourier transforms, one for the untranslated image and one for the translated image:


Fourier transform of original, masked image.


Fourier transform of translated, masked image

Next I need to extract the magnitudes of the Fourier transforms and compute the similarities between the images. I have some ideas of how to do this, but it will require more work. I expect that the PBM tools will come in handy here. More next time...

Sunday, April 15, 2007

Investigating the GIMP Fourier transform

In my previous post I began to work up how we might use the Fourier transform to help align two images that form a 3D stereoscopic image pair.

A more detailed investigation reveals that we need to ask a few more questions.

I sort of understand what the Fourier transform means for scalar data. But in an image, there are three different channels of color information, usually decomposed in one of two ways.

Two different representations of three-dimensional color data in an image pixel:
  1. red, green, and blue (RGB), or alternatively as
  2. hue, saturation, and brightness. (HSV)
For any ONE of these channels (e.g. "red"), I can kind of understand what the Fourier transform is. The transform for any single channel should result in a complex number in each pixel of the transform. Complex numbers have two components. These two components of a complex number can be represented in at least two different ways.

Two different representations of a two dimensional complex number:
  1. Real component and Imaginary component
  2. Magnitude and phase


Two ways of representing a complex number: magnitude/phase and real/imaginary

The bottom line here is that is seems to me that the Fourier transform should have twice as much data as the original image, since the Fourier transform takes regular real numbers, and generates complex numbers. So a regular 3-channel image should create a Fourier transform with 6 channels. So what exactly is in the Fourier transform generated by the GIMP plug-in?

Unfortunately the documentation for the plug-in is in French, and I have not studied French since the mid-1970s.

Understanding how the transform data are represented is especially important at this point for two reasons:
  1. The whole trick of using the Fourier transform to ignore the horizontal/vertical translation component requires that we use only the magnitude of the complex numbers (which does not depend upon the image translation), and ignore the phase component (which depends exquisitely upon the image translation).
  2. Where are the six channels of data that should be coming from the Fourier transform?
So we need to determine whether the complex Fourier transform is stored as real/imaginary components, or if it is stored as magnitude/phase components. More fundamentally, we need to know how six channels of information are being stored in the seemingly 3 or 4 channeled image data (transparency can provide an additional channel).

I did some experimentation and determined that the red channel of the Fourier transform corresponds to the red channel of the original image, etc. Excellent.

Further, the French documentation is surprisingly intelligible when filtered through AltaVista babelfish. I still don't quite understand all of the details, but it appears that the complex values are stored in pairs of subsequent pixels, representing the logarithm of the real component, followed by the logarithm of the imaginary component. This is bad news. I want the magnitude of the complex number, which is equal to the square root of the sum of the squares of the real and imaginary components (using Pythagoras' theorem). It will be hairy to extract that information. So I need to either a) find another Fourier transform image filter, b) write a GIMP plug-in that further processes these Fourier transform images, c) think of some other trick, or d) abandon this project.

By the way, if you read the English translation of the French documentation, there is a good explanation of why, near the end of the article, he compares his simulated image to a "moose". It turns out that the French word for "moose" is "orignal", while the French word for "original" is "original". The author made a typo, misspelling "original" to accidentally type another actual French word. Thus his spell-checker did not catch it. I believe he meant to say that the simulated image resembles the original image, not that it resembles a moose. Or not. Who knows?

I will cogitate some more on what to do next. More next time...

Use of Fourier transform in aligning stereoscopic image pairs

In my previous post, I wondered how to begin to determine parameters for aligning two images, when no other parameters have yet been determined.

One concept that can help is the Fourier transform. The Fourier transform can be used to eliminate the vertical and horizontal alignment components from the analysis. Thus we should be able to determine certain parameters, such as scale and rotation, without having to first solve the vertical and horizontal alignment problem.

The GIMP image tool has a plug-in that permits computation of the Fourier transform of an image. (Presumably Photoshop has a similar tool).


Left bird image
The unmodified left-eye view from yesterday


Fourier transform of left eye bird imageFourier transform of the same bird image, as generated by the GIMP plug in.

Believe it or not, the Fourier transform contains all of the information necessary to reconstruct the original image.

It is difficult for the human eye to make sense of the Fourier transform image. The two largest features are a big vertical stripe down the middle, and a horizontal stripe across the center. Unfortunately, these features are a BAD thing. They show that the Fourier transform is dominated by something I don't care about.

What features of the original image have strong horizontal and vertical components, causing the primary features of the Fourier transform? This is perhaps a subtle point: the edges of the image cause these features. This is a problem. If we want to use the Fourier transform to detect the relative rotation between two images, we cannot have the edges of the image dominating the Fourier transform. The vertical and horizontal edges of the images will be used to form the rotational alignment, and no rotation will occur.

The solution is to remove the edges of the image before taking the Fourier transform. But how do you remove the edges of an image? Like this:

Bird image with "edges removed"


I created a circular mask for the imtage, so that it would be radially symmetric, thus minimizing image shape artifacts in lining up the relative rotation of two images. Further, I made the mask a blurry circle, figuring that a blurry edge would have more localized effects on only the low-resolution region of the Fourier transform. The new Fourier transform of the "edge-removed" version of the bird is much smoother:


Fourier transform of edge-removed bird image

It now becomes clear that many of the other primary features of that initial Fourier transform were also "ringing" artifacts related to the edge effect. To sum up the results so far:
  1. The Fourier transform looks like it might theoretically be a useful tool for determining the scale and/or rotation relationship between two images, without needing to first determine the translational components.
  2. If we end up using the Fourier transform in this way, we should include a pre-processing step in which we make a blurry-edged circular version of the two images to be compared.
This is a small amount of progress, but I feel it will probably pay off. More next time...



Toward automatic alignment of stereoscopic image pairs

When aligning the two images of a stereoscopic pair, we wish to determine the following parameters:
  1. Scale: The relative scale between the two images. Usually close to 1.0, but might vary if two cameras were used with slightly different zoom or distance.
  2. Rotation: There may be a small relative rotation between the two images, either clockwise or counterclockwise. This can be tedious to determine manually.
  3. Eye axis: The direction relating the left eye to the right eye is usually left to right, but might be off by a small angle. For various special ad hoc stereoscopic techniques, such as 3D photos of the moon, determining this direction is very important. It is tedious and imprecise to determine this axis manually. Most folks just assume that the eye axis is perfectly horizontal and move on.
  4. Translation: Alignment in the left/right direction and in the up/down direction.
    • Up/down: There is a single clear value for the correct alignment in the up/down direction, perpendicular to the eye axis. This value can be determined manually, but should be amenable to automatic determination as well.
    • Left/right: Alignment along the eye-axis varies from pixel to pixel depending upon the depth of the subject. This is how 3D photos work. Determining left/right alignment may be the hardest part to automate.
  5. Brightness and color balance: Especially when the two images are taken with two cameras, as in my set-up, the two images may differ in brightness and color balance. These differences should be corrected before generating a final stereo pair.
How can you determine any of these relationships between two images when you don't know the values of the other parameters? This can be a tricky problem. And it probably requires some tricky solutions.


Left bird imageRight bird image
The images above are a typical example of a raw stereoscopic pair. The two images obviously differ in color balance, vertical alignment, and horizontal alignment.

I will attempt to attack the problem of determining each parameter in turn, in subsequent posts.

Saturday, April 07, 2007

Hummingbird with tongue hanging out

Juvenile male Anna's hummingbird (Calypte anna) tasting the air

Just now I got a nice photo of a hummingbird sticking his tongue out (click bird for larger image). Notice the fine silvery tongue extending beyond the tip of the beak. This photo represents about the limit of image resolution I will be able to acheive with my current optical set-up. I am pretty happy with this resolution. Unfortunately, in this particular shot the companion camera image was out of focus, so there will be no stereoscopic version of this tongue shot forthcoming. (Not that I have yet created any 3D photos good enough to post!)

Today's shoot was my first success at getting decent photos using mirrors. Previously my mirror photos were too blurry and displayed second reflection artifacts. Today I used first surface mirrors mounted more securely. That seems to have done the trick! Now perhaps I will be able to get stereoscopic photos with a smaller interpupilary separation. With today's mirror setup, the separation is about 50 mm, which is still sort of big at this 400 mm distance. I don't know how I can get it smaller though.

Wednesday, April 04, 2007

What a coincidence! Here's one with a full purple head now!

Deep magenta throat and crown of male Anna's hummingbird (Calypte anna)

(click bird for larger image)

Yesterday I said that the male Anna's hummingbird can have a completely magenta head. On cue, my charming bride captured this image of a male in full display. I guess the male in the earlier pictures is either a hybrid species, a juvenile, or just a mutant. Perhaps it helps that the sky was overcast today.

Tuesday, April 03, 2007

Male Anna's hummingbird at even higher resolution.

Male Anna's Hummingbird (Calypte anna) in repose at feeder

My beautiful wife captured our best hummingbird pictures yet this morning (click bird for higher resolution view). Notice the fine detail in the feathers. This male Anna's hummingbird, like many male hummingbirds, has a bright red neck when viewed from certain angles. I am uncertain whether this depends upon the orientation of the feathers, the orientation of the sun, the orientation of the person viewing, or some combination of those three. In any case, the geometry of this bird was right to show the red throat. From other angles, the throat of the male appears dark or black. (The throat of the female is much paler. See some of our previous photos in older posts).

This species, Anna's hummingbird (Calypte anna), is the only hummingbird species in which the crown (top of the head) of the male can also appear crimson (in addition to the throat). If you look carefully at the photo above, you can see a few reddish feathers on the head. Google image search for "Anna's Hummingbird" and you will find many images of male birds in which the entire head glows with a brilliant magenta color. You have to view the bird from just the right angle to get that effect.

On the lower left of this bird's throat is a region that is yellow-green, almost the exact complementary (opposite) color to the red-magenta seen on the rest of the throat. I suspect that the complementary color viewed from a different angle is no coincidence. It reminds me of the cytological stain eosin, which is colored red-magenta when you view light through the solution, but is yellow-olive when you view light reflected off of the solution's surface. Eosin is one of the important stains used in Pap smears, and many other important microscopic tissue staining methods.

Monday, April 02, 2007

Today's hummingbird pictures

What is that yellow material on the male hummingbird's beak? Pollen?


Notice the fluffy feathers on this male hummingbird's underside

Saturday, March 24, 2007

First clear Danio photo


I just took this picture of a Danio (zebrafish) in our fish tank. I used a flash, so I had to take the picture from an angle so that I didn't just take a picture of the reflection of the flash. As with the hummingbird pictures, I took this with a two camera set up, so that I can create stereoscopic pictures. Once I get better at composing the stereo pairs, I will start posting 3D pictures. It is possible that I will make 3D versions of these same pictures that I am posting now.

Sunday, March 18, 2007

New hummingbird pictures.


We started filling our hummingbird feeder about two weeks ago. I think we already have a nesting pair settling down nearby. I got some nice pictures this morning when the sun was shining on the feeder. Shown here is a female.

Wednesday, August 02, 2006

Selenastrum capricornutum algae in our aquarium

SelenastrumWe started a ten gallon fish tank in our apartment four weeks ago.

For the first three weeks, our aquarium went through the standard series of nitrogen compound crises that a new tank experiences before it is "cycled", as the fish tank enthusiasts say. During those three weeks, our tank water was crystal clear.

About one week ago, our nitrite levels fell abruptly to zero, indicating that our "biological filter" was now colonized by all of the bacteria needed to complete the nitrogen cycle. As soon as the nitrite levels fell, algae began to grow. The water in our tank is quite green.

I placed a drop of our tank water on a microscope slide and viewed the contents at 150X with an inexpensive microscope I obtained in the 1970s. There I found green U-shaped algae with pointy ends. After a bit of google image searching, I conclude that the species of algae is Selenastrum capricornutum, or Selenastrum gracile.

It's fun to identify the organisms in your home. I recommend it.

Other species I have identified in my home:
  1. Homo sapiens notsosapiensis
  2. Danio rerio (zebra danios)
  3. Palaemonetes kadakensis (ghost shrimp)

Monday, April 03, 2006

Const correctness and duck typing

I am a big fan of "const correctness" when programming in C++. It permits me to be a lazier programmer, but this is a good thing. It permits me to be a lazier programmer in the same way that these other language features do:
  • Using local variables instead of global variables
  • Using formal loop constructs like "for", "while", and "do", instead of "GOTO"
  • Using iterators instead of looping with "for", "while", and "do"
  • Program to interfaces instead of implementations
It is possible to write robust computer programs using only global variables, while branching using only GOTO statements. It simply requires more discipline on the part of the programmer. I am grateful that modern languages have features that permit me to be less disciplined while still writing maintainable code. The application of "const correctness" is one such language feature that make programs easier to write and maintain. I am amazed that it does not appear in other languages that I use, such as Java and Ruby.

Sometimes Java and Ruby fanboys who do not understand what const-correctness is will assert that one can get the effect of the const keyword with "final" in Java or "freeze" in Ruby. That is utter nonsense.

On the other hand, it is possible to get some of the const effect in Java by creating separate "ConstInterfaces" for each class. Unfortunately, such interfaces do not already exist for the standard library, and I believe that it is not possible to retroactively declare existing classes to conform to a particular Interface, even if they (syntactically) already do conform. The only alternative is to create derived wrapper classes for each standard class, explicitly declaring ConstInterfaces. Even this Herculean approach will fail with the many "final" classes in the standard library. In keeping with the general ultra-wordiness of Java, the reams of additional source files and lines of code required to emulate const-correctness in Java make this approach essentially extinct in the wild.

Ruby fanboys make a big deal about "duck typing", which is a fancy way of describing a lack of static typing. Static typing means that something about the type of each variable can be determined in the local source code context. "Duck typing" is more flexible than static typing in the same way that GOTO statements are more flexible than formal loops. The one big advantage of lack-of-static-typing is that it permits languages like PERL and Ruby to have essentially zero compile time. I love the possibilities that zero-compile-time languages create. But please do not overextend this tradeoff and pretend that "we meant to do that" and that "duck typing" is somehow a desirable language feature. Put the kool aid down.

Monday, March 06, 2006

Eclipse IDE not updating to the latest version?

I just discovered that my Eclipse programming environment has not been updating itself to the latest version. I have been stuck at Eclipse version 3.1.0 for the past year. This is apparently due to a URL bug in the 3.1.0 release of Eclipse. See Ed Burnette's site for details.

Ed Burnette's view from the asylum: Eclipse updates still lag behind

(In short, add the site http://update.eclipse.org/updates/3.1 to your list of update sites under Help->Software Updates->Manage Configuration->Scan for Updates->Search for new features to install->New Remote Site...)

I discovered this problem when trying to create two editor windows for one source file. In Eclipse 3.1.0 editing two parts of the same file at the same time is not possible. In 3.1.2, select "New Editor" from the Window menu to create a second Editor pane with the same file you are currently editing. I am amazed that Eclipse lasted this long without such a feature designed into the original implementation.

Wednesday, March 01, 2006

Unconventional telemarketing tactics : latest telephone harrassment

Last night I got a strange phone call. At about 7:45 pm PST Tuesday Feb 28, 2006 I was having supper with my wife when the phone rang. I suspect the caller was a telemarketer. You be the judge:



Me: *picks up phone* Hello? *start counting seconds until response*

Troubled gentleman: *five second pause* *click* Hello?

Me: Why did you take so long to answer?

Troubled gentleman: Why did it take YOU so long to answer? It must have taken five or six rings for you to pick up the phone! Like I have time for this shit!

Me: Who is this?

Troubled gentleman: You are being childish, sir. *click*



It is difficult to figure out what his goal was from this short conversation. It is especially interesting that his final word was "sir". I guess some of his training must have sunk in...

It is hard for me not to feel agitated after an attack like this. Even though its importance is so small. I understand that there is no point in seething after such a random encounter, but I cannot help but obsess a little over it. But don't worry about me. I have moved on now.

Friday, February 24, 2006

SBC still owes me ten dollars

But that is not the worst of it. Not by a long shot. Agents of SBC are continuing their mission to make my life miserable.

Today, February 24, 2006, at 8:55 am, a well labeled SBC truck with license number California 5Y78601 illegally went straight from the right turn lane at Arastradero and Miranda streets in Los Altos, California, to get onto Foothill expressway. To his left was a bicyclist in the bike lane who also wanted to get onto Foothill. The retarded SBC guy made this very dangerous for the bicyclist. And also for those of us trying to legally enter Foothill from the correct lane.

I wouldn't bring this up were it not just one more episode of what must be a systematic effort by SBC to drive me insane with their obnoxious behavior. Remind me to post my essay on the horrible ordeal of trying to get DSL installed from SBC.

Friday, February 03, 2006

Getting a good "Leaf" staff in Diablo II

In the computer game Diablo II, a sorceress who specializes in the skill "enchant" is a useful support character. One of the best items for an enchant sorceress is a staff with the runeword "Leaf". You can get one by shopping at the Act II normal vendor Drognan. "Leaf" uses the runes "Tir Ral", so you need a 2 socket staff. And you want bonuses to the skill Enchant to be present on the staff.

What follows are the details of how I shop for such a staff.

You will not have to read (much) during your repeated trips to the shop. Most of the visual scanning required consists of "is it a staff?", "is it red?", and "does it have 2 circles on it?". This relieves some of the tedium of repeated shopping.
  1. Create or join a normal difficulty game, using a character that has reached Act 2, but which is no higher than level 17.
  2. Make sure that no other players are in the Act 2 town area. Otherwise you will be unable to reset the shop contents.
  3. Make sure that Drognan's shop is next to a gate to the rocky waste. This will make shopping much faster.
  4. Having faster run/walk is helpful here. Make sure you are always running (use the "R" key to toggle).
  5. Open Drognan's shop window.
  6. In each of the two "weapons" tabs, mouse over each staff that has a red background. Because Enchant is a level 18 skill, and your shopper is level 17 or lower, every staff that has the Enchant skill must be red, indicating that it is above your current level.
  7. As you mouse over each red staff, look for ones that have exactly two sockets. A staff must have exactly two sockets to hold the Leaf rune word.
  8. If no staves are both red and have two sockets, skip ahead to the "close shop window" step. None of the staves in the shop are the one you are looking for.
  9. Ignore staves with a blue name (magic). The name must be grey for the staff to hold a rune word.
  10. If the staff has "+3 Enchant" (and grey name and two sockets), this is exactly the staff you are looking for! Buy it and rejoice. Your shopping task is done.
  11. In the meantime, you may want to buy 2-socket staves with only +1 or +2 to enchant, in case you get too bored with the repeated shopping.
  12. Close the shop window.
  13. Run a short distance into the Rocky Waste, and then run back to Drognan. The shop contents will have magically reset.
  14. Go back to step 5 (open shop window), and repeat the process until you have a 2-socketed +3 enchant grey-named staff.
I have gotten about 5 leaf staves this way. You can usually get one in less than an hour if you don't waste time.

You won't be able to use the enchant skill on the staff until your character is level 18. You won't be able to use the Leaf rune word until you are level 19. So wait until you are level 19 before adding the runes. This way you will be able to use the +3 to the enchant skill while your character is level 18.

It is not possible to get a white or grey-named staff with both Enchant and Fire Mastery skills on it from a town vendor. Such a staff can only be found in normal gameplay and is extremely valuable. Keep your eyes open for a staff with these characteristics:
  1. Enchant plus Fire Mastery bonuses combined are +4 or more. (e.g. +2 Enchant, +2 Fire Mastery)
  2. Staff has exactly zero, two, or four sockets. (for Leaf or Memory rune words)
  3. Staff name is white or grey (i.e. non-magical)

Thursday, February 02, 2006

Gmail is a terrible pop server

I have put my trust in Google and forwarded most of my mail accounts to my gmail account. As part of this I wanted to use gmail as my focus of mail reading.

But I want to be able to read and compose email offline on my laptop, so I want to use a rich email client. And I want to use multiple clients on multiple computers. Gmail's feeble support for the POP protocol makes this difficult.

Here are the problems:

Gmail wants you to never delete your old mail. This is part of their "new way" of handling e-mail, and I can understand the justification. Unfortunately many POP email clients are usually configured to delete old messages from the POP server after they are downloaded. Perhaps reasonably, Gmail has decided to ignore this aspect of the POP protocol, so your messages on the Gmail server are not deleted by your POP email client. So far this is all justifiable. Somehow this has led Gmail to ignore other POP functionality in annoyingly useless ways.

I like to read my email from multiple computers, each with a current and complete archive of my mails. Using decent and reasonable POP servers such as that provided by Comcast or other large ISPs, each client is able to sychronize with the POP server, downloading only those emails which that particular client has not yet seen before. This makes me happy.

When I tried to get this same behavior from Gmail's POP server I could not. My choices seem to be as follows:

1) Each client can download every mail I have ever received at gmail at one time, including duplicates of any messages I got on that client before. This results in multiple copies of every email. This is so far beyond unacceptable that I will not discuss this further.

2) Each client can download only those messages newer than those last downloaded by ANY email client of mine. This process puts distinct subsets of my email on each client, depending upon when I connect with each one. This too sucks very very very badly.

Solution:



Use a real POP server. I created another special purpose email account at Comcast. The purpose of this account is to provide a decent POP interface to Gmail. I never use this special account to send, nor to directly receive any mails. A copy of every mail that comes to my gmail account is forwarded to this special comcast mail account. My email clients now sync with the special comcast email account and all is joy and happiness.

Monday, December 26, 2005

Rune rushing in Diablo II Lord of Destruction

Using Classic mode to accelerate Hellforge rune farming

What follows is a set of instructions for accumulating runes in the online game Diablo II: Lord of Destruction. Certain runes are the rarest and most valuable items in the game. This guide gives step by step instructions for gathering runes by repeatedly creating characters and performing the hellforge quest in each of three difficulties for each character.

Definitions:

  • "Rusher" - a character powerful enough to quickly clear areas and kill bosses
  • "Rushee" - a character created for the sole purpose of snagging their hellforge treasure
  • "New Rushee" - a rushee that has not completed the Andariel quest
  • "Andariel Rushee" - a rushee that has completed the Andariel quest, but no Act 2 quests
  • "Amulet Rushee" - a rushee that has completed the Viper Amulet quest, but has not completed the Summoner quest
  • "Summoner Rushee" - a rushee that has completed the Summoner Quest, but has not completed the Duriel quest
  • "Duriel Mule" - a character that has touched the Summoner's book, and inserted the staff into the orifice, but done no other Act 2 quest activities.
  • "N" - the number of computers available for the rushing operation

General Rules

  1. The rush steps repeat for each difficulty (Normal, Nightmare, Hell) (except that the Classic Hell rush phase ends at the beginning of Hell Act 3)
  2. A rushee who completes one difficulty becomes a "New" rushee for the next difficulty
  3. A rush through one difficulty requires one (1) Summoner Rushee, one (1) Duriel Mule, and (N-2) Andariel Rushees. (if these rushees already exist, proceed directly to DURIEL TO END instructions. Otherwise, create the necessary rushees using the recipes below
  4. Maggot lair only needs to be completed once per difficulty
  5. Viper amulet quest only needs to be completed once per difficulty for every N3 - 2N2 + N rushees (80 rushees for N=5)
  6. Summoner quest only needs to be completed once per difficulty for every N2 - 2N + 1 rushees (16 rushees for N=5)
  7. Most other required quests are run once per difficulty for every N-1 rushees
  8. Instructions for a second simultaneous rusher (Rusher B) are given in parentheses
  9. If a rushee dies in a quest area, remain dead (i.e. don't hit escape) until the quest is completed. You will get credit for the quest.


CREATING NEW RUSHEES

  • For Normal difficulty, select "create new character" from the character screen.
    • create 1 at a time
    • UNCHECK expansion (required)
    • UNCHECK hardcore (if option is present) (optional, be consistent)
    • CHECK ladder (optional, be consistent)

  • For Nightmare and Hell difficulties, complete the previous difficulties
    • (create (N - 1) rushees at at time)


CREATING ANDARIEL RUSHEES

  • requires N-1 New rushees
  • creates N-1 Andariel rushees at a time

Rush steps:

Act 1:
  1. Primary rushee (New) creates new game
  2. Rusher enters game
  3. Rusher fills up on town portals
  4. Rusher saves screen shots of maps of paths from Cat2 to Cat3, and from Cat3 to Cat4
  5. Rusher finds Catacombs level 4, and clears first two rooms
  6. Rusher creates town portal to first room of Catacombs 4
  7. Primary rushee waits in upper left corner of first room of Catacombs 4
  8. N-2 additional New rushees enter game and join party
  9. Make sure all rushees are in the game and in the party
  10. Rusher kills Andariel
  11. Primary rushee makes sure he got the quest before returning to town
  12. Rushees each talk to Warriv and go to Act 2
  13. All N-1 rushees in the game have now been converted from "New" to "Andariel"


CREATING AMULET RUSHEES

Act 2:
  1. Game created by Duriel Mule, or by New or Andariel rushee
  2. One primary Andariel rushee enters the game
  3. Ensure that rusher and rushee both have full town portal tomes
  4. Rusher creates town portal to Lost City [not needed?]
  5. Primary rushee goes to lost city, causing darkness [not needed?]
  6. Rusher saves screen shot of path from Lost City WP to Valley of the snakes
  7. Rusher finds the Claw Viper Temple level 2, and kills all of the monsters there
  8. (Rusher B finds summoner)
  9. Rusher makes a portal to the Claw Viper Temple level 2
  10. Primary rushee enters portal and makes a portal to Claw Viper Temple level 2
  11. All rushers leaves game
  12. N-1 additional Andariel rushees join game and join party
  13. Primary rushee gets viper amulet. Do not leave the Altar Room until the Altar animation finishes. Otherwise the quest might be botched.
  14. If a Duriel Mule needs to be created for this difficulty, save the amulet.
  15. All rushees talk to Drognan
  16. Verify that all rushees have the amulet quest
  17. All N rushees have now become Amulet rushees


CREATING SUMMONER RUSHEES

  1. Game created by Duriel Mule, or by New, Andariel, or Amulet rushee
  2. Primary Amulet rushee enters game
  3. Rusher enters game
  4. Rusher finds summoner platform in Arcane Sanctuary (but does not kill Summoner yet)
  5. (Rusher B finds Mephisto)
  6. Rusher creates town portal to area near summoner (about 1.5 screens away)
  7. Rushee enters portal, and remains just out of range of the summoner
  8. (Rusher B leaves game)
  9. N-2 additional Andariel rushees enter game and join party
  10. Rusher kills summoner
  11. Rusher creates town portal to Canyon of the Magi
  12. Rusher saves screen shot of Arcane Sanctuary waypoint, with map positioned to show summoner location.
  13. All rushees talk to Cain
  14. All rushees verify that they can take the portal to the Canyon of the Magi waypoint.
  15. All N-1 rushees have now become Summoner rushees


CREATING DURIEL MULE

  • Requires 1 Amulet rushee WITH AMULET, and one Andariel rushee
  • Creates one Duriel Mule (from Andariel rushee)
  • One Duriel Mule can be used ever after, for one difficulty level
  • (Amulet rushee is only needed as a source of the amulet, the staff, and the tomb location)
  1. Amulet rushee creates game
  2. Rusher enters game
  3. Make sure both have full town portals
  4. Andariel rushee DOES NOT ENTER GAME YET!
  5. Rusher clears chest area of Maggot Lair level 3 (this is the only time that Maggot Lair must be completed).
  6. Rusher creates town portal to Maggot 3
  7. Amulet rushee gets staff from Maggot 3
  8. Rusher clears walking path from palace in Lut Golein to the summoner
  9. Rusher kills the summoner, but does not touch the book
  10. Andariel rushee enters game (but does not party with the others)
  11. Everyone avoids talking to townspeople and any other quest triggers while this character is in game.
  12. Andariel rushee walks to the summoner area, and touches the book
  13. Andariel rushee enters canyon of the magi and gets waypoint
  14. Note symbol of true tomb
  15. Andariel rushee leaves the game
  16. Rusher clears walking path from canyon to orifice in the true tomb
  17. Andariel rushee enters the game (but does not party with the others)
  18. Everyone avoids talking to townspeople and any other quest triggers while this character is in game.
  19. Andariel rushee walks from the Canyon of the Magi to the orifice
  20. Amulet rushee gives cube, amulet, and staff to Andariel rushee
  21. Andariel rushee transmutes staff
  22. Andariel rushee places staff into orifice
  23. Andariel rushee returns cube to rightful owner
  24. Andariel rushee leaves game
  25. Andariel rushee has become a duriel mule for this difficulty. Only one is needed per difficulty
  26. Duriel Mule must never get more quests in Act2, just create games and leave as soon as possible

DURIEL TO DIABLO INSTRUCTIONS

  • Requires 1 duriel mule, 1 Summoner rushee, and N-2 or N-1 Andariel rushees
  • N-1 rushees complete this difficulty.
Act 2:
  • N rushees can complete Act 2 in one pass, compared to N-1 rushees for most other acts.
  1. "Duriel Mule" creates new game
  2. Rusher enters game
  3. Duriel Mule leaves game
  4. Summoner rushee enters game, and identifies true tomb symbol. If symbol does not show in the quest log, talk to Cain and visit the Canyon of the Magi waypoint.
  5. If Jerhyn cannot be seen in town, send everyone back to Act 1 temporarily to reset the Act 2 town. Jerhyn must be available in town.

  6. Arrangement of tomb symbols in the Canyon of the Magi
  7. Rusher finds Tal Rasha's chamber (bear left in the chamber)
  8. Rusher saves screen shot of path from stairs to orifice
  9. (Rusher B clears area near Travincal temple, but does not kill all council members)


  10. (Rusher B clears beginning and right side of Durance of Hate level 3)
  11. (bear left in Durance level 2)
  12. (Rusher B creates town portal near stairs in Durance level 3)
  13. (Rusher B clears seals in Chaos Sanctuary)
  14. Summoner rushee waits in orifice room
  15. Rusher kills Duriel
  16. Rusher(s) leave game.
  17. N-1 Andariel rushees enter game and join party.
  18. (Even though the quest log says that you cannot complete the quest, you actually can.)
  19. Summoner rushee walks through chamber and talks to Tyrael.
  20. Each rushee talks to Jerhyn, then Meshif, and goes to Act 3
  21. N Rushees have now completed Act 2
  22. If this is HELL difficulty, STOP here, and go to EXPANSION instructions

Act 3:
  1. Rusher clears area near Blackened temple, but does not kill Council members
  2. Primary rushee stands near Blackened temple
  3. Make sure N-1 rushees are in the game and in the party
  4. Rusher kills high council
  5. All Rushees pick up their Horadric Cubes near the dead council, if they need one.
  6. All Rushees talk to Cain
  7. Rusher saves screen shot of path from Durance 2 WP to Durance 3
  8. Primary rushee waits by stairs in Durance 3
  9. Make sure N-1 rushees are in the game and in the party
  10. Rusher A kills Mephisto
  11. Rusher A creates town portal near red portal
  12. Each rushee goes to Act 4 through red portal
Act 4:

  1. Rushers clear all seals in Chaos Sanctuary (except one cold one)


  2. Primary rushee enters the safe nook

  3. Make sure N-1 rushees are in the game and in the party
  4. Rusher A pops the final seal and quickly returns to the Diablo area
  5. Rusher A kills Diablo, avoiding wandering too far from spawning spot.
  6. All rushees move to next difficulty, where they are now "NEW"


EXPANSION INSTRUCTIONS

  • After completing Hell Act 2 and entering Hell Act 3 in Classic mode, convert rushees to Expansion
  • Bring the Expansion rushees from Act 3 Hell to the begining of Act 4 Hell, using same rushing methods described for Classic
EXPANSION HELLFORGE
  • Requires one expansion rushee in Act 4 Hell difficulty
  • Make one game per rushee
  1. Rushee creates game
  2. Rusher kills monsters in region of hellforge
  3. Rusher creates portal to hellforge
  4. Make sure rushee is not partied with anyone who needs the hellforge quest.
  5. Rushee collects hammer and smashes soulstone
  6. Store runes and gems in a safe place
  7. Complete hellforge quest in both Hell and Nightmare difficulty
  8. Complete Shenk/socket quest in both normal and Nightmare difficulty
  9. Save socket quests for a special occasion
Possible hellforge runes by difficulty. There is an equal chance (1/11) of each listed rune dropping at each hellforge quest.
  • Normal: El, Eld, Tir, Nef, Eth, Ith, Tal, Ral, Ort, Thul, Amn
  • Nightmare: Sol, Shael, Dol, Hel, Io, Lum, Ko, Fal, Lem, Pul, Um
  • Hell: Hel, Io, Lum, Ko, Fal, Lem, Pul, Um, Mal, Ist, Gul
Runes that cannot be obtained from hellforge rune drop: Vex, Ohm, Lo, Sur, Ber, Jah, Cham, Zod. It would take 256 Gul runes (and some gems) to cube up one Zod rune.

Saturday, December 24, 2005

Raxco t-shirt charlatanism

This rant is reawakened from the early 1990s. Back in about 1991 one of my responsibilities was the maintanance of some Digital Equipment Corporation VAX workstations, running the operating system VMS. One fringe benefit of this activity was a free subscription to a publication called DEC Professional. One frequent advertiser in DEC Professional was a company called Raxco. Raxco placed one ad that they later regretted. The ad copy proclaimed that simply by filling out and returning a card requesting more information about some of their products, you could get a free t-shirt. This t-shirt featured a cartoon by Don Martin, best know for his work at Mad Magazine.

The cartoon is captioned "Fragmentation happens", and features a Don Martin version of a computer engineer with computer parts flying about with sound effects like "Kloon", "Ping", "PA-Tween" and "Sproing".

I filled out the card and waited for my t-shirt. This was now about fourteen years ago. One of Raxco's representatives informed me that the response to the ad had been larger than anticipated, so I might need to wait longer before getting my shirt. I have now waited fourteen years.

Later I got another business reply card with which I could request product information from Raxco. This time, no shirt was offered. But there was some additional white-space below the check box options on the card. Being careful not to mark any of the preprinted check boxes, I wrote in a new one of my own. It simply said "Where is my t-shirt, you deceitful charlatans?" I placed a large check mark in the box I had created next to this question and dropped the card in the mail. All I received in response to this was some product information that I had not asked for.

Why am I bringing this up now? My loving wife found an image of the aforementioned t-shirt and made me a t-shirt using special iron-on paper for inkjet printers. Is this copyright infringement? Perhaps. I would so love to have someone from Raxco try to take the moral high ground on this one. They still owe me a t-shirt. After fourteen years, the interest should run to at least two t-shirts by now.

Where is my shirt Raxco? I am still waiting. Jerks.

And thank you honey for the beautiful t-shirt. I have wanted something like this for so long.