Monday, October 29, 2007

Week 2 (29 Oct - 2 Nov)

Monday, 29 October 2007

Finally, we are down to work. We started the day with Requirements Gathering for the project. Kevin, CT, JL and I pooled our brain power together to think about what system requirements are there for the project. There were many interesting suggestions and potential problems were brought up. Debating and possible solutions were thrown in and we finally narrowed down the tentative specificiations for now.

After lunch at NUS, CT and I were tasked to do image processing from a camera with consideration to light luminance tolerance. Making use of the OpenCV library, CT had already done a mock up and I reviewed his code for the rest of the afternoon. I realised that it is possible to write single if-else statements (argc == 2 ? argv[1][0] - '0' : 0 ).

Apart from that, I also recapped CT's lesson on colour channels and bit depth of each channel. And how to iterate through the rows and columns of the picture (in a way, pixiels) by adding bytes and channels to the initial starting value of the Image structure.

And my favourite site for today:
http://www.cprogramming.com/

And this is what the COVE stands for:


Somehow, I feel like I have seen this before in my dreams..




Tuesday, 30 October 2007

The code analyzing continued today. I had to manually walk through each step of the code to clarify my doubts and understandings on just less than 20 lines of code. I also implemented the idea on using the same image as the input for the output against a dark background within a certain threshold.

Not bad for a day's work I must say. But the program is still suspectable to memory leaks and Segmentation Faults. Hopefully I will be able to solve these two problems before I have to leave for school tomorrow. And that dynamic threshold thingy too. But won't the light pixels get affected by the dynamic threshold too? Questions aplenty, but answers only tomorrow, I shall sleep away the wait.

We also found out the reason on why the computer has only one dual output graphics card. But the dog and pony shows are interesting nonetheless.

And hopefully the .jp servers are up and running on my ride to school :)


Blogger Discovery
Btw, I realized that in compose mode, if there are any angular brackets, they are mistaken as tags. I had written 'less than sign' 20, but it got mistaken as a tag and my entry went missing.




Wednesday, 31 October 2007

Got to work right on time today. Since I had to take 1/2 day off to go back to TP to talk about the MSP program to the top 20% of junior year, I thought I'll be extra hardworking.

I got in and immediately started work on the dynamic threshold. Managed to implement a working prototype but the camera was constantly out of focused. Fearing that I've destroyed the iSight, CT came to my rescue and proved that it was more of the coding than the hardware which caused the problem.

Apparently, by using a same pointer to the image to do multiple things, the image got distorted. When I duplicated the image to another pointer, the image sharpened back to normal. Strange huh. I also solved the segmentation error with this change of code. The segmentation error came about when the camera attempted to read/write from/to a nonexistent or protected memory location or attempted to take two screen shots without first clearing the first one. With the duplicate pointer, the segmentation fault disappeared :)

However, the code still suffers from memory leaks. I wonder where the leak is coming from..? Perhaps that is another story to tell on Thursday.



Thursday, 1 November 2007

I came to the office in the morning to a pleasant surprise. CT had already fixed the memory leak problem and the program was working fine. It was able to detect the various light sources and show it up on the screen based on the threshold set.

JL also managed to blend his images together, though there is a bit of a problem - when the images were too bright, darker images were not able to be blended by the camera. Nevertheless, it was really cool to see his blending in action. Next, Kevin asked us to combine our work together. Initially, we had hit a dead end - because we had customized our code so much, it was kind of hard to integrate both pieces of code together without first understanding the algorithm and workings of the other. We decided to break for lunch at NUS for the beautiful view and food. After lunch, we continue to tackle the problem and we finally managed to combine the code, after being encumbered by memory leaks and lacking of pointers.

Though light sources can now be retained on the canvas, we are now looking into improving the algorithm in terms of blending the light together.



Friday, 2 November 2007
Get up, get up morning. Good morning, Keep on Movin'

Just a phrase from a song that got stuck in my head when I woke up. Right now, taking some time during work to blog about yesterday and today. Oh well. Shall update this part a bit later.

Later is actually on Monday of the following week - I'm making the update 3 days late. Oh well.

What can be said about Friday? Hmmz.. We finally realised why the light halos were appearing - the threshold for the light was too low. Increasing the threshold works, but because light conditions may change during actual deployment, I was thinking of having a slider/button and a method to reconfigure the dynamic threshold as and when required. We also tried to play around with some methods to blend the light sources together so that it creates better light blending, but some of the methods made the program run slower though.

Apart from that, we also celebrated Hari Raya and Deepavali at IHPC. Finally getting to see everyone who works in IHPC (about 170). We had a presentation on each of the festivals and some hands on activities related to the festival (such as Ketupat folding). After which, we were treated to some standard catered food and we talked to Kevin and Harold about our views on software piracy and open sourced. The short talk opened my mind to broader perceptions and values over this controversial topic and the advantages vs disadvantages of using either.

With that, we finally ended the day. I stayed back a bit to make some of the blending and threshold work for the project, but was unable to accomplish anything except the realization of the reason behind the light halo.

Lets hope the next week will be more interesting. Oh and hope Kevin gets well really soon :)




Reflection for the Week:

Working with people on new projects is very fun. Especially when everyone on the team is committed and light hearted. This milestone has given me a really good hands on opportunity in coding with C and OpenCV libraries on Linux and Mac OS X. Nevertheless, there is still lots to learn and understand. There are many times where we have to take the initiative to improve on our working prototypes without being told to do so.

After finishing my part on Wednesday and combining the code on Thursday, I was tempted to just stop doing as I have reached the intended end goal. Why bother about some minor flaws when the main functionalities are there? This is typical in some projects where after fulfilling the requirements of a certain grade, I would stop and focus my time on other projects. But I decided not to waste my time at the COVE waiting for time to pass and work to end, but instead to improve on the prototype to make it better.

When working in a new environment, I learnt that there are many things which I had taken for granted back in school (I mentioned this previously). Many times, we have to be extra careful so that we do not offend anyone with our decisions or do things that gives us a bad impression. Also, the familiarity of my teammate's perception of things as well as their proficiencies in development makes me take for granted their skill set.

Nevertheless, I see all of this as part and parcel of a working life - a valuable experience to prepare me better for my future job. In fact, I am already (hopefully) adapting to it.

On a more relaxing mood, check out this really cool meeting room located in Biopolis. Would be cool to have a meeting overlooking the city.



See you next week.

No comments: