Slow progress

The epipolar geometry turned out to be much harder than I anticipated. I now have enough of it done to be able to check the epipolar constraint successfully. I am now in the process of reworking my stereo matching algorithm to include the epipolar constraint along with disparity, orientation, scale and uniqueness constraints. I’m hoping this will improve my matching algorithm and reduce any false positives. That in turn should improve my localisation accuracy as there will be fewer outliers and less error to minimise.

It’s been pretty hard to find time to work on this stuff recently as we have been so busy socially. I guess it’s that time of year with Christmas parties, catching up with friends etc. We are going to Germany this weekend and are off to India for two weeks from the 25th of Dec so I won’t really get time to do any decent hacking on this for the next month or so. I am really hoping that I have enough of the pieces in place that I’ll be able to make some good progress in the new year and actually be able to report some reasonable results.

I have been doing a little bit of reading about FPGA design lately and am getting quite excited about that stage of the project. I expect that will be immensely difficult but should be quite interesting too.

Moving forward again

I’m finally making progress on my Vision project again. After spending a couple of months trying to figure out how to do nonlinear least squares minimisation I think it is now working. I still have quite a bit of testing to do before I am sure it is giving sensible results but so far it looks good. I couldn’t have gotten this working without the tireless help of Robin Hewitt who (via the Seattle Robotics Society mailing list) coached me through the process.

I have now returned to the beginning of the project again. Before I go any further I have decided to rework what I have done so far. My understand of computer vision concepts has come a long way since I started this project and I am sure I can improve my original code.

To that end I am writing a camera calibration application that will more accurately calibrate my camera system. This program will be able to calculate the intrinsic parameters of each camera and save and load these parameters from file. It will also be able to calculate the essential matrix of the stereo system and hence will be enable me to far more accurately match SIFT features as I will be able to include the epipolar constraint which I am currently not using.

I am hoping this calibration work will have a drastic improvement on the accuracy of the system, but only time will tell I guess.

Finally back to hacking

Finally managed to get an hour or so of hacking in tonight. I’m trying to figure out how to use the nonlinear least squares minimisation in the GNU Scientific Library. It’s pretty tricky and I think it may take a while before I get it sussed out.

I’m hoping to get some time to finish hacking on my changes to the SourceEditorDisplayBinding class in MonoDevelop. This will add the drop down select boxes for jumping to a method definition in code.
Maybe I might get some time for this on Sunday…

So very busy

Had a great time in Berlin last weekend. It wasn’t really what I expected and the really famous sites (check point charlie, Brandenburg gate) left me a bit disappointed. We did see a lot of neat stuff though and we really lucky with the weather. The highlight of the weekend was probably the Berlin Dom which was very cool.

The trip was also the first time I had used my new Sigma 28-200mm lens for my SLR. I found it a real pleasure to use and am really looking forward to seeing what the photos are like. The films should be developed this week so I hope to get some photos up on the website by early next week.

Life is still extremely busy and I haven’t had a chance to do any hacking for ages. Doesn’t look like this week will provide too many opportunites with me busy nearly every night!

Photograpy is hard

I got my first lot of photos developed to day since I started using my Canon SLR again. I have been doing heaps of reading and trying to learn as much as I can about photography in the last few weeks. I’ve decided to finally get serious about something that I have had a bit of a side interest in for years. It turns out that taking good photographs is a lot more difficult than I thought!

I shot a couple of rolls of film over the last couple of weekends playing around with exposure priority, apeture priority, and various other settings on my camera. Pretty much every photo sucks. It has been a lesson in humility and I can see that this will take some practice!

I’ve put a couple of photos up on my web site, mostly so people will have something to refer back to in time to come and be able to see how much I have improved 😉

Here they are:

There are various things wrong with all of them. The most obvious being the photo of the underground train being very blurry but I like it anyway. I intend to retake that shot once I have my new tripod in a month or so.

I got the films processed and digitally scanned at Jessops and am not very happy with the results. I realise these aren’t the greatest photos, but the quality is quite grainy and I know my camera and the kodak film I was using produce better results than this. Next time I think I’ll try Snappy Snaps as I hear they are pretty good.

My blog is stale – but the website’s updated

Well, I haven’t written anything now for over a month. I very occasionally get technology overload. It’s funny when it happens as it is the thing that I am probably most passionate about, but like all good things it is possible to have too much of it. I just find that after coming home from work the last thing I feel like doing is more coding or tinkering with photos in the Gimp or anything that requires too much thinking. I pretty much revert to couch potato status and watch lots of TV, or surf the web as that can be pretty brainless as well 😉

