Posts

Use Processing and Kinect in Ubuntu

I'm working on a project that uses Kinect depth camera to detect a person silhouette as I have mentioned before in this blog. Part of the development was done using a Mac because I found a library that enabled me to use Kinect directly from Processing (which I've found very convenient for prototyping). It did not hurt that an OpenCV library for processing was also available. What was missing was a version of the Kinect's Processing library to be used with GNU/Linux. Fortunately, someone took the time to tweak the Mac version to make it work and to post the process online. It did not work for me exactly as it was but it was close. So just in case you want to experience with it, here are the steps that worked for me: Get a copy of the library: git clone git://github.com/shiffman/libfreenect.git Create a and move to a build directory inside libfreenect folder cd libfreenect mkdir build cd build cmake .. make sudo make install Go to wrappers/java and e...

Fixing a broken compact-flash socket (sort of)

Image
A few days ago an incorrect manipulation of the compact flash memory broke my Canon reflex camera memory socket. It was a very bad moment as I was not able to use it in my recent trip to China. Though I was able to get some thin tweezers I was only capable of breaking the bent pin. So my camera was useless now. Once back home, I've tried a simple solution that worked nicely, so nicely I want to share it with you: I just took a strand of copper from an electric wire and I stuffed it in to the hole of the compact flash memory that corresponded to the broken pin. It created kind of a small copper wire brush that makes contact with the broken pin once the memory is inserted. It is a cheap solution to the problem that I've found surprisingly good. If you have several broken pins you may try this, but I am not so confident you'll get a decent contact for all of them at the same time.

Wireless missunderstandings

Though we bring an iPad to China, we ended up not buying a SIM card for it as we were told we could borrow one. But then the card we borrow was to be returned and we could not cut it down to fit into the iPad. My new Samsung Galaxy S could not accept the card as it was SIM-locked so we ended up using the SIM on our Nokia E71. Thus, iPad could use the GPRS access of the phone thanks to JoikuSpot software. Unfortunately, the access JoikuSpot provides does not seem to work for the Galaxy S. Another problem I faced was that the few wireless networks I can access are protected by a captive portal that, once a valid username and password is provided allow clients to access the Internet. My Eye-Fi Geo SD card performs the geo-location for my pictures but only if pictures are downloaded wirelessly to the computer. But Eye-Fi firmware did not support captive portal authentication so I could not use these wireless networks. Unfortunaltey the Eye-Fi card cannot work with JoikuSpot either. A poten...

The other Great Wall

