Archive for December 2010

Real-time Prewitt

I’ve added the Prewitt edge detection code to my libfreenect test application. The results are interesting.

Real-time Prewitt

The image above shows (clockwise from top left): Colourised depth map, image map, prewitt edge detection, greyscale depth map.

The black borders to the left of everything in the depth map really screw the edge detection up. The glossy surface of my desk and the side of my computer react poorly, but differently, to the depth sensor.

I have to create the greyscale image to use as input to the Prewitt edge detection algorithm. I’m using a sub-optimal method of generating the greyscale image, creating it from the colourised depth map rather than from the raw depth values. There is more to converting to greyscale than I thought!

Minh suggested cleaning up the depth map using some morphological operations. I might try this next.

Prewitt Edge Detection

A first attempt at edge detection on a kinect depth map. I used the Prewitt kernel mask convolution method described here.

Prewitt Edge Detection

D&D Update 1: Introductions

Our first adventure began on the road. Two of our party, Gakk and Ti-Lung, were hired by a dwarf merchant named Kofek* to escort him and his wagon from the city of Winterhaven to the city of Fallcrest.

Along the way, the wagon was ambushed by four Goblins from the Moon Hills. The party fought off the ambush and the Goblins fled back into the hills. Kofek was shot in the chest with an arrow, but survived the wound. After the battle, Kofek discovered that a small box containing a prized possession had been stolen from the wagon during the skirmish.

As the party surveyed the scene after the battle, they saw a rider on a jet black horse standing on a distant hill. The figure had been observing the battle, and upon seeing the result, shook its fist in frustration and fled over the hill.

The party left Kofek to recuperate and tracked the Goblins to a cave entrance some miles away. Having found the Goblins lair, Gakk and Ti-Lung noted the location for future exploration and returned to Kofek and the wagon. The remainder of the journey to Fallcrest was uneventful.

Some time later, the Gakk and Ti-Lung chose to return to the Goblin lair to investigate and, hopefully, to recover Kofek’s stolen property. During the journey, the party became aware that they were being tracked by a group of two wolves. The wolves followed the party at a distance until the road led to a ruined watchtower. At the watchtower, the Gakk and Ti-Lung were attacked by two goblin watchmen and the wolves. The battle was fierce and our brave heroes were overcome by the combined attacks of the wolves and goblins. Gakk and Ti-Lung lay unconscious on the road for an unknown length of time.

Gakk and Ti-Lung awoke sometime later in the Inn in Fallcrest, unaware of how they had arrived there. Brief questioning of the innkeeper revealed that our heroes had been rescued by an unknown human woman travelling on a white horse. The woman paid for a room and left instructions that Gakk and Ti-Lung were to be nursed back to health.

Temporarily defeated but unbowed, Gakk and Ti-Lung travelled to the Goblin lair once again. This time the watchtower Goblins were dispatched and the adventurers continued to the Goblin lair.

Our heroes entered the cave and found that beyond the first 50 feet of naturally formed cave, the lair opened out into a defiled temple. The heroes explored the first two rooms of the temple, finding a jet black horse tied up in the first room. They also cleared the first two rooms of several enemies, including a Goblin Hex Hurler and two Dire Rats.

Within the temple, Gakk and Ti-Lung saw several shrines to good Minotaur gods, including one altar bearing a bowl of water. The water remained pure despite the defiled state of the temple itself. Staring into the water granted the characters a vision of another location. Both Gakk and Ti-Lung had never seen the other location before. Water from the bowl also had healing properties, which were useful at the end of the fight with the Goblin Hex Hurler.

At this point the heroes moved back outside the cave to rest and spend an uncomfortable night before tackling the remaining rooms in the temple. Their progress will be revealed in the next installment.

* The name of this merchant was originally Traevus, but this got confusing once the character Trevus Doombringer joined the party. We then took to referring to him as “Coffee Man”, after a fondly remembered coffee merchant that would make daily visits to our former workplace. I have since dwarf-ized the name to “Kofek” for the purpose of this description.