Wednesday, November 28, 2007

Week 6 (26 Nov - 30 Nov)

Monday, 26 November 2007
I wonder why people call it Monday blues? There was not a single outstanding blue colour in today. Nevertheless, I woke up feeling like I need more sleep. Anyway, back to work on week 6 - effectively making it 10 more weeks to go.

The day started with polishing up circle detection and updating it into the SVN repository. However, a slight glitch ended up with our main file, lightdraw.c being updated with a out-of-date file, which we suspect is suffering from a memory leak. Thankfully, we had the working copy of the code located in someone's computer and managed to revert it. Anyway, SVN has the ability to revert the code to a previous revision in the event of such an accident from happening. Anyway, yea.. that's about it for the morning.

In the afternoon, we visited Dell Computers and talked to their MD with regard to loaning a computer with 2 dual output graphic cards (4 monitors). Its specs are good, with it being able to support a game rendered across three screens as demo-ed in their lab. The reason why they had lent it to us was so that we are able to harness its power to create a multi-screen software to run on its 4 monitors, showing that the ability of what 4 monitors can do, as compared to one. Nevertheless, we brought it back to the office and hooked the system up, but not before looking at its innards.


A cool piece of hardware, hopefully we'll make full and good use of it during its precious time with us. :) With the addition of the new machine, we have also partly reworked the layout of the office to cater to the addition to our new addition to the family. With that, we ended another exciting day at IHPC.

Heard that most people enjoyed themselves at the company's dinner and dance. Cool. Well done Bernard for winning the first prize!


Tuesday, 27 November 2007
Today was spent at CMPB doing my pre-enlistment medical check up. After 4 hours of checkup and doing the test, I am certified as Pes A L1. So is that a good thing or not? hmmz...



Wednesday, 28 November 2007
Today I started with square/rectangle detection. Initially had searched around for Hough Transformation, but its parameters had to be specially catered for each picture of different nature. For example, a picture of a building will have different parameters for thresholding passed into the method as compared to a picture of some bathroom tiles - and finding the right combination of parameters was no easy task. At least to me.

Anyway, after that, we revisited circle detection, with some brainstorming on the various rules we would like to set for the game. JL did a very good job in creating a square on the black canvas and the user/player, would have to draw a circle around it to make it disappear. Something simple for now, but I believe will get more complicated. However, the way which circle detection works for the software is quite strict on the way the circle is drawn. The circle's average diameter between 6 evenly spaced out points (3 pair points) had to be no more than X units different away than compared to the circle drawn by the computer.

On the way home, JL suggested that perhaps one area to look into is that to ensure that the contours are of a certain length before calculating if it is a full-fledged circle. Which might be a valid checking as if the user were to just flash the light once in the direction of the camper, the canny method will cause it to appear just like a contour, with the diameters being close to equal than that of the circle being drawn. Thus the loophole in the game was that if the player were to flash a light quick enough at the center of the square, it will take it that the player had drawn a circle around the square's center. A cheat, probably? :)

So to improve on the algorithm, we discussed about it for quite a while. Kevin suggested modifying the conditions such that they had to be of ratio less than X value before the shape is considered a complete one. However, drawing a long rectangle (somewhat similar to a light trail across the screen) would return false for this checking.

In theory, it will be unfeasible, but in practical implementation...?



Thursday, 29 November 2007
With circle detection being worked on by JL for collision detection ( or rather, encirclement detection ), I moved on to using another algorithm, as suggested by CT - Hough Transformation. Hough Transformation is a rather mathematical approach for detecting circles on the input image. However, it might have worked too well as even normal hand drawn circles were not detected as circles for its lack of appropriate curves of the arcs (or might be my handdrawing is lousy).

Also touched a bit on Polygon detection (but not squares, since squares were detected as circles as well as its average diameter and length of their sides are quite the same). Referenced code on the net and the sample OpenCV codes and edited them to my function. Again, worked really well, but perhaps too well as sometimes rectangles had a slight bump in them (due to shaky or crooked lines from the torchlight) which made the program think it was 5 or 6 corners instead of 4 corners.

Though for other polygons, such as trapeziums and rectangles, they worked fine with the code.

