Omnidirectional Fleas -- The O'Flea

(As in a classic Irish name, or the movie, "Oh Brother, Where Art Thou".)

A note on generalizing fleas. By Bob Futrelle 11/21/2001.

Return to SVP homepage


Summary: Generalizing the horizontal flea that Dan and I have designed, seemed like a formidable task, but it isn't. (To be precise, I did a lot of the design and Dan has done all the implementation.) The idea is simply to make an "omnidirectional flea" that can take a step in any direction. Its direction in any step will be required to be almost identical to its direction in the immediately preceding step(s) so it will only follow straight lines, or follow gently curving lines. This would prevent it, for now, from following the perimeter of something with a very small radius of curvature such as the perimeter of the letter 'O'. To deal with the slope issue, we will not represent the local direction by a slope, but simply by some delx and dely values, so that a delx of zero would represent a conventionally parameterized line of infinite slope.

(Note: We'll probably just end up calling this a "Flea" in the long run, with the horizontal one being chalked up to initial experience, and that's what I'll call it here, just a flea. Heck, real fleas are omnidirectional; what creature isn't?)

A flea step will be a pair of real values, delx and dely, in pixels units, e.g., delx = 0.0 and dely = 2.0 for a vertical line. A straight line segment at right angles to the step forms the "leading edge" of the of the flea. From any given point, the leading edge is along a line that has delx = dely and dely = -delx (or with both signs reversed). We can assure that we've looked at every pixel in the leading edge using various means, such as taking 1/2 pixel steps, or delimiting the leading edge region as a small obliquely oriented rectangle and finding all pixels within it. Let's take a single line segment representing the leading edge. It will have three regions: A central black one, and two ends which should be white, in our model, just as in our horizontal flea. I have (tediously) drawn and example by hand in Figure 1.

FIG. 1. The black pixels in the line identified so far are filled with black. The pixels to be inspected are marked with an X. The red segment of the leading edge line should be black pixels and the green portion should be white, in the model of the moment. The arrows indicate the direction of the flea's advance, which is allowed to gradually change direction at each step.