Support ads
Buy us Beer
Categories
Pages

Archive for November, 2010

Reading contacts in Android 2.0+

On one of my Android apps, I added a trivial option to select a contact from the phone’s contact list. This was working fine until SDK version 5, which changed the way the contacts are represented in the phone’s SQLite database. It is using the “newer” class called ContactsContract instead of the deprecated People class

I have spent quite time in order to figure out which was the best way that will fit my needs. If you are in the same position, feel free to use the code below

My example below is will display a two row list of all the contacts, with alphabetical indexing. It is a mixture of code snippets I have found on the net, while may not be optimized; it will definitely give you the hang of things.

Read the rest of this entry »

Share

Kinect and OpenCV 2.1

Hi

Another quicky on how to use Kinect (libfreenect) with OpenCV 2.1. I already saw people do it, but havn’t seen code.

UPDATE (12/29): OpenKinect posted very good C++ code of using libfreenect with OpenCV2.X APIs: here it is. Plus, their git repo now has a very clean C code: here it is.

So here it goes
Read the rest of this entry »

Share

Hacking together a Kinect port

Hi,

Just a quicky on how I hacked together a DIY Microsoft Kinect port. The Kinect port is non standard, USB-like port, and to actually connect it to a PC you must buy an adapter from microsoft for >30$. This is whack. You should make your own. All you need is access to a lasercutter, vinylcutter, plexiglass 1/8″, some copper sheet and solder equip.
Read the rest of this entry »

Share

20-lines AR in OpenCV [w/code]

Hi,

Just wanted to share a bit of code using OpenCV’s camera extrinsic parameters recovery, camera position and rotation – solvePnP (or it’s C counterpart cvFindExtrinsicCameraParams2). I wanted to get a simple planar object surface recovery for augmented reality, but without using any of the AR libraries, rather dig into some OpenCV and OpenGL code.
This can serve as a primer, or tutorial on how to use OpenCV with OpenGL for AR.

The program is just a straightforward optical flow based tracking, fed manually with four points which are the planar object’s corners, and solving camera-pose every frame. Plain vanilla AR.

Well the whole cpp file is ~350 lines, but there will only be 20 or less interesting lines… Actually much less. Let’s see what’s up
Read the rest of this entry »

Share