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
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
graphics gui programming vision work

Combining Java's BufferedImage and OpenCV's IplImage

java_opencv_imgHi
I recently did a small project combining a Java web service with a OpenCV processing. I tried to transfer the picture from Java environment (as BufferedImage) to OpenCV (IplImage) as seamlessly as possible. This proved a but tricky, especially the Java part where you need to create your own buffer for the image, but it worked out nicely.
Let me show you how I did it

Categories
graphics programming video work

iPhone camera frame grabbing and a real-time MeanShift tracker

i_can_has_meanshiftHi
Just wanted to report on a breakthrough in my iPhone-CV digging. I found a true realtime frame grabber for the iPhone preview frame (15fps of ~400×300 video), and successfully integrated this video feed with a pure C++ implementation of the MeanShift tracking algorithm. The whole setup runs at realtime, under a few constraints of course, and gives nice results.
Update: Apple officially supports camera video pixel buffers in iOS 4.x using AVFoundation, here’s sample code from Apple developer.
So lets dig in…

Categories
3d graphics programming school

Tracing wild rays

Hi
I havn’t published in a while. I was back up with work on a project for uni., work and my writing…
But the good thing with keeping busy, is that after a while – you have something to show for! So here’s what i’ve been working on for Comp. Graphics course – A Ray Tracer.

Categories
.net Networking programming Recommended Software Solutions tips Windows scripting

The proper way to run a remote process

This is the story of my journey to find a way to run a process (or a program on a remote pc)
This wasn’t an easy thing at all…
Overall, I thought, this should be an easy thing to do.
I found this C# code on a Microsoft forums

object[] theProcessToRun = { "notepad.exe" };
ConnectionOptions theConnection = new ConnectionOptions();
theConnection.Username = "username";
theConnection.Password = "password";
ManagementScope theScope = new ManagementScope("<\\\\" + IP + "\\root\\cimv2", theConnection);
ManagementClass theClass = new ManagementClass(theScope, new ManagementPath("Win32_Process"), new ObjectGetOptions());
theClass.InvokeMethod("Create", theProcessToRun);

I tried this code, not after forgetting to disable the firewall on the remote computer – a big downside but I guess if I had gone with it I’d hunt a way to stable port to unblock in the firewall.
 
Then I found the big downside (which can be an upside to some of you):
The remote process this way will never have a GUI window opened (In this example, a process of notepad will be opened in the background).
This can be a big advantage to system admins which want to run scripts.
 
Ok, back to the quest.

Categories
gui linux programming qt Uncategorized video

Qt & OpenCV combined for face detecting QWidgets

As my search for the best platform to roll-out my new face detection concept continues, I decided to give ol’ Qt framework a go.
I like Qt. It’s cross-platform, a clear a nice API, straightforward, and remindes me somewhat of Apple’s Cocoa.
My intention is to get some serious face detection going on mobile devices. So that means either the iPhone, which so far did a crummy job performance-wise, or some other mobile device, preferably linux-based.
This led me to the decision to go with Qt. I believe you can get it to work on any linux-ish platform (limo, moblin, android), and since Nokia baught Trolltech – it’s gonna work on Nokia phones soon, awesome!
Lets get to the details, shall we?

Categories
bittorrent programming Solutions

Cheat your (torrent) way to the top

utorrent_logoPrivate BitTorrent trackers require that you keep a certain upload/download ratio. This basically means that if you download, and don’t leave your client running for seeding for as much as you downloaded, you will probobly get kicked out of the site sooner or later.
RatioMaster is an open source project that emulates your favourite client and sends the tracker with false info, saying that you are uploading. What a great solution for people with low upload rate.
A guy that calls himself NRPG, created his own version of RatioMaster, which added a lot of features to the original RatioMaster.  His version looks out for your opened client, and takes all the random-generated values from it, that way making the tracker very hard to spot the cheat.
So far so good, as this was only the exposition to the situation.

Categories
.net Networking programming Solutions

Scanning your entire LAN for MAC Addresses

Not too long ago, I wrote a network administration utility with specific needs.
One of the needs was to scan all the LAN pool for MAC addresses.
The code will look at your active network adapters, calculate start and end IP according to your address and netmask,
and query all the IPs within that range for their MAC address.
The code is written in C#, and it’s basically going over the whole range in a nested loop.
If you find this useful, you are welcome to use the code: