Monday, December 7, 2009

Week 11 Day 1

Fresh new start of a new week today! Spend the entire day on integrating the colortracker application with the rubic cube application. Apparently I copied the camera detection logic and put it into a method, and call that method whenever the drawcube method was called.

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.

No comments:

Post a Comment