Anyway, Bernard had won the first price at the D&D - which was a Wii. We spent some time playing with it on Wed and Thurs to see what it was really like to play the Wii, after hearing so much about it. It was really cool, using the infrared and velocity estimation (i assume), it was able to detect how much force to use or what action to do during the game. Another great HCI as compared to the keyboard/mouse pair of the traditional gaming controller. However, after playing bowling for a while, my shoulder joint started to ache. Haha. Guess its time for me to get more in shape, by bowling? :)

Anyway, here is one of our Mii characters. I won't say who it belongs to though...




Friday, 30 November 2007
Nothing much can be said about work today. Just did more on circle detection using Hough Transformation (cvHoughCircles). Read Thursday's post for more details.

After telling CT that Hough transformation was rather too accurate, he suggested Morphological Thinning, which meant thinning of the edges of the shape so that it would appear, ideally, as a single line 1 pixel wide. But the point was that the shape drawn was not linear enough to do thinning equally on all sides, as a result, some parts totally got thinned to nothing. Well, I guess there are some pros and cons to each methodology. Lastly, I did a combination of both techniques, but results were not as satisfactory. Maybe its some parameters I used?

Anyway, on the way back home, I witnessed a particular incident - a lady had boarded the train with her two young daughters - unfortunately, there were no free seats available at that time, but thankfully, a young man gave up his seat to her. Well, as all loving mothers would do, she let one of her daughters. The other, she had initially carried her other daughter, but I suppose she got a bit tired so she put her down in front of her older (i think) sister. The best part? The people sitting on the left and right of the mother and two daughters, did not budge. Instead, they just looked at them. Interesting huh?





Reflection of the Week:
Well well well. End of the 6th week, which means another 50 days to go (excluding the weekends of course).

With the nature of the company being a research-based one, there is usually no rush for datelines and/or bindings to specific tools. It was mentioned a couple of times - datelines are quite relaxed and there is the possibility of thinking "what-if" during the project, instead of "how-to".

I also had to keep on reminding myself that I should set a dateline and goal of what I wanted to achieve each day, so that I do not end up coding until 7pm-ish each day. With a proper goal in mind, I can work towards it with confidence and speed.

Last point regarding work, after a while, the objectives become less clear over time and milestones have to be set. Initially we were supposed to create nicer light effect (with edge blending), then work on the game, which is in progress. But because the "game" mode's details about gameplay etc is not really defined, we sometimes veer off course on what we should develop and research on, moving all the way to cross-detection and what not. As such, I found it useful to have mini milestones, even if it is an individual milestone to work on, so that I know what I am achieving or need to be achieved. Speaking of which, I better check with JL after I do the shape detection on what should the proposed specs be...


Another thing I noticed this week is about human nature (off topic on SIP). On Sunday, I attended a Kayaking race (or Canoing Race, if you prefer) and we had like 150+ participants. With many people being their first time attempting the race (me included), they were unsure of the currents and choppiness of the water out at sea, especially near the coastal edges of Ubin. And well, quite a number of them capsized. Even as participants in the race, my friends and I stopped our crafts and helped them back onto their kayaks, even though it was not our job to do so. All in the name of good sportsmanship and what not, right?

However, there were plenty of others before us, who just went past them, without even helping them or staying with them till a rescue boat came to help them - especially when they capsized in the middle of the channel, where other motorized boats frequented. Such incidents, which I reflected on, brought me back to Friday's post on the mother with two daughters and the other passengers on the train to the left and right of them. I mean, considering their age, they might perhaps been privileged to sit on those seats. However, after sitting on the seats so long, shouldn't they realize that there is this mother of two, struggling to balance herself while keeping an eye on her two daughters? Although they are that privileged, shouldn't they give their seat up after they have rested like from City Hall to Bedok, to the poor mother, who ultimately resulted to squatting (you can see her in the bottom right of the picture) to ensure that she can balance herself (lower CG) and take care of her two daughters?

What these two incidents have in common is that these other people, when seeing others who obviously needed help of which they had the capabilities and/or resources to do, merely sat there staring at the situation - somewhat being unable to react to it, or too self-centered to do so?

I don't really know. After all, I am in no position to judge or tell them on what they should or rather, shouldn't be doing, or how they should react. Is this a sign of being self-centered, or just conflicting morals and belief in the right of way?

No comments: