Wednesday, December 30, 2009
Week 14 Day 3
It was only when I narrow down on 2 suspected variables, tested them and realised the variable just after them was not initialized, I intialized it and it worked fine.
Although I have managed to solve this error, but was upset over the large amount of time spend on discovering just a simple error
Week 14 Day 2
Grabbed an old working copy of the rubic cube, and as I observed, all common methods were the same, nothing was missing and yet there was still the multi-colour problem.
Monday, December 28, 2009
Week 14 Day 1
Although I have failed in 2.4km run, pull up (did only 3 out of 6) and standing board jump (210 out of 216), I am gald that the school is providing a training opportunity for final year students every saturday.
Sunday, December 27, 2009
Week 13 Day 4
Wednesday, December 23, 2009
Week 13 Day 3
Tuesday, December 22, 2009
Week 13 Day 2
The problem was fixed by implementing an if-else to only allow the program to proceed to process image if the variable required was not null.
I have also implemented proper positioning for the windows of the rubic cube application (the rubic cube windows won`t stack on each other now), and also the exit function which will exit the program.
Currently I am working on the save and load functions for the min and max hue, saturation and value for each color, and will complete that by tmr
Monday, December 21, 2009
Week 13 Day 1
Another changes I made that fix the memory leak would be changing one of my method in the loop of a thread, from taking in parameters to not taking in any parameters (just using and modifying the variables globally.
However, I encountered a setback. While I was using the "Leak" performance tool to check for leak again, it crashed around 3 seconds after the application has launched. I take a look at the debugger and saw this :
2009-12-21 16:08:37.962 3DTestApp[4067:7903] *** _NSAutoreleaseNoPool(): Object 0x10ebe0 of class NSCFNumber autoreleased with no pool in place - just leaking
Stack: (0x91edff4f 0x91dec432 0x941ad394 0x94282218 0x94281b32 0x94528023 0x942813ef 0x94280dc6 0x94489ef4 0x944882ab 0x9350e13d 0x9350d57b 0x9350d3e0 0x93529e29 0x93529bce 0x935292a8 0x935290e4 0x5743e2)
3DTestApp(4067,0xa0310720) malloc: *** error for object 0xffffffff: Non-aligned pointer being freed
I did a search and realised that this has got to do with objective C and the solution for Objective C was to use a class called NSAutoreleasePool, which I tried and when implemented it gives lots of syntax errors with the codes, when there were no syntax errors in C++. I have posted this question on various forums, and seeking for answers to it now.
Sunday, December 20, 2009
Week 12 Day 5
I must admit when at first I saw Kevin, Chittanya testing out the CornStarch experiment at the Pantry, I was not surprised of how it jumps as I know the science behind it. But seeing on this day how much fun, joy and knowledge it brings to the children, I must say the experiment is of great value and learning to the children.
The day passed fast and soon the children were at IHPC watching 3D movies and playing games using LightDraw. It was interesting seeing them playing the puzzle games and pinball using lasers, and we were so focused on how they were playing that many of us were telling them where to point.
In the blink of an eye, it was the closing ceremony of the ReachOut 2009 event, and I was standing in the training room as they were giving out presents, one by one, to each of the children. Some of the presents were so big that the children have trouble carrying it, and I was also surprised to learn that these gifts were the gifts the children have previously written on their wish list. This means that if the children request something expensive, IHPC will also buy? WOW how I wish I was them haha.
The end of the day ends with the Children returning home by bus happily. A joyful and meaningful day indeed, hope IHPC will have more of these events in the future.
==============Reflection=============
This week saw me being involved in integrating multi-threading to the rubic cube, and it was my first time doing multi threading for a 3D application. Although there are many errors I have encountered on the way, I have found programming in 3D not as hard as I initially thought.
This week's reach out was the most meaningful event that occurred throughout my internship. The whole IHPC workforce brought joy and gifts for over 60 of the children from Touch Young Arrows, and it was a great experience interacting with the children, seeing how interested they are in science, and their enthusiaism.
Week 12 Day 4
From the Leak Performance tool, there wasn`t any variable names provided, only method names, and I could only narrow down to one of my method, ProcessImage, as the cause of the leak. To ensure that this information was correct, I commented out the method that is suspected to produce memory leaks, and indeed, the Leak Performance tool shows the memory being stablized thereafter.
Wednesday, December 16, 2009
Week 12 Day 3
After I run the application, I realised that the cube is still very slow in its turining.
After some trying, I swapped the processing of the rubic cube with the position of the codes that copy the captured image from the camera to another variable, but realised it is still the same.
I then decided to try putting the reading of the image from the camera and the processing of the image into the one separate thread, letting the main thread do the 3D drawing. This fixed the problem and now the cube draws at an acceptable speed.
However, I am now having memory leaks in the application. I used a tool called Leak and realised that during the runtime, the program can take up to 1.5gb and still growing amount of ram before it crashed. Could not find the loophole in the code today, and I will attempt to work on this tomorrow.
Tuesday, December 15, 2009
Week 12 Day 2
After seeking guidance from Ming Hong, I realised that I could actually put the processing and updating of the camera frames in the display method that would be run by the glut_main loop, and leave the main method to execute the glut_main loop. I tried implementing it however got a crash. Will look into this error and fix it tomorrow.
Monday, December 14, 2009
Week 12 Day 1
I have also discovered that why using the negotiation method I implemented on Friday, it will result in the camera waiting for the program to be ready and vice versa, hence defeating the purpose of multi-threading. Hence, I will be trying out a method whereby the program will instead store a copy of the fram being captured to another variable, and the processing of colours will then use that variable for controling the rubic cube.
Friday, December 11, 2009
Week 11 Day 5
Today I switch my programming task with my partner, and currently I will be working on the multi threading feature of the rubic cube instead. One interesting thing I found out was that C++ does not allow reading from camera in threads other than the main thread. As such, what I am implementing now would be to place the reading of the camera frame in a infinite loop (till the user press 'q' for quit) in the main method, and it is working successfully.
In order for the reading of the camera to a frame to work successfully in a loop with other threads sharing the frame, I have to implement variables to ensure that when the frame is captured, the other threads will read the frame before allowing the frame to be replaced with a new frame.
Today was also the day where Kevin would be leaving Singapore and returning on January. Manage to see Kevin for the last time this year at 3pm, but didn`t manage to say much. If you are reading this, I would wish you to say thanks for your guidance and advice all along, it is because of you that our internship was a great and fun one ! Haha, and I will ensure when you come back to January, my presentation will be 200 times better than how I presented previously.
==========Reflection of the week ===============
This week seems to pass quickly as most of the time was spend on programming. However, I have learned and implemented turning of the rubic cubes, gained knowledge of problems when multi threading is used for reading a frame from camera, and also on my weakness and strengths in presentations.
Probably I have realised in many things I do, I still do the same old mistakes, and that was due to lack of practice. Certainly I believe I can improve on these, and I will be attempting from now on to change these
Thursday, December 10, 2009
Week 11 Day 4
As such, I now have to limit the user to only move a particular surface in only a partricular direction.
Howeer, despite most of the rotation working smoothly now, I found out that there is a serious problem with the bottom and top layer right and left rotation, which caused some cubes to go missing suddenly.
Today I have also fixed the insufficient memory crash by moving all images declaration to the outside of the draw rubic method, and into the global declaration part
Wednesday, December 9, 2009
Week 11 Day 3
- Talk slower
- Don`t beat around the bush
- Ensure content is relevant
- Ensure content is correct
- Skip through forgotten items, not pause at them
While for the speed wise, I still remember the embarrasing moment when our school was having Japanese Exchange (where students from Japan came to visit TP) and I was presenting a speech. I was so nervous and anxious that I talked like a bullet train, and my Course Manager, who happen to be seating at the first row have to signal to me to slow down.
The rest of the day was spend on continuing the improvements for the rubic cube application. Currently I realised that if the cube is rotated halfway in a specific direction, and another rotation is applied to it, some cubes will go missing or the whole plane of that cube will split up.
To prevent this, I am writing codes to make the cube turn to a 90 degree position before another rotation of another direction will be taking place
Tuesday, December 8, 2009
Week 11 Day 2
With regards to the turning of the cube, initially I programmed it to rotate a full 90 degrees so long as it detects a finger moving downwards. However, it could not function well as the limit of the distance for the cube to start rotating does not seems to work smoothly with my experiement.
After some advice, I decided to programme the rubic cube to turn in accordance of how much distance the finger moves across that particular plane or surface, and it worked well.
The last improvements of the day was snapping the rubic cube planes to a full 90 degrees in the event when the user does not move the distance required to do a complete 90 degrees rotation.
I encountered some calculations error where the program shows that the rotation is a complete 90 degrees, but in actual fact the rubic cube planes are somewhat not a complete turn.
After much advice, I realised this was due to modulus with negative numbers, which produces unexpected numbers. It now works fine.
Monday, December 7, 2009
Week 11 Day 1
However, I realised this caused severe lagness in the turning of the cube. After advice from my supervisor, I realised that it was due to the frame rate being set to 1000 max. I changed it to 25 and the laginess is reduced, but not as perfect.
After much consideration, I came up with 2 ideas. One was to call the camera detection method in a different thread, and the other was to call the camera detection method only every half the maximum frame.
I tried the 2nd method, and the cube now draws quite smoothly. I then proceed to draw a small rectangle to indicate the position of the detected fingers. However, as much as I try, I still did not mnage to get the application to draw the rectangle out. Will continue to check this on tomorrow.
Sunday, December 6, 2009
Week 10 Day 5
Besides that, for a rotation to be perfect, rounding off errors need to be prevented, or else some cubes on certain parts of the rubic cube may suddenly go missing. This is due to the fact that if there are rounding off errors, one cube may touch the other cube upon rotation, and this may cause the cube to intersect with another cube, hence the cube may only appear partially or even disappear completely.
I will be starting on integrating this rubic cube application into our initial holotouch application next week, and hopefully when this is done, we will have a presentable application.
===========Reflection==================
I have spend the entire of this week into coding with OpenGL. Similar to my coding experience of asp.net, where we learn the drawbacks and advantages of these technologies only while we are developing for it, I have also learned the pros and cons of OpenGL programming, and have completed a rubic cube with the help of MingHong(supervisor).
Indeed learning something new takes time, but it helps to open up another dimension. For me, I have been developing web applications for mostly simplifying paperwork, and OpenGL has allowed me to also program visual applications.
Wednesday, December 2, 2009
Week 10 Day 4
The formula was an equation of cosine and sine, which although seems complicated, but he assued us it will not be as hard.
As such, I am currently finishing up the last part of storing these points to prepare for the rotation.
Week 10 Day 2
Will post any updates when its done
Week 10 Day 1
Continuing from last week, I implemented translation to the entire rubic cube, and it worked well.
Currently I will be continuing on the storing of all points into a vector containing a struct,which contains more variables and structs.
Week 9 Day 5
This caused the cube to rotate around the top left point instead. I tried to change the x,y and z of the rotation and also putting the codes to draw the uppermost middle and centre cube first, but it doesn`t help in anyway.
Finally, I asked Ming Hong and realized the problem was due to the cube being drawn below the origin, which was not shown in the 3d view. I could do 2 things :
-Change the coordinates for all the cubes so that the uppermost middle and centre cube is at the origin (0,0,0)
-Use glTranslate to move the 3 cubesets that I have created to the appropriate position.
I am currently working on the second solution, and hopefully it solves the issue.
=================Reflection=============
Time passes fast, and today counts the last day of Week 9 that I have worked in IHPC. This week saw me coding on OpenGL for the first time in my life. I have now more understanding of how software like games and CAD draws 3D images on the screen and what OpenGL can do.
It has been a week of coding in C++ on OpenGL, which is new to me, but definitely very useful for the development of the HoloTouch project. I have now thought of various projects that I can make use of OpenGL with, and I am planning to code them after my SIP
Week 9 Day 4
Upon coding for rotation in the other direction, I realise that due to the way the cubes were drawn in my codes, there will be a bit of problem with the rotation of the other side, unless I were to redraw the cube upon every rotation.
As such, I have created a struct that stores a vector that stores yet another struct that stores each details of the individual points declared in my code.
Declaring the struct and vector was easy, but not the storing of the points into it.
Week 9 Day 3
Increasing the color for each of the cubes doesn`t seems to work, and currently my approach was to space it out with a little bit gap again so this does not occur.
Spend the rest of the day thinking and analyzing on how to rotate the cube (each layers) vertically and horizontally together, and currently still in the process of looking for an answer
Sunday, November 29, 2009
Week 9 Day 2
I started off with learning how to create a 3D cube from a tutorial, and using what I have learned, I duplicate the codes for creating the cubes, making more and more appearing.
However, I have realised that some of the cubes seems to go out of shape when I attempt to positon them close together. Although this can be fixed by creating a small gap between them, but I am trying to find a solution for them to have no gap and yet able to appear correctly
Monday, November 23, 2009
Week 9 Day 1
Today was spend mostly on bug fixing and code enhancement. Also watched Mr.Kevin and Mr.Ming Hong present this morning. It was simply atonishing, and I have alot to learn from the way they present themselves, talk about the product, as well as interact with the audiences.
Week 8 Day 5
Nevertheless, I have learned something not taught in my diploma course (Matrices is only taught to Gaming Diploma students), and that will definitely be useful in the course of HoloTouch Project.
Though I am abit worried about the time available for creating the rubic cube (suppose to submit today), but I think learning has to take place step by step. If not, misunderstanding of concepts occur, and will result in possible delay.
Though studying svd was somewhat boring, it proves to be a useful concept to learn.
=====Reflection of the week=====
In this week, I have read and studied on Singular Value Decomposition, and its use in not only graphic or Human Computer Interactions, but also in Search Engine, Sales and many other marketing areas.
Simply I was atonished about how much these businesses uses Matrix. Matrix though it seems simple, but its concept does takes time to understand.
Though I do have a bit of struggle coping with understanding Matrix, but preserverance has helped me to undeerstand the complex concept of Matrix.
During the process, I have learned on how small things, which we mostly are ignorant of, can be so useful in our lives.
Week 8 Day 4
Surely, I will need to spend time on it to make sure audience will get inspired by it, and not just treat it as some usual boring applications. Hopefully when the manual calibration mode is done, I shall start on changing the way the application manages its color range.
Week 8 Day 3
Still, there are many examples to try, and many more to learn.
But nevertheless, this is the start of a new invention, inspiration as well as opportunities
Week 8 Day 2
Week 8 Day 1
There are many of these great ones online, but due to being new to Matrices, it took me almost half a day to learn finish and fully understand the first chapter of the tutorial, still 5 more to go.
Basically matrices are 2 or more values stored together in a set, and we are learning it as it can be used to store coordinates of our hands during the development of the "steoro" version of HoloTouch.
Tuesday, November 17, 2009
Week 7 Day 5
After the color tracker has once again been tested and presented, it is being put aside and we were to study on 2 things :
1) Matrix Multiplication
2) Single Value Decomposition
Our goal now was to study these 2 topics and apply them into the later part where we were to program with 3D graphics
The end of the week was fast, and soon it will be the start of week 8. Hopefully I can complete the studying of SVD and Matrix Multiplication by either tuesday or wednesday
===Reflection====
This entire week saw me programming with the camera to detect colors, as well as to write codes to ignore conflicting colors in the background. Although I was abit tired from the vigorous testing needed, but at the end I have successfully written a workable and tested code.
This brings me back to my memories of my assignment days, were debugging feel tiring to me, but still, I have manage to complete a working assignment in time that is enhanced.
The principle that I can learn through this process is perserverance and prevention of procrastination. Procrastination is the tendency to postpone certain task due to mood, and it was said by Adam Khoo as the No.1 Killer of Succcess. From all of my experience, I would totally agree with Adam Khoo.
Thursday, November 12, 2009
Week 7 Day 4
I have finished the part on the setting of values, and now progressing towards manual calibrating, where users will need to lift each finger, and move it around a small rectangle, for the program to detect the HSV for each finger's color
Wednesday, November 11, 2009
Week 7 Day 3
This was due to the fact that if we do not do this, we will have to find out the values for each color each day, as the color range detection values changes from day to day (which I am not sure why).
Completed the portion on detecting the environment's highest HSV and lowest HSV, and currently progressing towards comparing the environment's HSV to compare to a hard coded HSV, and then add the different to the pre-defined color range
Tuesday, November 10, 2009
Week 7 Day 2
This is because in our trial tests, we manage to move a graphical rectangle with our hands, and it really seems as we are moving it with our physical hands!
This was somewhat something interesting from the days of coding we have done on HoloTouch
Another interesting thing I discovered today was that in C/C++, when an exception happens, there will not be any error messages, the program will continue on normally, but the method or code will just skip. I was greatly shocked by this, as it means that I may have not even discovered exceptions that may have caused by my codes throughout all my assignments at IHPC.
Indeed C/C++ is a powerful langauge, but I think this is one of its weak point.
Monday, November 9, 2009
Week 7 Day 1
However, today was spend on bug fixing and improvements as bugs occurred during our presentation to our supervisor
Saturday, November 7, 2009
Week 6 day 5
Glad its a Friday once again, and today, I and my colleague registered and tested more colors in the application. We tested it with a coloured gloves (with different colors for each finger), and it worked perfectly.
The rest of the entire day we were thinking of ways for motion detection
Week 6 Day 4
I studied a bit on HSV colors detection and found it to be quite unique. HSV uses an angle for its Hue, rather than a value from 0-255, and it has 2 other values for identifying its Saturation and Value, which I feel, helps to counter the detecting of blue as black, which happened to LAB.
The rest of the day was actually spend on testing of color ranges, fixing and refactoring of codes, and showing our supervisor of our current progress.
After our supervisor left, we tried to register our skin color as a detection color, and was glad it worked well. However,we give up the idea of using skin color as a means for detection of hands, as the solution have quite a number of constraints
Week 6 Day 3
I have added codes to allow my program to ignore the environment's default LAB values, and it does provide a little improvement on the block detection for blue, but that was still not sufficient to allow blue block detection to work completely
Next, I expanded the range for block detection, and put a tighter limit for the initial detection point. This does helps in block detection for red, green and yellow, but blue is now not even detected.
For the rest of the days, I tried on expanding and changing the range for block detection of blue, which apparently still doesn`t work as it detects the surround's dark black as blue
Tuesday, November 3, 2009
Week 6 Day 2
Monday, November 2, 2009
Week 6 Day 1
My goal ahead now is to learn on block detection, and how to identify motion
Week 5 Day 5
Just began to use Macintosh and realize it isn`t as easy as Windows . Imagine a machine with shortcut keys different from Windows (even the simple copy and paste), no start menu, no mspaint, no Aero Snap, and whose mouse is somewhat not as sensitive as the normal mouse that comes with your PC desktops or laptops.
Well, it does takes a bit of time to adjust, and though I am still having some trouble with little stuffs such as failing to remember how to switch between applications, and how to add a new tab to safari, and sometimes missing the completely-easy-to-use Windows 7, using Macintosh allows me to learn yet another OS, and be more "platform-independent" when working in the IT industry.
Reflection :
Yep, its been another week, and I have completed two assignments, now started to work on the real "Hollow Touch" project itself. Up to today, my application is only able to detect and identify one color out of the 4 colours.
Despite this, I have learned more on OpenCV and its potential in the world of movies and design. Though it will take time for me to learn OpenCV sufficiently to complete this project, I believe that with passion and dedication, this will be a fun and interesting assignment for me, and OpenCV will be definitely useful in aiding me on creating applications related to Human Computer Interaction in the future.
Thursday, October 29, 2009
Week 5 Day 4
Wednesday, October 28, 2009
Week 5 Day 3
Feeling sick today, will stop here to take a rest. More details tomorrow : )
Tuesday, October 27, 2009
Week 5 Day 2
Monday, October 26, 2009
Week 5 Day 1
Friday, October 23, 2009
Week 4 Day 5
I have also gradually learn to pace myself to cater to the workload given, and learn more on the importance of punctuality, as well as personal dynamics in the workplace
Reflection for this week :
This entire week I have been continuing and completing the work given to us last week, and we are glad that we had managed to finish it on the date we stated. I have learned on the use of arraylists and vector in C++, the customizing of the panel class, as well as FileIO and XML reading.
Though I have learned xml reading and writing in school, however the approach used in C++ is completely different. I am also glad that I have managed to control some of my busiest day this week, and didn`t mess up things, which I am gald of. However there is more to learn, and I am glad this learning opportunity have been given to me
Thursday, October 22, 2009
Wek 4 Day 4
Wednesday, October 21, 2009
Week 4 Day 3
Its great to see how Windows 7 will bring joy, excitment and efficiency to families, businesses and normal users like us, and also, how it brings out our potential to the fullest.
With great anticipation, I will be looking forward to Windows 7 Launch Tomorrow
Tuesday, October 20, 2009
Day 2 Week 4
Monday, October 19, 2009
Week 4 Day 1
However, there will still be more to do, such as testing, integration with my colleague's code and improvements to the existing code structure to make it suitable for distributing
Week 3 Day 5
Today was spend on continuing on programming the GUI. Succeeded in adding in buttons and textboxes programmically, and realised something:
To set the location of a control (textbox or button), we must assign a Point object to the Location property of that control. Doing textbox1.Location.X::set(2) will not work. It took me a few tries to realise this.
I was also thankful today as a C++ MVP answered some of my programming problems with references and pointers in the msdn forums. He was so detailed that he even taught me step by step how to solve it, and I was so glad that it worked.
Reflection of the week :
This week saw the end of my previous week project and the start of programming a GUI application in Windows 7, Visual Studio. Although I am familar with the drag and drop, and certain features of CLR, such as the Control class and the Form class, I am still unable to complete an application in a short time due to the language differences.
Each language is unique, and although CLR makes it simpler, and Visual Studio makes coding more enjoyable, it is the core of the language that we must know in order to allow us to finish a great project in that particular language.
Thursday, October 15, 2009
Week 3 Day 4
However, although coding in C++ is not simple and easy, it has allowed me to specialise in an additional language that I otherwise, would not have any opportunity to learn
Wednesday, October 14, 2009
Week 3 Day 3 @ IHPC
Missed coding in Visual Studio after a few weeks of coding in Linux, and of course missed Windows 7 also.
Not feeling well today, and I guess this will be my post for the day, will post more things tomorrow : D
Tuesday, October 13, 2009
Week 3 Day 2
Basically the bypass can be done through a while loop (indefinite loop as we do not know how many new lines or space we have), and followed by a code to assign the next node into the current node variable. This simple code will help to bypass spaces and newlines
Monday, October 12, 2009
Start of Week 3!!
Today we started on our project of XML parsing (reading and writing). One of my learning points today was compatibility across platforms. C#, Java and Visual Basic, unfortunately, are under the .NET framework and therefore are not cross-platfrom compatible, unless you were to install a special application on Linux and Mac (called Mono). The language that I learn and know to be cross platform is Flash and Actionscript.
Indeed, in the business world, although many things are made cross-platform through an application (eg. Mono), but more of the focus is on allowing the application to be cross platfrom without requiring the user to install additional software
Thursday, October 8, 2009
Week 2 Day 5
It was due to the fact that my existing vector had actually stored lasers that are alive and not alive, and the coordinates vector only stored lasers that are alive. It was resolved by declaring another vector to store only the ID of lasers that are alive
Another thing I learned would be string concatenation in C++. While in C# and Java we could just use string s = "id : " + idNum; In C++ this will not work. We have to use an Osstring to store the entire concatenated string, and then convert it to a char array(char string) type.
Reflection of the week :
Time flies and its the end of my 2nd week at IHPC. I have learned deeper into svn, open cv, and programming with cameras and lasers, which I had never done before in my polytechnic education.
This week was interesting as we touch on programming, and learned more on C++. All along I have heard C++ is a powerful language used to program games, applications, and even Operating Systems, and only when programming using it, I realise it is indeed true.
This week also had me learning more about time management as I have to rush over to Microsoft and discuss events at 6.30pm, while managing my work in IHPC. Time was indeed a bit tight for me, but nevertheless, I struggled a bit, managed to made it.
Indeed in the working world, time will be tight, and the temptation to procrastinate would be great. Adam Khoo once said," Procrastination is the ultimate killer of success", yet in some aspects of my life, I am still procrastinating on.
Indeed next week time will be tight as I will need to take care of 2 events next week, and also quite alot of work at IHPC
Week 2 Day 4
However, when we try out the finished application, it start to draw many crosses, even though no lasers were shown, and the position of the lasers being drawn are critically weird. As the Lightdraw application is suppose to return only a range of x and y coordinates between 0-1 in range, the application appears to retrieve data of 1,000 and above. The mysterious point was that we put a code to display an output to console whenever a packet is being received, and this allows us to see that no packet was actually received when no laser is shone, and this points me to the question : where does all the weird values comes from?
One answer from my internet research would be they are uninitialized values.
With the help of Ming Hong, we used a Vector instead to store the data received, and it worked perfectly well, with no weird values received. I also found out that I was all along using the wrong way to pass an array or object into a method.
The correct was actually :
passInArray (& myArray);
and not :
passInArray (myArray);
Furthermore, I have also came to know how to use Vector today
Time flies, and tomorrow would be the end of my 2nd week in IHPC, and yet it feels so much like my first day at IHPC. The amount of data (opps, I mean knowledge) I gained is definitely more than what any of my subjects would have covered, and I am gald that I am given this opportunity to have this internship at IHPC
Wednesday, October 7, 2009
Week 2 Day 3
While moving the algorithm to the actual lightdraw application, I manage to see and play with the source code of LightDraw. The entire code for Lightdraw was quite complex, and fortunately thanks to Ming Hong's help in explaining about some parts of the code, I was able to understand and thus discover about some syntax that I have never seen before.
After some trials, the algorithm worked, however it only manage to show only one cross (for only 1 laser pointer) now. Besides, the cross also would not disappear even after the laser pointer is no longer shining on the surface. Ming Hong guide us about this, and we would need to make use of the "alive" messages in order to solve this.
Overall, today have been an exciting day working with codes and laser pointers, and learning more into how LightDraw was developed
Tuesday, October 6, 2009
Week 2 Day 2
For first, I have managed to code up a C++ application that displays what the video camera see.
Next, simply just 2 lines of codes were added to include a "press c to capture" function. For these 2 features, I realise there wasn`t much coding that needs to be done. All the methods to do up these features were provided by OpenCV libraries, and all I need to do was to code up the while loop (to loop the capturing of image), and some variables.
As according to tradition, I captured an image of my SIP-team mate, victor, doing coding, which I believe would be the first few photos in this pictureless blog so far.

