Fighting with computers

Computers are not always friendly.

Thursday, November 25, 2010

OpenCV with Processing


A recent art project requires to do some image processing. This topic is a bit away of what I use to do so I asked around what was available now. Some people suggested me to use OpenCV, which is an open library for Computer Vision projects.

I realized that Processing also had some basic features for real-time image capture. Even better, I learned that there was a version of OpenCV available for Processing.

The reason of using OpenCV from Processing instead of directly programming in C++ is the easy setup you have with processing. If you have a PC or Mac the use of the system webcam is very easy. For Linux systems it is slightly more complicated.

OpenCV makes very easy to do thinks like detecting faces on the image, which is quite funny. There is this book about OpenCV too.

Wednesday, November 10, 2010

Dropbox experience


Once I realized I needed to sync my iPad to pass every tiny file to it though iTunes I was not happy. So when I learned there was a Dropbox version for it that was free I saw an opportunity. Later, I found out that there were dropbox versions available for Linux, OSX and, of course, for Windows.

A bit later, I learned that even there is an app for my trusty Nokia E71 so I can upload picture to a dropbox folder right away.

Since then I've almost stopped using a USB pendrive in favor of dropbox and till now, the server has been great.

In a nutshell dropbox is a shared folder on the web plus an app on each computer that syncs the content of your local folder with the copy held on the Internet. Any file you add or change is modified on the network storage. To put the icing on the cake there is also a web-based access to your data, so if you're visiting a friend or using a lab computer you cannot install software on, you still can access your dropbox account files.

Basic service is free (2GB storage) and there are fee-based accounts for larger data needs. If you don't have an account, you can use this link so you'll get 250MB extra storage and so will I.

Update: Today's system upgrade of my Ubuntu Karmic complained about the key of dropbox package, so it cannot be updated. Here is what you need to type to get it upgraded properly:

sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 5044912E

Wednesday, November 03, 2010

Java and Javastript playing together


One of the features that came with Java 6 is this neat trick: You can have a Javascript runtime on your Java program. You feed it with Javascript code and you can get the value of the variables.

It looks great if you need to use some logic already encoded with Javascript and you need to include it in your Java program. No rewriting is needed then.

I've done a sample program to evalaute a simple arithmetic expression as the first command line parameter of this Java program.