Image
Being in China for a few days is an eye-opening experience: both the future and the past are mixed together here in a curious combination. There are many good things beyond the food: A taxi driver may return your missing phone and the waiter will patiently wait for you to order. Other things are not so nice: don't expect queues to be respected nor all cars to stop at pedestrian crossings, even if there is a red light. Internet experience is also special: Many sites just don't work. Others work like if something was wrong under the hood and finally, the rest work like in the rest of the world. It is not a problem of network speed (though some links could use some extra speed) but of the control the government imposes upon what can or cannot be browsed by citizens and visitors of China. For some visitors like me, showing some pictures on Facebook for family and friends is a common activity when we are abroad. Not being able to even open Facebook or to make a blog entry (like this...

Chinese language

Image
I am honored to have been invited by Beijing Institute of Technology and I am visiting Beijing in a few weeks and I have no previous knowledge of Chinese language. Human languages, as many computer languages, are based on the use of an alphabet. But what if, like APL , you are not familiar with that alphabet? That would be the case should I try to learn Persian or Urdu languages. However, Chinese language does not use an alphabet to build words with its symbols, but each word is represented by a logogram (ideographic or a pictogram or a composition of both). Learning a different alphabet has to be difficult, but learning a language based on ideograms looks a huge endeavor to me. Of course I'm not claiming "I am learning (mandarin) Chinese", but I'm just looking at some of the basic ideas behind the structure of the language and I get the impression the task is not something easy to achieve for the written language. The spoken word is also challenging, but with the ...

Galaxy S: a few months later

Image
A few months of use have given me some perspective on Samsung's Galaxy S. What I have liked is how easy it was to get Gmail working and configuration of services in general. But several things have been confusing and not so nice: for example the use of calendars or the contact lists. It seems you can maintain several calendars and there are different places where you can store your contact list. The initial contact list synchronization was not easy as Galaxy S won't work with Apple's iSync. I used SyncMate application but I did not like either. But I can recommend Dropbox as it is a great tool not only to get content onto your smartphone but also to upload pictures from it. While a do like Android, the system has a lot of room for improvement, the worst thing is the variability on the response time. Sometimes the system is just not interested on what you do. You may get a call you cannot answer for a few seconds because the system is busy doing something else. I do not like...

The rise of plug computers?

Image
A while ago I invited an old classmate over to give a talk on campus. He is working on a new project called Amahi . It is a Linux-based server software. But instead of aiming at the regular PC --maybe the old computer you might have at home-- they are focussing a relatively new breed of computer that some have called "plug computer". But ... what is a plug computer? They are small low-power headless computers that are built inside a power supply. Usual connections are USB ports (to enable external storage or other peripherals) and Ethernet network. These computers do not have a hard-disk drive but a small flash-based storage on board. What these plug-in computers really shine for is as home servers. They need a really small amount of power, usually less than 10 watts, so keeping them on 24/7 is not going to have an impact on your utilities bill. The compact size and silent operation open up many interesting applications (ie. media server, download server, personal website ser...

Annoying Java behavior

Image
A recent class exercise required students to create a program that handle a list of scheduled events. While I was not suggesting a specific approach, I used java.util.Date for handling the time. Events happening in the future can be scheduled by adding a certain value to the current time. System.getCurrentMilis() gives you the value of milliseconds since January 1, 1970 00:00:00 GMT. When creating a new Date object, the default value is the current time, but any number of milliseconds could be used to create any time into the past or the future. I was using this approach for scheduling future events. Later, I was checking, every second, if any of the future events on my list was already due. Unfortunately, I was using .equals() function for that but only a few times worked as expected. The problem was that .equals() function works on a millisecond time base. If the two values compared are not exactly the same number of milliseconds since January 1, 1970 00:00:00 GMT then the answer wil...

It is the Android year!

Image
Well, I might be wrong but apparently Android shipments just overtook Symbian platform during the year 2010. I have been using for quite a while a Nokia E71, which I can wholehearted recommend, but I was told by my carrier that it was time for a change. Of course the question to iphone or not to iphone was raised. Owning five different Apple computers over the years plus an iPad seemed to make me the obvious iPhone customer. Did I tell you we have our own share of ipods, including a couple of iPod touch? However, after buying our iPad it became clear that the way Apple wants customers to behave and use their expensive devices was not very customer friendly. I really hate to have to use iTunes to just add a file to my iPad (thanks Dropbox to make my life a bit easier here). And I find despicable that once I have sync my iPad to a music library I have to lose everything if I ever dare to try to sync with another of my computers at home. I am sure that Apple can make a long case about how...

Roomba: It does the work!

Image
This year we've got for Christmas our very first home robot. I was a bit reluctant to buy an expensive item just to figure out later it might work elsewhere but not at our home. This has not been the case. Since day one, our Roomba performed nicely and the only trouble we've got is that it does not like our low-profile doorstoppers. We've made the comparison between them amount of dirt picked up by us and the one we remove from Roomba. I've to say the robot wins in the "who picked more dirt" game. The only extra work we're doing in preparation for Roomba to clean a room is to remove as many objects as possible that might interfere (i.e. chairs, trash bins, etc). I'd say it's been money well spent (as far as the robot keeps the performance level for a couple of years). What is a plus is that the robot may return to the charge station by itself (sometimes) when battery needs to be recharged. I'd day this is not a feature to trust on, as I'm a...

Geo-tagging with Canon Powershot S95

Image
No, geo-tagging is not a built-in feature on Canon Powershot S95. However, there is an interesting technology for doing that with your favourite camera. I was introduced to that three years ago by googler Mano Marks (of AppEngine fame) but I was not too impressed at the time (as I was not sure how to store that info). However, once I started using iPhoto I saw that application was aware of geo-location information and therefore it could be useful to have it in my pictures. This Christmas I've got a 2GB Geo Eye-Fi SD card as a present. I'm happy to report that it works nicely with my Powershot S95, where each image is shown as uploaded or not uploaded by means of an icon (Eye-Fi cards can wirelessly upload your pictures using wifi networks). Uploaded images contain geo-location information, so when you import them into iPhoto they will include location information on where each picture was taken. This cards use the same Skyhook database used by other devices to pinpoint locat...

Silhouette extraction algorithm

As shown in the video above I have been working on an algorithm to extract a person's silhouette for an arts installation I am working on. The main idea is to use the depth map provided by Microsoft's Kinect so only a small range of distances are used to identify the person standing on a certain spot marked on the floor. By discarding those pixels that are too far away and those too close what is left is the person or other obstacles placed a that desired distance from the camera. It is a bit tricky to make depth and RGB cameras to match exactly the same image (as they are located a few inches apart) so video shows some discrepancy between the dancing user and the drawn contour line. Code was written in Processing using Daniel Shiffman's kinect library for Macs, OpenCV library and MovieMaker library to create an output video file of the action. In the mean time I was developing this, Daniel updated his library and some changes were needed. Unfortunately, OpenCV for Proces...

At last, Canon S95 RAW format supported on Snow Leopard

It's been half a year since Canon PowerShot S95 appeared. Today I'm happy to learn that together with a software update to the "crashy" iPhoto '11 comes a software update for new cameras on Snow Leopard .

Playing with Kinect

I was learning OpenCV for a new art project, but then I learned that the new Microsoft Kinect device had been hacked by a Spanish student after the bounty offered by Adafruit Technologies . This news changed it all, as Kinect drivers for several platforms were made available. I needed to extract the silhouette of a person from the exhibit space and having a depth image as the one Kinect provides made my job ten times easier. The previous plan was to keep an image of the background and substract the current frame from it to detect changes. But handling changes in lighting conditions was a bit challenging. What Kinect provides is a regular color (or infrared) webcam plus a second camera that measures depths (ie. each pixel brightness represents the distance to the kinect of that scene point). If you want to isolate object from an scene that are at a certain distance from the camera, all you need to mark those pixels between a certain value range on the depth image. Simple,...

How not to buy from Dell

Image
I had some funds to kill and I thought a new small laptop running Windows 7 would help me not to be a total illiterate when it comes to whatever changes come with W7. I wanted to replace my old Acer Travelamte 3002 WTMi that served me well (though loudspeakers failed almost from day one). A quick look around the web showed that Dell M101z model could be a good choice: good value, acceptable battery time, small and not too heavy. I've never bought from Dell before but I guessed it won't be difficult or unpleasant: I was wrong. First of all, I wanted Dell to produce an invoice to the name of my employer. I contacted with Dell chat (sorry, not available over the weekend) and I asked them for help. I was provided an email of a Dell representative dealing with my employer. I sent her an email and waited. After 24h with no answer, I contacted Dell chat again asking how long should I wait to get an answer, as this being my first time with Dell I was not aware of what the typical servi...

OpenCV with Processing

Image
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.

Dropbox experience

Image
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...

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 .

Save yourself some trouble with iLife'11

Image
Just for testing it I installed the new iLife'11 on one of my systems. I mostly use iPhoto and I was happy with iLife'09. What I can see now is that iPhoto look has changed to be more similar to iMovie on the user interface. Some floating menus (like photo adjustment) are not embedded on the application window and general look is worse IMHO. But this is not the only problem. Calendars are no longer available on iPhoto, so it seems they will be back soon . The worst thing, however, happened when I was using the new iPhoto: Suddenly my system stopped responding to mouse click or keyboard. Pointer still moved with the mouse but that was it. I suspend the system and when restarted I've just got a blue screen. I power it off by holding the power button for a few seconds. On the next power up they system asked me if I wanted to send a report to Apple, which I did. Whether this was caused by the new version of iLife or not, I do not know. But my system has been running rock solid ...

Multi-flavor remote access with TeamViewer

Image
Remote access is a cool feature, whether you are (still?) using telnet to remote desktop protocol it is something that is very useful. If you are like me, from time to time you get a phone call from a friend asking for help. Of course her explanations hardly match what you picture in your mind, so many times you cannot help them. If you plan on supporting someone online you can install and configure the computer and networking gear (broadband router?) so you'll be able to connect to that system in the future when there is trouble. Many different solutions can be used, but most of them are OS-dependent. You can do lots of cool things with SSH but mostly on a Linux or OS X system. Microsoft includes the RDP tool for remote desktop access to Windows computers. I've heard about TeamViewer before from a client, but given it was a Windows-only solution I did not pay many attention at the moment. I've recently learned that many interesting choices were available: iPad & iPod ...