After lunch, we moved on to the last tasks which was to create a circle enclosing the area which is the brightest. I spent about an hour googling on contours and some RGB stuffs, only to find out that all that were irrelevant, and only one method, cvMinMaxLoc was needed. This method does not return objects, but it takes in memory address of 5 things, the converted single-channel (or colour) image, min(darkest) value, max(brightest) value, min(darkest) location and max(brightest) location (or spot), and write data to the variables at this memory address.
Thereafter, we used cvCircle to draw a small red circle with its centre point at the "max(brightest) location". The program worked out fine, and when we shine a laser light on a dark surface, it just feel great to see that the application is able to circle out the laser pointer's lightspot on the dark surface.
Next, we then moved on to removing the red circle when the laser pointer is not shining. First, we identified the brightness of the laser pointer's light spot on the wall, and was surprised it was the max value (255). After setting up an "if" statement to only draw the circle when the brightest spot is 255, the red circle now disappears whenever the laser pointer is not shinning, and reappears upon the laser pointer begin shone on the wall.
Monday, October 5, 2009
Week 2 Day 1
For instance the creation of repository, and the importing of files into it. During my major project days, we used assembla.com 's repository. Assembla created a repository for us when we create an account, and as such most of the time we used svn and cvs were regarding commiting, updating or reverting. The friendly tortoise client did the command line commands for us, so much so that we don`t even notice what goes on behind it.
To first create a repository, a directory will need to be created in either svn/
During the next half of the day, time was spending on re-installing Fedora, and reconfigurating it to prepare for our actual work. The problems re-occurred reminded me of my first experience with them, and I was able to solve them more faster than when I initially faced them. However and unfortunately, due to a lack of understanding of svn, alot of time was spent on tracing and trying to solve the problem than doing actual work, and soon after Kevin show us the solution, the problem was due to the simple fact of missing the simple step of setting permission.
I would certainly feel the day have been wasted by my lack of knowledge in Linux components and my forgetfulness, and certainly I would have learned and achieved more things back today if I remain calmer and thought more carefully. As such, my goal for tomorrow would be to learn at least 4 main things, and finish up on the things Ming Hong have given me
Friday, October 2, 2009
Wee1 Day 5 @ IHPC
In the event where the system does, ./configure would then compile a script that would compile and install the program specifically to suit the environment of the current system. Thats where we would run "make", which compiles the source codes in the installation packages into a executables. "make install" is then run to install the respective executives or libraries into the system.
In the afternoon, we also learned about programming CV library. Created an application that draws rectangles and circles on a dark background. I have also found an application in the "samples" directory of OpenCV that can detect faces in photos! Thats something very cool! Imagine if we could even enhance the application to patch up pimples or eye bags in photos, would that save designer a lot of time? Apparently I looked through the source code, but am still unable to comprehend the code, but determined to learn it by Sunday, and possibly modify the application to work with larger photos (currently it can`t even run with pictures larger than 500 px by 500 px)
During the afternoon, me and Vic also watached "Pirates of the Silicon Valley", and found out various discoveries :
1) Steve Jobs set up Apple earlier than Microsoft was being set up
2) DOS was not created by Bill Gates, but bought from another programmer instead, and improved by Bill Gates
3) The starting point that result in Bill Gates prospering was his partnership with IBM
4) Both Bill Gates and Steve Jobs already came together to help each other in the past, not only just in recent times
Certainly there are many other points brought forward by the movie which could be untrue, butI would check them out over the few days and post them when I am certain they are true.
This week was the week I learned the most, as compared to any days I spent in my school. Although there were many difficulties, but with the help of Ming Hong and Kevin, I made it through, and learned many things I had never even thought before
Reflections:
Indeed life in SIP is different from life in school. No more waking up late and no more late nights out. These, even though initially I worried that I might not be used to switching over, but I am now able to. As compared to the life before, I can feel I am now more heatlhier and on schedule than before. Thus, I would consider this a great improvement to my life.
Through the first week of my SIP, I learned about Linux, its origins, its distributions, and how to install programs in it, its terminal commands. We have also learned the concept of ftp, ssh and remote desktop, and the actual use of it. Other than this, we also learned Console output and FileIO in C++. OpenCV library was one of the most fascinating libraries I have came to know. LightDraw was developed 2 years ago using the same OpenCV library I am learning about now.
In the past, I have always taught that high level programs like LightDraw were developed using new and advanced languages, such as ActionScript 2.0, and now, I am just simply fascinated it was developed just using the C programming language.......and just with OpenCV library.
This has taught me in life that we should not neglect the ability of simple things to create miracles. LightDraw was something big and extraordinary,but it was not developed using C#, not Java, not C++, but just C.
Hope everyone have a nice weekend ahead :)
Thursday, October 1, 2009
Day 4 of the first week
In C++,its including the iostream header, followed by : cout << "something" ;
The whole code will therefore look something like this :
#include
int main()
{
cout << "something";
return 0;
}
Also with FileIO, in C++ is fairly simple :
ofstream outfile ("test.txt");
outfile << "This is the text I want to write to this file, followed by a new line character" << "\n";
outfile.close();
Yep, unbelievable, just 3 lines only!
Also learned about pointers, and that there is no ArrayList in C++ (in C#, ArrayList allow us to store, sort, remove any tye of object).
Next we moved on to OpenCV library. Unfortunately, the newly release version 2 (released just yesterday) caused many problems while installing, and eventually it took up the whole of the day. However, reading Lup Peng's blog, Open CV library seems to be able to do wonders of modifying images, and creating even special effects in them.
If only I could remote to my IHPC's computer now.....and start on discovering the magic of OpenCV...
Wednesday, September 30, 2009
Week 1 Day 3
There are so many distributions (or type) of Linux, not because of the development team, but because of distribution people who put together the different components of Linux (such as Messenger for Linux, FireFox for Linux) , and they called their combination names. An example would be Ubuntu and Fedora.
Currently, the most popular Linux OS is Ubuntu, not because it has a nice name, but because the person who combined the components to form Ubuntu focuses more on making it work well, rather than being concerned about the availability of the source code for its components.
Another key learning point today would be the use of FTP,SSH service and Remote Desktop in Linux. Indeed Linux doesn`t like me, encountered many failure while trying to install and run Remote Desktop. At last Kelvin came to my help, and another GUI Remote Desktop service, called vino, was installed and used, and I was gald it finally managed to work. The Remote Desktop service installed in Linux can not only be used to Remote Windows Desktop, but also MAC desktop, and this is what Windows Remote Desktop is currently unable to do
Terminal commands (or Command Prompt commands) in Linux were also taught to us today. Although some common ones such as cd, mkdir are common to me as they exists in windows, there are many that I have never see before, such as ls, killtask, vi. I am also taught regarding the Linux's structure for its folder, and how is it different from Window's structure.
The last learning point of today would be GNOME and KDE in Linux. GNOME and KDE are developed by 2 different groups, and they are responsible for the display interfaces in Linux. GNOME focuses more on stability whereas KDE focuses more on Special effects, such as transparency. Although KDE does look much better, but it is not as stable, and not too compatible with certain programs too.
For instance, if another machine were to Remote to a computer running Linux using KDE, the Client connecting to the Linux PC running will see some weird colours effect, that is not seen on the actual PC
The day passed so quick that it was like a blink of the eyes, and tomorrow I will be getting started on learning more about C! Feeling excited!!
Monday, September 28, 2009
Week 1 Day 2
Currently the plans for my internship are as follows :
- Now till Mid October -->learning basic stuffs
- Mid Oct till Mid Nov -->LightDraw project enhancement
- Mid Nov till Mid Jan -->Project Hollow Touch
- Mid Jan till Mid Feb --> 2 Applications for Hollow Touch
Now I am still trying out on Fedora, so far installation was successful, Firewall working, Media Player working, Web Browser working.
Currently there are problems with the FTP service ( by proftpd ), which I am still not able to solve by the end of today. Although I have found a solution, which is to use PureFtpd instead, but I wanted to know and understand why ProFtpd failed to work, and hence spend much of the time trying to understand what is wrong with it.
Today we were shown how Graphics were made into Studio images when there are 2 different images (each being seen by each eyes). We were also taught regarding the flickering effect on the Studio Glasses, and how does it help each of the eyes to see different images. When Kelvin explained to me the use of 3D cameras to capture a dimension called depth, I was surprised. I had never known that there is such type of camera, and it actually uses infra red to measure the distance
Our first assignment will be to create an application that allows our hands to interact with Studio objects on the screen, and when its being pushed, it will move according to the direction of the initial action
Sunday, September 27, 2009
First Post - First Day of the week
Thereafter, we were also tasked to research on Linux OS, and select 2 versions that suits what we will be doing. When I saw the list of Linux OS available, I was surprised as I initially only knew about Red Hat Linux OS, and thought that it was the only OS available for linux.
We researched for almost 30 minutes, and was pondering on 32 bit and 64 bit architecture, when Kelvin give us a lesson on the differences and their advantages. Sincerely speaking, if now I were to ask any of my friends which is better, most will certainly says 64 bit, because "it has more bits". It was only today I found out of the advantages and disadvantages of 64 bit. It is able to support > 4gb of memory, however, if the application developed does not use much data type of size 64 bits, there won`t be any differences in terms of speed and performance.
Thanks Dr.Kelvin and Dr.Ming Hong for your guidance
My favorite task was when it comes down to setting up desktops and installing the OS. I haven`t done it for a long long time since my Secondary School days, and I terribly missed assembling PCs, setting up computers and installing OS in them.
Can`t wait for tomorrow to setup the PCs and install Linux OS! Feeling excited once again!