Using Eigen Quaternions and Ceres Solver

So recently I found myself needing to use Google’s Ceres Solver to perform a non-linear batch optimization for my masters. ┬áThis should have been easy as Ceres makes implementing this sort of thing rather trivial. I took a look at their “Simple bundle adjustment” code and soon realized that my Eigen Quaternions and the Ceres Quaternions are in a different order.

Eigen uses the correct initialization order [w, x, y, z] however in memory it stores Quaternions as [x, y, z, w]. Thus you cannot use the Ceres QuaternionLocalParameterization to ensure the optimization generates normalized quaternions. Furthermore, you cannot use any of the Ceres rotation functions to transform the world points into the camera frame. So after some investigation and some help from the awesome guys on the Ceres Solver Google group I finally got it all working. I implemented a LocalParameterization to handle Eigen Quaternions and with some help I managed to use the Eigen based rotations with Ceres Jet objects.

Continue reading

Fixing Library not loaded: libsqlite3.0.8.6.dylib Error in Rails

After updating to OSX 10.9 and switching over to zsh I started experiencing problems with my Rails install. I started receiving the following error every time I ran “rails s -p 12345”:

vendor/bundle/gems/sqlite3-1.3.8/lib/sqlite3.rb:6:in `require': dlopen(vendor/bundle/gems/sqlite3-1.3.8/
lib/sqlite3/sqlite3_native.bundle, 9): Library not loaded: /usr/local/lib/libsqlite3.0.8.6.dylib (LoadError)

Continue reading

My Finds in the World of Pen-testing

So recently I found a number of flaws in a few websites, which I promptly informed the web admins of. Nothing major just a few XSS holes that needed to be closed to prevent persistant XSS. Since then I have been playing around on the site (with said web admins permission) to see what else I can discover. My finds have been glorious, educational and horrifying all in one. Continue reading

Calculating the Number of Digits in an Integer

So today I was presented with a challenge that has multiple solutions but which is the fastest. So I set out to figure it out. The challenge was how can you compute the number of digits in an integer easily. There are 3 obvious solutions but which one is better. So I coded up a basic example of each and tested them out.

The four methods that I have tested are, using strings, log based methods, a loop and divide and a loop with multiplication instead. (See the code below) Continue reading

© 2018 Lloyd Hughes

Theme by Anders NorenUp ↑