Spare Time Labs 2.0 | |
Welcome EazyCNC jDraft 2.0 PureJavaComm PIC CDC ACM Weather Ten-Buck Furnace
H8S Bootloader
Camera Calibration
Multitouch
Myford VFD Fun with HC08 bl08 printf II Java Goes Native
Densitometer printf jApp Igloo New Furnace New Furnace Part II Linux 101 H8S/gcc Quickie Gas Fired Furnace Down Memory Lane Exlibris Wheel Patterns Glitches CHIP-8 eDice Animato jDraft JNA Benchmark Contact Info |
Created 15.4.2009
Camera Calibration Toolbox for OctaveHere are some notes I jotted down when adapting 'Camera Calibration Toolbox for Matlab' for use with Octave. I've cleaned them up a bit and whipped up a this webpage to help myself and others later when I need to re-visit this issue. Octave, in case you did not know, is a Free (in every sense of the word) Matlab clone that is able to run most Matlab scripts. Matlab is great tool for matrix math that has been around for years. It used to be reasonably priced but nowdays the price is extraorbitant and predatory and the licensing policy leaves a lot to be desired for, especially if all you need is to run some little nice script (like the Toolbox here) that some good man (or woman for that matter) has made available on the net. Fortunately we have a good alternative: Octave. Octave is available for Mac OS X, Linux and Windows. Since I'm mainly a Mac user the following has some Mac specific notes but a lot of the info here is totally generic as Octave scripts are pretty much platform agnostic. I used Octave version 3.0.3, for which you can download the Mac OS X pre-build version of Octave from octave.sourceforge.net, which also includes gnuplot that you will need. However, before going that route and downloading it here you may want to read more. The Camera Calibration Toolbox uses some features that are not part of the basic Octave distribution. Most of the missing parts can be found from Octave Forge. However, I found that the easiest way to install Octave AND all the other necessary gear is through MacPorts. This is not the fastest way to install Octave as this involves building the code on your machine but it was the only way in which I was able to get all the necessary parts to install without resorting to hacking.
Without further ado, after installing MacPorts the following should install everything you need to run Camera Calibration Toolbox. Open the terminal and enter following commands:
sudo port install octave
sudo port install gnuplot
sudo port install octave-plot
sudo port install octave-image
sudo port install imagemagick
(I'm not 100% sure if Next download the Toolbox archive, uncompress it somewhere and add the directory to your path. To do that you can edit your profile (type open ~/.bash_profile) and add a line like: export PATH=${PATH}:~/TOOLBOX_calib 'addpath' command:
Most of the Toolbox code runs pretty much as-is which is a testimony to the Octave Matlab compatibility. The one part that does not run is the main function
You will probabply want to go through the 'First calibration example' described on the Toolbox home page. The first step is to read in the images. The documentation tells you to click the 'Image names' button. Peeping inside the 'calib_gui_normal.m' file you'll see that function name is actualy
octave:1> data_calib
parse error near line 282 of file /Users/nyholku/TOOLBOX_calib/click_ima_calib.m
syntax error
>>> zoom on;
There is a similar issue with 'rotate3d on'. Just delete it. With above instructions you should be able to work through most of the camera calibration.
You will also get the something like following when running
which is because Octave does not (yet) have the
You can ignore this as the plot that this function is supposed to create is already generated and visible when the error occurs. To get rid of the error just delete everything after line 195 or thereabouts. Of course you will not be able to use buttons that the Many thanks for Jean-Yves Bouguet for making the Toolbox publicly available and kudos to all the good folks in the GNU Octave project. br Kusti
|