Anyway, the latest bout is over and I am gaining enthusiasm to get started again on some of my projects. I have been well and truly stuck on my vision project for a while so it’s time to sit down and nut out this problem and start moving forward again. There’s also been a new release of MonoDevelop and I am pretty keen to tidy up some work I did a while back and get it submitted.

I have finally managed to update the website with our Scotland photos (many months after our actual trip!). So head over to www.jamesfitzsimons.com and check them out.

We are off to Berlin next Friday so I’ll probably have more photos to post soon. I dug my Canon SLR out while I was at home and finally learning how to use it properly. So, the next lot of photos will be a little different as they will have been taken on film using a much more sophisticated camera, and hopefully with slightly better technique!

All packed and ready to go!

Well, looks like we are all packed for our trip back to New Zealand. I reckon it will take us about 36hrs door to door so am already looking forward to getting there. I have all the important things like my laptop sorted so I can do some hacking on the plane on the way over. This is when I wish I had one of those laptops with a 5-6 hr battery life instead of the measly 2hrs I’ll probably get from mine.

I can’t wait to get home now!

Loads more work and a good weekend

I really need to post more often!

I now think I understand where the errors come from that I discussed in my last post. From what I have read, I am trying to use SVD as if I am doing a rigid body transformation – which I’m not. The fact that I am using a linear method to try and find errors in a nonlinear system means that I am getting a less exact answer than I would like.

As a result I’ve spent the last week trying to understand how nonlinear least squares minimisation works. With the help of some great people on the Seattle Robotics Society mailing list I think I am now getting a handle on it. The next step is trying to figure out the practical application of the mathematical theory to my work. This mostly entails trying to decipher how to call the appropriate functions in the GNU Scientific Library.

I also figured out that there should be no error accumulation. That was due to my misunderstanding of how the ego motion is calculated. I was transforming my SIFT feature coordinates to world coordinates one step too early and was accidentally cumulating the error over each subsequent frame.

Hopefully with the fix to the latter problem and the incorporation of a nonlinear method to calculate the ego motion I should be getting much more accurate results.

In other news, I had a great weekend watching NZ win the Tri-nations with an exciting win over Australia. Had a great BBQ at our place on Saturday night. And to top it all off, watched my Hockey team gain a convincing win in their first game of the season (GO RACERS!) 😉

Tantalizingly close

So close and yet so far. That is how it feels at the moment. I found the bug I mentioned in the last post, and had hoped would be the last piece of the puzzle before I had camera ego motion calculations working, but it wasn’t to be.

I now have a problem with the build up of error over consecutive frames. My sanity check to see if ego motion calculation is working is to run the system completely stationary ( the only option at the moment anyway ). Therefore the ego motion calculation between frames should render a 0, 0, 0, 0 result. i.e No movement in any of the 3 spatial dimensions and no rotation. Unfortunately I am getting results that look more like this after one iteration:
—————————————–
New position after ego motion estimation:
X = -0.044358336825996
Y = 0.025654321647698
Z = -0.003337081060976
Theta = 0.431281320335258

Obviously subsequent iterations compound this error and it quickly spirals out of control.

Now I realise in the real system there will be the odometery feeding into this and the odometery and ego motion will be combined in a kalman filter to get the actual estimated motion. In this way the accumulative error won’t matter so much as it will be dampened by the odometery each iteration.

My concern is that this error is far too big to start off with. I can accept (and was expecting) some error between frames, but in the above example the system believes it has moved 4cm to the left. 4cm is too much. What I have to do now is identify the source of this error. I suspect it may be something to do with excessive accuracy in the SIFT feature 3d position calculations. Any error between calculated feature locations could be being exacerbated by the least squares minimisation. That at least is my uneducated guess at this point. More investigation will hopefully shed some light on this issue.

Nearly there ?

At the risk of jinxing myself completely I think I am nearly at the point where my vision system is correctly calculating camera ego motion! Now if that didn’t make you excited it should because it is very very cool.

I managed to spend a bit of time hacking on the weekend and made a huge amount of progress. Now that I have identified what I suspect (but haven’t yet confirmed) are libsifts short comings and moved to using Lowe’s example binary to extract SIFT features things are starting to work. The matching algorithm I was using to match features between stereo images and between frames was also a bit broken, so I ported Lowe’s example matching algorithm from C to C# and that greatly improved matching performance. So now I have one bug to squash and ego motion calculations will be working. I’m pretty sure I know where the problem lies so hopefully I’ll get that nailed in the next day or two.

At that point I will have one remaining task before I can declare phase one complete. I still have to figure out how to use the camera extrinsic parameters to give more accuracy to the stereo triangulation calculations. At that point the system will be able to accurately build a map of SIFT features observed in it’s environment, and simultaneously localise itself within that environment.