Episode III and … Success!

Well, it’s been a pretty good weekend and I’ve just got home from Episode III – Revenge of the Sith, which I can report is actually quite good and grateful departure from the rubbish that has been Episodes I and II. Hayden Christensen manages to display slightly more emotion than a block of wood in this movie, and the final scenes as he makes his transition to become Lord Vader are really quite cool.

I can happily report that I have finally cracked the rotation problem that has been holding me up on the vision system. I can now estimate camera ego motion between frames which is a vital part of the SLAM process. Hopefully some time this week I will have the system actually running properly with the two cameras and prove that it all works.

Anthea and I are off to Seville this coming weekend so I should go start learning some spanish… adiรณs!

Fun weekend but still stuck

Anthea and I had a fun weekend with a trip to Leads castle and some wine tasting at the oldest winery in Kent (yeah, apparently the English make wine ๐Ÿ˜‰ leads castle was great. It has really beautiful grounds and the castle itself is very pretty and we managed to conquer the maze which was fun. They also had about 20 or so birds of prey sitting out on their perches waiting for the falconry display at 1:30 (which we missed unfortunately) and it was really cool to see some of these magnificent birds up close.

I received a little parcel from Amazon on Friday. I’ve finally got my second camera so should be doing real stereo vision soon. I am still COMPLETELY stuck on deriving the rotation from two sets of points using least squares however. I have a set of 3d co-ordinates which represent a set of features observed at time t1, and then I have another set of 3d co-ordinates which represent the same features at time t2. What I am trying to do is establish the translation and rotation of the camera platform between time t1 and t2. The translation is easy, but the rotation is giving me a real headache! I know I need to use a least squares minimisation, but the actual implementation escapes me. It is getting pretty annoying now too as this has held me up for a couple of weeks now. In the unlikely event that anyone reading this knows how to do this can you please contact me!

Ah well, back to reading Math world and my perpetual state of confusion :-/

Nasty little ASP.NET 401 problem

I discovered this nasty little problem the other day while building a couple of simple little pages and I thought I should post it so I don’t forget and waste ages on it again!

Essentially the issue is that if you have custom error pages for different types of http status codes such as 401, 403 or 404 then you will have be prepared to do a little bit coding for your 401 page to be displayed unlike your other error pages which you can automatically redirect to by turning on customErrors in the web.config file like so:

<customErrors mode=”Off” defaultRedirect=”Error.htm” >
<error statusCode=”403″ redirect=”AccessDenied.htm”/>
</customErrors>

The problem with 401 is that if you are using the web.config authorisation section as well, and you have explicitly denied the user permission then their request will be authenticated but not authorised and appears to be terminated before the ASP.NET custom error handler can run. For example:

<location path=”MySecurePage.aspx”>
<system.web>
<authorization>
<allow users=”james” />
<deny users=”*” />
</authorization>
</system.web>
</location>

Here the only way to redirect your user to your custom error page will be to check for this condition in the application_end event in the global.asax like so:

protected void Application_EndRequest(Object sender, EventArgs e)
{
if (Response.StatusCode == 401 && Request.IsAuthenticated == true)
{
Response.ClearContent();
Response.Redirect(“AccessDenied.htm”);
}
}

Note: trying to set your custom 401 page in IIS won’t work either as user is authenticated by IIS, but their authorisation fails at the ASP.NET level

Nasty!

Thanks to Ashraf Moollan

Some productive hacking

Over the weekend I have made a pretty decent amount of progress with my vision project. I have created a simulated stereo system by taking images with the camera on the left hand side, moving the camera and then taking images of the same scene from the right hand side. I then load these images from disk simultaneously to simulate the effect of having two cameras. Hopefully I will get my other camera soon as this solution won’t work for long.

I am now at the point where I can match features between the stereo images and extract depth information from the stereo nature of the images. I have also completed the matrix mathematics that will give an estimate of the image coordinates of a given feature in the next frame given the camera translation between frames. This last bit of work was a bit challenging as it required me to relearn a bunch of linear algebra and trigonometry which I hadn’t used since University.

My next challenge is to use least squares minimisation on the features successfully matched between frames to find the error between the projected feature location and the actual feature location. This will then feed back into the camera location calculations as a sort of error term. I am thinking I may even use a kalman filter to integrate the robot odometry and calculated camera ego motion.

I still have a long way to go before this prototype is finished and I know whether the system will even work or not, but it is pretty exciting to be able to do what I have already accomplished!

Mono and Monodevelop – state of the nation

I installed the new builds of mono and monodevelop last week and having used them a little over the last couple of days I can say they are pretty neat so far.

I haven’t used any of the new features in mono (since 1.1.4) but it does seem to be a little faster, and also fixed a nagging problem I had where everytime I rebooted my machine I had to delete my ~/.wapi directory before I could build/run any mono application.

Monodevelop is looking a little more polished since the 5.1 release. It also runs on 64bit native mono at last which I am totally stoked about! I also installed a (experimental) plugin for svn integration that had been posted to the monodevelop mailing list and this looks promising, although the history functionality crashes monodevelop on my machine (I suspect this may be to do with the version of svnlib I have installed). My only complaints at the moment are that it is a little unstable and seems to crash unexpectly (I’m planning to figure this out and submit a bug report at some stage), and the lack of C# 2.0 syntax support. I am using generics pretty heavily in my current project and including this syntax totally breaks code completion.

Monodevelop is a pretty promising IDE and a great project which I would love to contribute to, if only I had a little more time!

In slightly unrelated geekage, I finally got round to setting up some samba shares on my home network last weekend. So now my house mates can all stream mp3s, video etc from my machine via the wifi network. It’s pretty cool having Linux, Mac and Windows machines all interoperating nicely togeather!

I wish weekends were three days long…

Well, it’s Sunday night and I really wish that weekends were three days long. I could really do with just one more day off this weekend. I feel like I haven’t had a decent break in ages and need a bit of relaxing and unwinding time. Most of the travelling Anthea and I do is pretty full on and not much time for relaxing so I haven’t really had a break since Christmas and beginning to feel a bit flat.

Had a few little wins over the weekend and am feeling pretty happy about it. I finally seem to have my xdaIIi syncing with Evolution properly. I am using SynCE and multisync to sync my Evo contacts, task list and calendar. It seems like a pretty solid setup now. I think my initial problems were down to some faulty partnerships I created while trying to set everything up.

I also managed to get a bit of solid hacking done on my Vision project this weekend. I don’t really have any visable results to show for my efforts, but I know I am making progress. Hard to explain to your significant other that you are really excited because you’ve finally figured out how to calculate the intrinsic matrix for your camera and undistort images ๐Ÿ˜‰

I also managed to get some of the translation and rotation matrix multiplication working. Well actually it’s still untested as of yet, but it compiles and runs. I am rapidly approaching the point where I am going to need to get the other camera now so I can do proper stereo. I was holding off purchasing until I was sure I was going to be able to get the first one working correctly with opencv and mono and have now reached the point where I am pretty happy with it.

Anthea and I went for a huge walk around Hyde park in the sun today. It’s amazing the change in Londoners when spring rolls round and the sun comes out. I’m sure half of London was in the park playing frisbee or walking the dog or playing with the kids, and it’s really nice to see so many people out and enjoying themselves.

Never enough time

So I haven’t blogged in ages. I have been pretty busy with various things, but unfortunately haven’t been able to make much progress on my Vision system lately.

Anthea and I spent 4 days in Prague over the Easter break which was cool. It is a really beautiful city if you can get past the hordes of tourists. Also not quite as cheap as people make out either. I am planning to put photos up on the website soon (I know, you’ve heard that before!).

Finally got my new phone last week, an xdaIIi. Very cool device and I’m loving it so far. Had a bit of fun last night trying to build synce to get it syncing with linux. Unfortunately synce and all its dependancies are hard masked for amd64 on Gentoo, so I had to build it all in my 32bit chroot and am going to try running all the 32bit binaries with linux32 from my 64bit environment. I got as far as creating a serial connection last night and that worked so I think this strategy might just succeed.

Am going to see Neil and Tim Finn in concert at the Royal Albert hall tonight, so won’t have a chance to push on any further with the vision system. I am struggling with the opencv calibration routines at the moment. I need to use these to extract my cameras intrinsic parameters, focal length etc, but it is proving very difficult so far. Hopefully some dedicated hacking this week/weekend will see some progress.

Some progress

Well I’ve made a little progress tonight. I managed to get the conversion from an opencv image (IplImage) format to an ImageMap (essentially an 2d array of doubles) working. This now means that all my work using libsift so far now works nicely with opencv!

I also managed to get a simple C# test app running where I continuously grab frames from my Logitech Quickcam Pro 4000 and display them to the user. It essentially just calls all the opencv and highgui methods using P/Invoke but it’s working well.

It’s finally looking like I might start making some progress again!