Categories
graphics Mobile phones programming video vision

Near realtime face detection on the iPhone w/ OpenCV port [w/code,video]

iphone + opencv = winHi
OpenCV is by far my favorite CV/Image processing library. When I found an OpenCV port to the iPhone, and even someone tried to get it to do face detection, I just had to try it for myself.
In this post I’ll try to run through the steps I took in order to get OpenCV running on the iPhone, and then how to get OpenCV’s face detection play nice with iPhoneOS’s image buffers and video feed (not yet OS 3.0!). Then i’ll talk a little about optimization
Update: Apple officially supports camera video pixel buffers in iOS 4.x using AVFoundation, here’s sample code from Apple developer.
Update: I do not have the xcodeproj file for this project, please don’t ask for it. Please see here for compiling OpenCV for the iPhone SDK 4.3.
Let’s begin

Categories
Android Java Mobile phones programming Solutions work

First steps in Android programming

Last week I finished my first Android application. All through the development stage I had to Google a lot for examples which some were really hard to find (even though you can find reference for everything in the SDK, for me, it’s easier to understand from a code sample).
My mobile company allows you to send 10 free daily SMS through their website, and after that each text message is still half priced, so I decided to take a challenge and create a UI that allows me to send my messages from the phone through the website automatically.
The core of my software was pure java, so even though it wasn’t straight forward to accomplish, I kinda know the material.
The main issues were after – when I got to the android implementation and UI
Here are the issues I needed, and will supply examples for in this post:
(Of course – for you that are more experienced than me with Android development, please forgive if I’m not doing everything ‘by the book’, it’s simply what I could find. So if you have any suggestions or improvement please send them to me or post a comment J )

  • How to find out if there is an active network on the device
  • How to create options menu
  • How to create and clear notification in the notification area
  • How to declare your program as “SMS Sender” (‘Complete action using…’)
  • Taking care of orientation (Landscape and Portrait mode for UI)

Here is the code I ended up using. Hope you find it helpful

Categories
3d graphics gui Java opengl programming school video

Advanced topics in 3D game building [w/ code, video]

snails_3dHi
The graphics course I took at TAU really expanded my knowledge of 3D rendering, and specifically using OpenGL to do so. The final task of the course, aside from the exam, was to write a 3D game. We were given 3 choices for types of games: worms-like, xonix-like and lightcycle-like. We chose to write our version of Worms in 3D.
I’ll try to take you through some of the problems we encountered, the decisions we made, and show as much code as possible. I’m not, however, gonna take you through the simple (yet grueling) work of actually showing meshes to the screen or moving them around, these subjects are covered extensively online.
The whole game is implemented in Java using JOGL and SWT for 3D rendering. The code is of course available entirely online.

Categories
Android Mobile phones Networking tips Voip

VoIP for Android is in town


Well, At least when it comes to SIP communication
Update:
Well, there has been a great leap in Android support with VoIP. Skype has released a decent client for most Android based phones (with the exception of Galaxy S, and USA Based clients cannot use 3G), and I have discovered another excellent VoIP client for Android called cSipSimple (If you liked Sipdroid I advise you to check this one out as well. It’s my current default).
Other than that, the upcoming Android 2.3 is said to have native SIP support which is extremely cool
Having said all that, enjoy my original post 🙂

A Smartphone, as its name implies is… eventually… a smart phone! Exactly! That’s what I thought. And as one I should have the ability to run any software that is compatible with its hardware and software.
That turns out to be almost true. VoIP is off the limit.
And it is not because the device cannot handle it, Far from it. It is because mobile companies are afraid for their revenues. When people are using VoIP on their infrastructure, it takes away money from them. Oh you poor phone companies. My heart goes out for you.
And after all the tears run out, I went out to look for some VoIP that DOES work for me. SKYPE of course was off limit. Even though there is “Skype Lite Beta” for Android, it does not support Skype-to-Skype user call. And why should it? Skype is an excellent IM software and VoIP is only secondary (wink).
I then stumbled upon SipDroid. Sip droid is a SIP client for android. This is great if you have a SIP account provider. I for instance, have an account which runs on asterisk server (open source IPBX system).
I got the installation of SipDroid at once! And installed on my phone to try it.
What can I say? It has huge potential. But it is only fully compatible with its mother ship, which is pbxes.com. Luckily (but of course – not a solution) they allow you to enter your own sip account there so you can connect to it through them (like connecting to your neighbor through china… but it works). Although pbxes.com has a strange certification error they claim is negligible.
So, using it directly with asterisk server causes poor outgoing audio which is lame. I’m sure some people might be able to tweak their server to handle it directly and properly but I didn’t manage to do that… nor found proper idea sharing on that subject.
But this client is still in beta stage so I honestly believe it will kick ass when it’s complete.
It’s no Skype, and I hope some Skype-like client like Fring will port soon for Android, but until then, it’s better than nothing.
Two important notes if you want to use it:

  1. If you are planning to download it from the Android Market – You will get a limited version which disables usage of VoIP over 3G/EDGE. So if you want the full one then download it directly from the project page.
  2. VoIP data, is currently 1.20mb per minute, so watch your data plan
Categories
Java programming

No CLASSPATH for you!

The Path of the ClassAs a part of my work, I was asked to create a semi-simulator for JNLP (Web-Start) loader.
The intention was to get the JNLP link, get all the necessary JARS and resources, and send the main class to another process that will run it as a host.
I had no previous in
troduction with JNLP what so ever… Well, first stage: look at the file.
Looking at the file revealed a simple XML file that contained all the necessary data.
So of course, first things first – Get all the JARS. But how?

Categories
3d graphics Mobile phones opengl programming video

Augmented reality on the iPhone using NyARToolkit [w/ code]

nyarrrHi
I saw the stats for the blog a while ago and it seems that the augmented reality topic is hot! 400 clicks/day, that’s awesome!
So I wanted to share with you my latest development in this field – cross compiling the AR app to the iPhone. A job that proved easier than I originally thought, although it took a while to get it working smoothly.
Basically all I did was take NyARToolkit, compile it for armv6 arch, combine it with Norio Namura’s iPhone camera video feed code, slap on some simple OpenGL ES rendering, and bam – Augmented Reality on the iPhone.
Update: Apple officially supports camera video pixel buffers in iOS 4.x using AVFoundation, here’s sample code from Apple developer.
This is how I did it…

Categories
3d graphics opengl programming video

Augmented Reality with NyARToolkit, OpenCV & OpenGL

arHi
I have been playing around with NyARToolkit’s CPP implementation in the last week, and I got some nice results. I tried to keep it as “casual” as I could and not get into the crevices of every library, instead, I wanted to get results and fast.
First, NyARToolkit is a derivative of the wonderful ARToolkit by the talented people @ HIT Lab NZ & HIT Lab Uni of Washington. NyARToolkit however was ported to many other different platforms, like Java, C# and even Flash (Papervision3D?), and in the process making it object oriented, instead of ARToolkit procedural approach. NyARToolkit have made a great job, so I decided to build from there.
NyART don’t provide any video capturing, and no 3D rendering in their CPP implementation (they do in the other ports), so I set out to build it on my own. OpenCV is like a second language to me, so I decided to take its video grabbing mechanism wrapper for Win32. For 3D rendering I used the straightforward GLUT library which does an excellent job ridding the programmer from all the Win#@$#@ API mumbo-jumbo-CreateWindowEx crap.
So let’s dive in….

Categories
Mobile phones

Android And Me

Last week I got a hold of the HTC G1 Android Developer Phone. This (how else) was preceded by a big fight with my cellular operator who insisted that I will take a data plan.
Ok, I said to myself, I bought this phone so that obviously mean I will use cellular internet. “So how much is that data plan?” I asked the representative.
“It’s 1000K” she replied. “1MB?” I asked in wonder. “No, not 1MB – 1000 KB!”
That’s when I understood she has no clue what she’s talking about. Furthermore, this “joke-data plan” was limited to WAP browsing. Oh come on!!!!
And I can’t replace it for a real data plan; I have to add money on top of it!
Well, I do not want to bore you with this specific war, because this is only a prolog for this post, but let’s just say it pays off to be stubborn. I ended up with no obligation to any data plan (which of course I took one, but now I can cancel it any time).
Now that I’ve got THAT over with, I got around to checking out this wonderful phone (and forgive me iPhone fans – I’m not saying this is BETTER than iPhone, only that it’s DIFFERENT).

Categories
graphics programming vision

Porting Rob Hess's SIFT impl. to Java

beavers_siftThis is a Java port of Rob Hess’ implementation of SIFT that I did for a project @ work.
However, I couldn’t port the actual extraction of SIFT descriptors from images as it relies very heavily on OpenCV. So actually all that I ported to native Java is the KD-Tree features matching part, and the rest is in JNI calls to Rob’s code.
I wrote this more as a tutorial to Rob’s work, with an easy JNI interface to Java.
You can find the sources here: https://www.morethantechnical.com/extupload/code/JavaSIFT.zip
Here’s how to use it:

Categories
blog

More than Technical now on Twitter

 

twitter_icon2

For those who wish to follow us on twitter, you may follow our new twit 🙂
www.twitter.com/morethantech