Monday, December 3, 2007

Week 7 (3 Dec - 7 Dec)

Monday, 3 December 2007
Ahh! Monday, a start of a brand new week. After the long weekend, inclusive of being burnt from a 22km kayaking expedition around Pulau Ubin, its back to work.

Circle Detection and Rectangle Detection seems okay - but a problem arises from the code: When drawing of the rectangle or a 4-sided polygon, the user may have an unstable hand or be unsure of the direction to travel to create the appropriate shapes - which may result in a rectangle having 4 distinct sides. But in reality, after the cvDilate-ing and cvCanny-ing it, there will be 1 to 3 additional points detected along with the 4 distinct corners due to the uneven width of the light and the straightness (or rather, the un-straightness) of the line being drawn.

Solution: to modify the rectangle detection code in such a way that it is able to dynamically detect shapes with 3 or more corners and draw its outline. This way, there will not be a need to have a set of code for each shape, starting with a triangle, polygon, pentagon, hexagon, etc.



Tuesday, 4 December 2007
Tuesday.setTasks = Monday.getTasks();

I'm still doing Monday's task.

Some trivia: RSVP is the abbreviation of the French phrase répondez s'il vous plaît,




Wednesday, 5 December 2007
This blog has been discovered! There is no more hiding in the shadows of my inner random thoughts. Perhaps some censorship is needed in the following 9 posts (9 weeks). Oh well, just do until told not to. :)

Odd shape detection. Still on it - still redefining it. Managed to get a more or less accurate code up and running and understand the source code more, including the one line if-statement again, after asking Harold about it and being reminded that I was not learning based on my first week's post. Perhaps I should really take time out of a weekend to read that book I borrowed about C as well as the C++ books that Mr Yeak has kindly lent me.

Anyway, we also discussed a bit about the concept game, its game play and some rules and things to take note. We got a list of tasks to do and will start working on it as soon as I get the odd shape detection with separate polygons being drawn without being connected.

Ms Chiang sms-ed me today informing JL and myself that we had to do a short 10-15min presentation about the lightdraw project to our cohort during our mid-sem briefing (17 December 2007). We discussed this with CT and Kevin and decided to do some progressive introduction via a slide show and a short video show casing lightdraw in action. Time to factor in some time to do script and slides within the next 2 weeks. Probably, there goes my free nights and weekends (if I had any to begin with) :)

And one more thing, Merry X'mas.





Thursday, 6 December 2007
The high wall remains firmly rooted to the ground, unbeaten by the multiple attempts that we have put forth to bring it down. Swaying slightly in the breeze, it looks down on our feeble attempts and laughs.

Perhaps in my imagination.


I'm still doing odd shape detection with separate polygons. There's some progress - at least I know where my previous algorithm went wrong. The corners of the polygon being detected do not necessarily get detected sequentially, thus in a pentagon, the 3rd corner drawn may very well become the first corner in the detected contour. This makes slicing the sequence of points based on the number of corners (like the polygon detection) impossible as there is no way to tell the number of points the user-shape may have, even for a regular polygon, due to the width of the light detected by the camera and the non-linear hand movement across the screen even for straight lines.

Task now: Thinking about how to effectively separate/slice the points, belonging to a single closed shape, from the main sequence of points.



Friday, 7 December 2007
I think I've got it - but only in theory. It took me the entire morning to figure it out, and the entire afternoon to duplicate the code such that it worked via two functions instead of everything lumped together. (Perhaps I'm not understanding the code enough?)

The way that I have thought about to detect if the points within the sequence is by checking, based on the original picture, that the midpoint between them is/are of equal colour, with consideration of thresholding. If they are, that will mean that there is a line drawn between them and they are belonging to the same shape, connected by a line.

However, I've only managed to think about the concept of it. If this concept fails, I'll have to go back to CT's way of manually checking each pixel and defining each pixel to see if it belongs to a certain pattern. Which we suspect will be very slow, and will further cause lag to the software's performance. But we will never know unless we try and then again, with the Mac Pro so powerful...



Reflection of the Week:
This task on odd shape detection for 2 or more shapes is taking quite a while to do (so far till friday, its been 5 days). Well, I admit that perhaps the confusing usage of the various parameters to pass into the functions is one of them. With many parameters being generally explained or the use of terminology with regards to computer vision...

Anyway, that aside, Kevin mentioned to me earlier in the week about how working in an environment outside of school is different in terms of real world experiences. Which I have to agree to some extent. In school, we are unconsciously being spoon-fed to some extent. When assignments are given to us, we already know that they are do-able, and that the answers we seek are inside the lecture notes. We know what is the criteria to score a A/B/C/... (at least for the old system I went through).

Again, I have to clarify my point that it is not that I hate studying in school or I hate being spoon-fed - when I first came into TP-IIT school, I needed all the help I could get to do a simple Hello World program. Spoon-feeding to some extent in school is not a bad thing as isn't it by looking and understanding how others do it that we learn to do it ourselves, and do it better? But just that when it comes to getting exposure on the various industry stuff and what not (e.g. SVN), perhaps these attachments are most ideal in getting the student hands on experience in this aspect.

Working in an environment outside school is akin, IMHO, to doing the bonus task of the assignment, which targets a totally different segment of the working software. However, that aside, for assignments we could always ring on Dr Eng's staff room extension and ask for advice when we meet with some problems (whoops, sorry for disturbing you for the past 2 years, Dr Eng!). But outside of that school boundaries, perhaps some of the problems we are attempting to solve are not even solvable with the state of the libraries/technologies at this point of time (opposite when compared to assignments which we know are possible).

Now, there is no number to call for specific advice with regard to the part of uncertainty. Again, not that I am complaining - it is a good way to gain experience and learn how to solve my own problems. Using forums, interest groups, APIs, white papers and what not. Thankfully, I took up the CDS of "Using the Internet as a Research Tool" (thanks Mdm Jamila) and it is perhaps time to refer back to some of the first few lessons I've learnt in that subject..

At the end of the day, each approach has its pros and cons. And regardless of each phase, we should make the best use of what we have to fully learn as much as we can from our differing experience and grow/develop ourselves.

Next week, I throw another thing up in the air to juggle with my 24 hours each day - studying for SCJP, its test on 29 December. Will I survive?

Wish me luck!



Reminder to myself: write maintainable code...

No comments: