As always, when getting into programming as part of an art project, there are always the problem with getting too technical, too advanced, too complex etc. There will always be a big part of a project that will involve learning something new, and pushing your knowledge further to new places. This time, I decided that some of that knowledge I was seeking was to be used towards better programming techniques. As a consequence of being more and more daring in terms of programming, the programs themselves can grow more or less out of proportions. They become very hard to maintain, as they grow bigger and bigger. One solution to this, however, is not to program less, even though that too can be one way to do it, but to implement to fine art of OOP, aka Object Oriented Programming. By doing that, you can split up your files in a bunch of smaller chunks, and Processing will let you have small tabs where each class resides. There are multiple things to gain by this: Firstly, as I said, you keep your program smaller. Secondly you should get a more 'logic' structure of your program, and lastly, it is much easier to re-use to code you are making. There is no doubt, however, that there are many ways to make bad programming, even though the concept of OOP is used. But, starting to implement it, is in my opinion a good idea, so that I eventually, one day, can make clean, logical, reusable code that can be revisited later, even by myself, and make sense.
As far as my project goes, I think it works pretty well, and it goes in the right direction. I have made some pretty good bits of code that works well, but I still have a lot of work to do, to make it all stick together. So far I have made a 'tracker' that works well. That is, I am analyzing a video feed, frame by fram, pixel by pixel, looking for where the pixels differ, thus indicating movement. I am also working on another approach, where the pixels are being compared with a stored image (i.e. background), and thus not sensing movement, but a change over time.
Saturday, April 18, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment